Commit Graph
368 Commits
Author SHA1 Message Date
dloverin d65fbdcacf Allow preferences to be overridden by a configuration file.
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
2013-06-07 08:51:05 -04:00
Erik Tierney bf9c7faa0b Update tern and acorn
Fixes a number of codehinting issues:
issue #3917
issue #3883
issue #3837
issue #3830
issue #3786
2013-06-06 10:48:19 -04:00
Erik Tierney ba49afb6a1 Don't provide hints in string literals
fixes issue #4050
2013-06-05 14:09:10 -04:00
Erik Tierney d01ce6b670 Merge pull request #3927 from dloverin/handle-rejected-hints
handle the case where the CodeHintManager rejects a deferred hint
2013-06-04 08:34:41 -07:00
Erik Tierney c46beee12f Merge pull request #4080 from dloverin/fix-ctrl-space2
Don't mark document as modified when ctrl-space is pressed
2013-06-04 08:31:26 -07:00
dloverin bcba5e3779 modified: src/extensions/default/JavaScriptCodeHints/ScopeManager.js
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.
2013-06-04 10:04:50 -04:00
Erik Tierney a595614c5c Make sure jump-to-def respects size limit 2013-06-03 17:00:56 -04:00
Erik Tierney 75e2b71973 Temporarily exclude ember, implement max file size limit.
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.
2013-06-03 16:14:03 -04:00
dloverin 26981d0ca7 revert ctrl-space fix. Need to investigate possible problem with 'empty' updates. 2013-05-31 16:45:55 -04:00
dloverin d372690e1e handle the case where the CodeHintManager rejects a deferred hint 2013-05-31 14:52:03 -04:00
Erik Tierney 76eaefeb56 Merge pull request #4044 from dloverin/fix-ctrl-space
only record document changes for non-null keys
2013-05-31 10:18:58 -07:00
dloverin 264fc311e4 only record document changes for non-null keys 2013-05-31 12:51:35 -04:00
jeffkenton 476bc5d41c Merge branch 'master' of https://github.com/adobe/brackets into jumptodef
Conflicts:
	src/extensions/default/JavaScriptCodeHints/main.js
2013-05-31 10:03:36 -04:00
jeffkenton 13a8fd0f68 Fix code review issues:
- Make handleJumpToDefinition return a proper promise.
 - Minor cleanups.
2013-05-31 09:48:09 -04:00
dloverin cb8a0e9746 Implement requests with partial file text to reduce memory usage for large 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.
2013-05-30 14:47:58 -04:00
Erik Tierney 856d2814ef Code review cleanup - delete commented out line 2013-05-29 20:52:47 -04:00
Erik Tierney 6e7c1cee3a Kill and restart the codehint worker thread every 30 hint requests.
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.
2013-05-29 15:44:01 -04:00
jeffkenton 43b5b735be Changed Jump-To-Definition, as requested -- modeled on QuickEdit:
- 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. ]
2013-05-29 09:34:51 -04:00
jzhang 3dfead4e05 add new test cases 2013-05-24 16:18:10 -04:00
dloverin e664a00d09 Merge pull request #3983 from eztierney/leaking-workers
Clean up tern web workers whenever we re-init the tern server, or close ...
2013-05-24 12:01:41 -07:00
Erik Tierney 59783847a7 Ensure addFilesPromise won't produce null pointers if the worker is terminated before it is finished. 2013-05-24 14:36:53 -04:00
Erik Tierney bdbef3de9a cleanup - add missing jsdoc 2013-05-24 10:23:21 -04:00
Erik Tierney 79e673f69b Update tern - slow down memory growth when editing codemirror.js
helps with issue #3977
2013-05-24 08:50:52 -04:00
Erik Tierney f6fdc43434 Clean up tern web workers whenever we re-init the tern server, or close a project.
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.
2013-05-23 21:10:57 -04:00
Glenn Ruehle bcb7d51cd7 Merge pull request #3943 from adobe/pflynn/panel-management
Improved panel management - prevent resizing panels larger than available space
2013-05-21 17:20:37 -07:00
Peter Flynn 427914df4b Hoist out a util for creating a mock Editor given an already-created
document, so JS code hints unit tests can share SpecRunnerUtils' mock-Editor
creation code instead of duplicating it.
2013-05-21 17:18:20 -07:00
Kevin Dangoor b3e6b46328 Merge pull request #3920 from eztierney/issue-3768
Make literal's in hints use monospace font,
2013-05-21 10:29:11 -07:00
Kevin Dangoor 93561f0290 Merge pull request #3916 from adobe/dangoor/3610-long-sig
Implements word wrap for function signatures (merging after fixing "minor comment" from @redmunds).
2013-05-21 08:50:30 -07:00
Kevin Dangoor c40b60b94a Makes reformatting code hints explicit.
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.
2013-05-21 09:08:40 -04:00
Erik Tierney 119e2ab056 Make literal's in hints use monospace font, so they look more like keyword hints.
Fixes issue #3768
2013-05-20 13:02:23 -04:00
Narciso Jaramillo 2245e01960 Merge pull request #3847 from jeffkenton/master
Use Tern jump-to-definition search for quickeditt
2013-05-20 09:15:58 -07:00
jeffkenton 8fbbeed10b Change how QuickEdit helper function is passed from CodeHints to QuickEdit:
It now gets set directly as brackets._jsCodeHintsHelper = quickEditHelpe;.

as suggested.
2013-05-17 15:20:09 -04:00
Erik Tierney ded2de1385 Merge pull request #3881 from dloverin/read-dir-fix
fix reading files under the root tern director more than once
2013-05-17 08:36:00 -07:00
dloverin b9636bb97b fix reading files under the root tern director more than once 2013-05-17 11:29:22 -04:00
jeffkenton 706d72d395 Fixes for comments on push'ed code:
1. MultiRangeInlineEditor.js: simplified conditional, as requested.
2. ScopeManager.js: move function getResolvedPath before its use, to make JSLint happy.
3. QuickEdit/main.js: move functionName null check to calling routine for cleanliness.

Things not yet done:

1. QuickEdit/main.js: consolidation of fallback paths.
2. QuickEditHelper: communication between extensions.  Short vs. long term solutions.
2013-05-17 11:01:38 -04:00
dloverin 8642920d8c fix hinting on non-ascii characters 2013-05-17 07:43:08 -04:00
dloverin 4d4d87dd85 fix jsdoc 2013-05-16 16:40:08 -04:00
dloverin 18dd7a144b update the current file in tern when a new file is opened
exclude less*.min.js files
2013-05-16 16:13:45 -04:00
jzhang bd4feb5611 add more code hint tests for html file and module file 2013-05-16 14:45:36 -04:00
jeffkenton 7a86aad095 Tweaks to make some test cases pass. 2013-05-15 17:44:13 -04:00
jeffkenton 6c365999bc Use tern jump-to-definition search for QuickEdit. 2013-05-15 16:11:32 -04:00
dloverin e9ec1993a5 Merge branch 'master' into fix-guesses 2013-05-15 12:48:07 -04:00
dloverin 8142ccdeb6 Fix a bug where the hinter was not failing over to gueses. Added code to Session.getHints to detect when guesses are needed so the caller can get the guesses from tern and call getHints again. 2013-05-15 12:37:43 -04:00
Erik Tierney 05e7252fce Fix crash when hinting with angular.js.
Updated to a version of tern that fixes the bug.
Take out the excludes of minified libraries, as they all work now that the bug is fixed.
Stil exclude require and jquery files since we have json defs files for those that have better type information.
Fixes Issue #3827
2013-05-15 10:37:34 -04:00
Narciso Jaramillo 9b2e9c4611 Merge pull request #3822 from adobe/dangoor/3589-underscore-names
Fix 3589 sort _ names to the bottom.
2013-05-14 15:50:09 -07:00
Peter Flynn 9aba45c02c Merge pull request #3588 from adobe/dangoor/prefer-prefix
Add QuickOpen / StringMatch options for strongly preferred prefix and unsegmented search weighting.
2013-05-14 15:32:19 -07:00
dloverin 1c0da37ba2 apply file exclusion to the current directory 2013-05-14 16:53:21 -04:00
Erik Tierney dfb35c30f5 Update tern and acorn to latest - fixes a number of bugs.
Modified some of the expected output for unittests as tern was updated to produce arguably better results, particularly for jump-to-def.

Changed the jump to def logic so that it doesn't stomp on all the pending requests, and instead plays nicely with the other request types.
2013-05-14 14:34:06 -04:00
Kevin Dangoor 9672c7e19d Fix for #3589. In code hints, sort leading _ names to bottom.
This also alters StringMatch.multiFieldSort to use an array to define the sort order,
though I stopped short of deprecating the old { key: priority } format.
2013-05-14 12:42:16 -04:00
Erik Tierney e30c71f969 Don't need to call initializeSession from unittests anymore 2013-05-14 12:37:13 -04:00