When the result of jump-to-def looks like:
exports.foo = foo;
we now will try and jump-to-def on the rhs, as that's what the user most likely really wants. Jumping to the exports line is rarely useful.
When we get the response for a jump-to-def, if it looks like we're jumping to a member expression like the example above, then we will grab the RHS, and trigger another jump-to-def on that, which should take us to the correct place.
src/extensions/default/JavaScriptCodeHints/Preferences.js
New class to parse JSON preferences object and store preferences.
src/extensions/default/JavaScriptCodeHints/ScopeManager.js
Look for preference file, .jscodehints, in the project root directory.
Remove obsolete "shouldPrimePump" parameter.
src/extensions/default/JavaScriptCodeHints/main.js
Remove obsolete "shouldPrimePump" parameter.
src/extensions/default/JavaScriptCodeHints/unittests.js
Add new preference tests.
Add new preference tests under unittest-files/preference-test-files
Add large comment to file1.js test file so it will be considered a large file and partial text updates can be tested.
For now, move two failing tests apart so they pass. Partial text updates are notas good a full text updates but save memory.
- Now can register multiple jump-to-definition providers (only one, so far).
- Moved jump-to-definition menu setup to top level.
- Added jump-to-definition to floating right-click menu. [ Note: we may not want
this unless there is a provider registered for the current mode, but that's how
QuickEdit does it. We can fix both at the same time if we decide to. Also note
that if we want to change the right-click menu for this, one could argue that we
should also change the top level menu for the same reason. ]
If we don't call terminate on the worker, it appears that the worker, and all the memory it's using will never get collected. So when we were switching projects, we were leaving behind orphaned workers, resulting in a large memory leak.
To enable re-initing the web worker I had to change around the logic - now the worker sends a message when it is done being init'ed and the main thread waits for that message before it starts sending messages to the workers.
Adds a handleWideResults to hint responses (only active for function signature hints right now).
The CodeHintList changes the styling and behavior a bit to suit.
We were not creating a Session if the language of the selection was not javascript. So when opening an html file, if the cursor wasn't in a javascript section, we would get no hints.
For HTML files, we replace the HTML sections with whitespace, leaving only the text of the script tags for Tern to see.
This way the offset/cursor positions don't need to be translated, which would be necessary to get jump-to-def to work.
driven "Jump to Definition". Reorder menu so the ones that use QuickOpen
search bar are all contiguous, while keeping the two "Definition" ones
also contiguous.
In consultation with NJ & Adam.