When working on a large Firefox plugin, I sometimes accidentally make a syntax error not caught by my editor. When this happens, then calling
Components.utils.import("resource://modules/Foo.js")
will simply fail to import or return anything, without any kind of helpful hint as to where in the file to look for the syntax error. Is there any way I can get Firefox to give me some kind of clue when my imports fail?
EDIT: I fixed my own problem, which turned out to be that I was using code which had a global reference to the navigator object. What made this especially annoying was that the code would work when loaded in the browser (as Wladimir suggested below), but would still fail when importing in my extension.
Eventually I resorted to a sort of manual binary search: I'd delete half of the file and then see whether the import still failed. If so, then I'd delete half of what remained and repeat. As soon as it didn't fail, I had a more precise notion of where the problem was, which allowed me to either continue the binary search or scan the smaller area manually looking for the problem.
This is extremely time-consuming and I'd still appreciate any suggestions about how to speed up this debugging process.
The issue here is most likely the one described on https://developer.mozilla.org/en/Exception_logging_in_JavaScript and setting dom.report_all_js_exceptions preference to true should work. I must admit that I haven't tried that however because setting this preference makes the error console very noisy. Instead I use an ugly hack and load the module as a script in a local HTML file - this is enough to show me syntax errors and fortunately isn't something I need to do all too often (it is only an issue with syntax errors, runtime errors are reported as usually).
Related
fmt.Printf("hello") was working great with intellisense
but suddenly in every go file my fmt.P .. suggestion becomes this
and this
I am not getting "fmt.Printf()" suggestions anymore and getting stuck with those "const", "func", "import", "type", & "var".. what is happening? (Though it is not suggesting fmt.Printf() but it's still working). how can I get normal suggestions by intellisense like previous?
I tried disabling GO official extension, then it got fixed but also I lose all autocomplete/suggestion feature. a go file in root directory is working fine but other files inside packages are showing this kinda problems. Please help
After searching a lot I couldn't find exact problem and solution. And somehow I saw some were facing "case-insensitive import collision:" and it was due to upper-case and lower-case mixture usage in filename. I remembered it seeing in my package name (though this error vanishes sometimes and ignored it as code execution was working) and tried renaming my filename from "sequenceUtils.go" to "sequence_utils.go" and boom ..! intellisense started working ..! though my colleague was working with same filename and he wasn't facing problems..
I think the problem should be properly identified..!
When writing Ruby code, the following suggestion comes up each time the cursor hits an end statement (intellisense-like):
It is very annoying (breaks the flow, since it must be escaped) and useless. I don't know where or what extension it comes from.
How do I determine what piece of plugin injects this suggestion?
And then, how do I shut it off?
In your settings.json file - you have the ability to control which plugin is making recommendations - mine has the following:
"editor.quickSuggestions": null // use rubocop for formatting
"ruby.intellisense": "rubyLocate",
Purely disabling the intellisense functionality would be controlled by these settings.
https://code.visualstudio.com/docs/editor/intellisense
I don't believe that you can purely turn off the 'end' only intellisense - it appears to be an all-or-none proposition.
Various things are different in 1.0.136, e.g. running code with ctrl-enter has all sorts of strange behavior in an RMarkdown document, running code that has a syntax error somehow leads to all of the code being run in a block above (below?) the wrong code, etc. Sorry for not posting an MWE, but at the moment I just want to know if anyone is aware of these new "features" and if so how they can be turned off or better yet how I can just downgrade to the previous version of RStudio (which I can't currently find on the website).
Yes they changed some default settings that were present in the old interface.
Change the setting in markdown next to the knit button, from:
Chunk Output Inline -> Chunk Output in Console
Pictured here.
You can probably mess with the the Global Setting->Rmarkdowns under Tools to get it back the way it was before, but this was the fastest way for me.
I've written a program that runs perfectly in Dart but fails to run in the transpiled Javascript version. I suspect it's an infinite loop (because CPU usage goes up). Has anybody experienced such a behavior before? Maybe even more important, how can I find out the problem?
Yes; this is a big part of my day job.
First, understand that you are most likely dealing with a dart2js bug, not a bug in your code. Your immediate goal is to work around the problem. The end goal, though, is to construct a small test case that you can file on dartbug.com.
Checked mode is your friend
If you are really lucky, enabling checked mode will throw an assertion that will point to the problem. If not, you'll need to dig into the JS.
Using pub serve or pub build --mode=debug will give you more readable code. I usually set my pubspec.yaml up like so:
transformers:
- $dart2js:
minify: false
checked: true
(or checked=false if I'm chasing a performance issue). Then running pub build (without any arguments) will produce to desired output.
Produce a smaller use-case
If you can get Angular out of the mix, the Dart Team will have a much easier time debugging. Failing that, generate a AngularDart application that shows the error on page load.
Print statements
Adding print statements in Dart help you understand the execution flow, but also make it easy to search the dart2js output for good places to add breakpoints.
I find that source maps only confuse things and always disable them.
git bisect
Once you have a small enough use-case that triggers on page load, using git bisect to search your history for the breaking change is quick and impresses your friends.
Dart can generate source maps since a while which makes it quite easy to debug generated JS.
With source maps the browsers show Dart code and stack traces when debugging built JS code.
Source maps need to be enabled in the browser (see https://www.dartlang.org/tools/dart2js/ for details) and in the $dart2js transformer (see https://www.dartlang.org/tools/pub/dart2js-transformer.html for details)
You can get readable JavaScript by running dart2js in debug mode. If you are using pub build you need to use pub build --mode=debug.
I'm trying out Lightswitch for the first time, and I'm finding some of the 'built-in' features aren't as easy to implement as the videos show. The most notable being global queries, because everyone I create is causing a specific error that I cannot find a cause for. I've stripped it down to a query that does nothing but return a 'select *' on the table, and removed any code I've added.
Here is the query in my solution explorer:
And here it is in the designer:
Simple enough, so I add a screen for the query:
Everything is pure default, so why do I get this error? It says it doesn't recognize the query at all, and gives a weird dll error.
I've tried recreating it as a couple different kinds of screens, but I followed this tutorial where they use a List and Details Screen in this way. The best I can come up with is that I'm experiencing a bug due to having VS 2012 and .NET 4.5 installed as well (don't ask me why). I'm just curious if this makes sense to anyone else, or if anyone else has been successful in creating these.
P.S. - I've also been unsuccessful in accessing the permissions I created by their name. I eventually figured out I could reference them by their index, but why is that necessary? I saw nothing about needing to add a reference to make this work.
partial void CustomerNew_CanRun(ref bool result)
{
result = User.HasPermission(Permissions.AllPermissions[1]);
}
OK, just to reassure you a bit (maybe), this is not normal, & I haven't seen this or heard of anything similar.
The fact that you can't access any of your permissions by name indicates something's definitely not right. You should be able to use Permissions.NameOfOneOfMyPermissions.
Starting from the basics, have you rebuilt the solution (note rebuilt, not just built)? What you'll often find with LightSwitch is that one error will cause a whole series of other errors to appear in the list, which can look quite daunting. When you fix the original error, the rest disappear. Double-click the error in the Error pane, & you should be taken to where the error is occurring. If you can't make sense of it, past the code here & I'll see if I can figure out what's wrong.
You'll also need to check that there isn't some code left over from any previous attempt at following the tutorial. Try adding a query with a different name, & see if the error has the new name in it, or the old one.