Modified _waitForJump to wait until the jump promise is done, rather than checking that the cursor had changed.
Updated 1 other test which was looking at everything that was exported from the test module.
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.
* Explicitly call markClean() after clearHistory() since the two are no longer tied
* Pass new "precise" parameter to getTokenAt() to ensure tokens are properly updated after edits (addresses #2335)
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
Don't update the modified range when 'null' keys (ctrl-space) are hinted.
modified: src/extensions/default/JavaScriptCodeHints/main.js
When changing files, reset documentChanges to null.
modified: src/extensions/default/JavaScriptCodeHints/unittests.js
Restore that content of a file after each test.
Update a test to wait for hints after it asks for hints. If the hints are not waited for the editor will be torn down before the hint completes, causing a null pointer exception.
We are currently experiencing problems analyzing ember.js, so excluding it until we can get those worked out. Also adding a max file size limit of 500k.
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.
This avoids some memory leaks that we were encountering. Still looking into those, but this should at least stabilize things and prevent the memory from growing so much it crashes brackets.
To avoid a noticeable performance hit when we restart the worker, we instead start a new worker, and only switch to it after it has finished intializing (including priming the pump). So when we switch between the old and new worker it should be unoticeable to the user.
Had to move around a lot of code in ScopeManager - there are not a lot of actual changes, but the diff is messy due to this.
- 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.