Commit Graph
47 Commits
Author SHA1 Message Date
Kevin Dangoor 405a493d7e Load and enable the Angular plugin for Tern. 2013-10-10 22:37:41 -04:00
dloverin 0c892a988f Work around issue https://github.com/marijnh/tern/issues/207 by calling Tern.findQueryExpr() and Infer.expressionType() as suggested by marijn. The problem with this fix is it requires a "full" text update with the parameter hint request. Suggested a possible solution in the issue.
The quality of the hints has been much improved and record type annotations can be hinted correctly.
2013-08-15 22:52:31 -04:00
dloverin dd6b19d984 Add feature to hint on '(' key and fix typos 2013-08-12 10:55:24 -04:00
dloverin c994eafc36 Fix issue where "<no parameters>" would be hinted when Tern could not parse the jsdoc.
Fix issue where Session.getFunctionInfo could return 'inFunctionCall' as true but
'functionCallPos' would be undefined.
Fix many jsdoc problems.
2013-08-05 10:22:53 -04:00
dloverin 794c5d1ad8 improve error handling 2013-08-01 21:05:09 -04:00
dloverin d837cd19e2 rename ScopeManager.requestFunctionHint to ScopeManager.requestParameterHint.
add unittests for HintUtils.formatParameterHint
2013-08-01 21:05:08 -04:00
dloverin 8ae1abe419 Add HintUtil2.formatParameterHint and fix bugs 2013-08-01 21:05:08 -04:00
dloverin adb56c0b58 fix unit tests and move function hint type parsing into the tern worker. 2013-08-01 21:05:07 -04:00
dloverin 9e15de2eb7 Function Hints 2013-08-01 21:05:06 -04:00
Erik Tierney b975e6a50d Only go to the original def when dealing with a Function. 2013-06-17 15:18:13 -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 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
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
dloverin 8642920d8c fix hinting on non-ascii characters 2013-05-17 07:43: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
jeffkenton 6c365999bc Use tern jump-to-definition search for QuickEdit. 2013-05-15 16:11:32 -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 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
dloverin cb5572ce04 handle getting guesses in the completions message and remove the properties message 2013-05-13 08:18:35 -04:00
dloverin f2ba60c17f load additional files if the loaded files are not using modules.
refactored unittest files.
2013-05-10 12:34:17 -04:00
dloverin 8d7468b3dc Fix expandWordForward should be false. 2013-04-24 13:33:33 -04:00
Erik Tierney 10f8896d46 cleanup based on codereview comments:
Update jsdoc
use ExtensionUtils.getModulePath instead of manually slicing up path
use FileUtils.readAsText instead of DocumentManager when we only need the text on disk
Call CollectionUtils.hasProperty instead of Object.prototype.hasOwnProperty...
Add comment explaining logic around finding location of called function for function type hinting
remove unnecessary calls to setCursorPos
remove stale comments in unittests
pull out hint invalidation check into a function and remove check for query.length === 0, not necessary anymore
2013-04-18 16:38:40 -04:00
dloverin e5e028e535 remove pending requests and send message from tern-worker on Tern errors 2013-04-15 16:05:46 -04:00
Erik Tierney d96d73d895 cleanup jslint warnings 2013-04-15 09:43:37 -04:00
dloverin a2598a9753 sort library globals below user globals
turn on query.guess to get previously used properties of unknown types
turn on query.origins to get categorize library globals vs. user globals
turn on query.expandWordForward to fix hasOwnProperty bug.
2013-04-12 21:00:17 -04:00
Erik Tierney 1c62677c18 Move tern and acorn submodules into thirdparty directory. 2013-04-12 13:27:04 -04:00
jeffkenton 0bab9dc3fd Make Jump-To-Definition switch to new file when definition isn't local to current file. 2013-04-12 11:17:32 -04:00
Erik Tierney cf26938891 Update to newest tern to pick up some bugfixes 2013-04-12 10:26:54 -04:00
Erik Tierney ee2dd1d518 Fix for issue when multiple requests were made
Were creating a new Promise for each request, but only resolving the last one.  Now check to see if we already have a promise for a particular request, and return the already existing one if there is one.
2013-04-11 16:31:36 -04:00
dloverin c097d198f6 log error for tern 'type' request 2013-04-11 15:20:44 -04:00
Erik Tierney 87de92de12 Hook up initial requirejs support.
Sync to new version of tern, which has support for simplified common JS modules, which brackets uses.
Enable the requirejs tern plugin.  Had to modify how we deal with file paths a bit - we were leaving in the leading '/', which made things look like an absolute path, and then tern would view '/test.js' as a different file than 'test.js'.
Some cleanup - add logging for errors from tern, delete some old commented out code.
2013-04-10 09:49:56 -04:00
dloverin 7d52361aa7 Add StringUtils.htmlEscape() back in.
Remove "types" from a tern query since types are not hinted for identifiers or properties.
2013-04-09 14:35:29 -04:00
jeffkenton 42ad4f7979 Cleanup grunt complaints. 2013-04-09 09:09:04 -04:00
jeffkenton 7bb13cea85 Code cleanup from Erik's review. 2013-04-08 16:46:52 -04:00
jeffkenton af9a7f01ab Added Goto Definition. 2013-04-08 15:50:11 -04:00
Erik Tierney ecfb080fd1 Remove left over debugging code 2013-04-05 14:08:54 -04:00
Erik Tierney aab1d58ef8 more grunt cleanup 2013-04-05 13:25:34 -04:00
dloverin dac2002e04 Add guesses to code hints 2013-04-05 13:00:25 -04:00
dloverin c887e8760f new guessing 2013-04-05 12:51:39 -04:00
Peter Farland d371c0f916 Fix JSHint warnings and exclude tern and acorn related files from grunt. 2013-04-04 22:48:21 -04:00
Erik Tierney c1f1e4498a Update to latest tern and acorn 2013-04-03 14:18:19 -04:00
Erik Tierney 63c89f4d62 Add support for hinting function types.
When in a function call, display the function type instead of the normal hints.  This only happens when nothing has been entered by the user - if the user starts typing, then we switch back to the normal hints based on what the user has typed.

This also requires a new version of CodeMirror that brackets has not updated to.  The old hints continue to work without the new version, but the function types will only work once codemirror is updated.
2013-04-02 17:58:05 -04:00
dloverin a0ee374651 fix bug where hints disappear after first key press 2013-03-28 16:25:01 -04:00
dloverin 7ac5459e6a fix bug where hints disappear on first character 2013-03-28 16:21:24 -04:00
dloverin 7bfaedfa0a Use tern to sort ids by depth, remove scope info 2013-03-28 15:06:15 -04:00
dloverin f9bb81f578 merge in changes from eztierney/brackets 2013-03-26 14:02:32 -04:00
Erik Tierney 412dedf919 Move tern server into a web-worker.
Had to add requirejs to the extension to make everything work in a web-worker.
Added tern-worker.js, and modified ScopeManager to post messages to the worker to find completions.
2013-03-26 13:22:39 -04:00