Commit Graph
298 Commits
Author SHA1 Message Date
Ian Wehrman 0caa95c6a6 Untitled document support using InaccessibleFileEntry objects. 2013-07-12 13:32:00 -07:00
Erik Tierney 9afd44282b Update expected results, as Tern now gives us better results than what the test was expecting. 2013-07-12 10:46:39 -04:00
Kevin Dangoor 6997546af2 update tern and acorn to latest master 2013-07-12 09:12:19 -04:00
Erik Tierney 35821e69db Fix problem with finding next token on next line.
Don't set the selection until we have done the final jump-to-def
should address comments in issue #3863
2013-06-20 10:36:40 -04:00
Erik Tierney 10d8170bd6 Merge pull request #4256 from dloverin/json-error-msg
write SyntaxError.message to console log
2013-06-17 16:58:32 -07:00
dloverin fc4c9eeef3 write SyntaxError.message to console to provide some help for preference file errors. 2013-06-17 17:06:40 -04:00
Jason San Jose b9d69228bc Merge pull request #4205 from dloverin/jody-test3
Jody added some new code hint tests
2013-06-17 13:46:03 -07:00
dloverin 893b3bd29d Merge pull request #4254 from eztierney/iss-3863
Fix Issue #3863 - jump-to-def goes to exports line.
2013-06-17 13:26:40 -07:00
Erik Tierney 6490214cb5 code review cleanup 2013-06-17 16:25:13 -04:00
Erik Tierney b975e6a50d Only go to the original def when dealing with a Function. 2013-06-17 15:18:13 -04:00
Erik Tierney 0f73f04bcc Added unit test for jumping to a function in exports.
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.
2013-06-17 14:50:16 -04:00
Erik Tierney 269c3b77c9 Fix Issue #3863 - jump-to-def goes to exports line.
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.
2013-06-17 13:46:54 -04:00
Erik Tierney 7fbcc4a932 Merge pull request #4230 from dloverin/partial-update-fix
Ignore empty lines when finding a fragment for partial updates.
2013-06-17 08:10:21 -07:00
Glenn Ruehle 10f4054b2f Merge pull request #4234 from adobe/nj/update-cm
Update to latest CodeMirror
2013-06-14 14:06:34 -07:00
Narciso Jaramillo 157775b996 Update to latest CodeMirror:
* 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)
2013-06-14 11:22:56 -07:00
dloverin b53cf8a853 move message to correct location and fix jsLint errors 2013-06-14 11:31:30 -04:00
dloverin c784efb4c7 Ignore empty lines when finding a fragment for partial updates.
Change hintsPrsentExact to verify number of entries match.
2013-06-14 11:03:56 -04:00
Erik Tierney 5435d4092e Merge pull request #4177 from dloverin/pref-regexp-fix
do not wrap regular expresssions in '^' and '$', only strings.
2013-06-14 06:32:54 -07:00
dloverin d174ef0c43 Merge pull request #4211 from eztierney/update-tern
Update tern & acorn
2013-06-14 06:03:40 -07:00
dloverin e06e5e4f6f fix unittests and add FIXMEs 2013-06-13 17:03:08 -04:00
Lawrence Hsu a240c12631 Convert bold to semibold in various UI elements and JS hints. Use Source Code Pro instead of default monospace font for keyword hints. 2013-06-13 10:50:22 -07:00
Erik Tierney 34601065ce Update tern & acorn
tern is now 0.2
acorn is now 0.3
remove exclusion for ember.js, as it seems to be fixed with the latest tern
2013-06-13 09:46:03 -04:00
dloverin 49e25e4f6b remove quick edit tests. Put those tests in quick edit module. 2013-06-12 16:59:01 -04:00
dloverin 8df8808553 Merge branch 'test3' of https://github.com/jodyzhang/brackets into jody-test3
Conflicts:
	src/extensions/default/JavaScriptCodeHints/unittests.js
2013-06-10 11:25:44 -04:00
dloverin fccdb12b02 do not wrap regular expresssions in '^' and '$', only strings. 2013-06-10 09:03:06 -04:00
dloverin 8efc57439b needsNewHints() was not returning true for different function type hints on the same line 2013-06-07 16:40:26 -04:00
Erik Tierney c353fe4b4b Merge pull request #4150 from dloverin/insert-hint-wo-replace
insert hint without replacing text to the right of the caret
2013-06-07 10:28:35 -07:00
Erik Tierney 241b2322ef Merge pull request #4147 from dloverin/pref-file
Allow preferences to be overridden by a configuration file.
2013-06-07 10:26:51 -07:00
dloverin 69410b1ac1 insert hint without replacing text to the right of the caret 2013-06-07 13:12:18 -04:00
dloverin 759c3cd088 preferences for 'excluded-directories' and 'excluded-files' always append to the builtin defaults 2013-06-07 11:37:58 -04:00
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