Commit Graph
74 Commits
Author SHA1 Message Date
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
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
Erik Tierney a637bd0575 Merge branch 'master' into html-hint-bug
Conflicts:
	src/extensions/default/JavaScriptCodeHints/ScopeManager.js
2013-05-14 11:09:51 -04:00
Erik Tierney b017d7f1d5 Fix JSCodeHint tests so they pass when running all tests.
One of the promises the code hinter was waiting for internally was never being resolved because the directory it was looking for didn't exist.  Now resolve the promise even when the director doesn't exist so we don't just hang.
2013-05-14 10:38:33 -04:00
Erik Tierney 3bc2bd8bd8 Fix hinting so it always works in an HTML file.
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.
2013-05-13 16:51:51 -04:00
dloverin 7288348147 prevent entering doEditorChange while it is waiting to complete 2013-05-13 16:45:00 -04:00
dloverin 7d827e643c fix typo 2013-05-13 11:40:44 -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 dc9aba5fca Merge branch 'master' into load-subdirs 2013-05-10 12:43:28 -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
Erik Tierney 9416e75828 Add tests for jscodehints in an html file.
Also fix some bugs with jump-to-def and function type hints uncovered by the tests.
2013-05-02 16:28:40 -04:00
Erik Tierney 0755c30d58 Basic support for code hinting in html files.
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.
2013-05-02 16:28:39 -04:00
Erik Tierney 6c0a350176 JSCodeHinting - Find requirejs modules even when project root doesn't match the requirejs root.
Looks for any files that end with the name of the module we're looking for.  Does not do any tie breaking yet, but this gets the requirejs support working when you open the 'brackets' dir for instance, instead of the 'brackets/src' dir.
2013-04-23 13:14:16 -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 7b31da7705 fix problem where jQuery was not recognized as a builtin 2013-04-18 11:26:45 -04:00
dloverin 5a2efdf1db add jquery api to hints 2013-04-17 18:04:56 -04:00
dloverin 725a1e8553 remove Collections.forEach loop 2013-04-17 09:12:42 -04:00
dloverin 0f43f548d1 remove CollectionsUtils.hasProperty inside of CollectionUtils.forEach 2013-04-16 16:14:15 -04:00
dloverin 33a016da6d Change for-in loop to Collections.forEach to satify JSLint (looks like a bug in JSLint though) 2013-04-15 17:55:01 -04:00
dloverin 20423c94b9 fix grunt warning 2013-04-15 16:05:46 -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 77a1b7f2a2 Grunt cleanup, and deleted more unused code 2013-04-15 11:11:32 -04:00
Erik Tierney d96d73d895 cleanup jslint warnings 2013-04-15 09:43:37 -04:00
dloverin 6f1982005c Remove refreshOuterScope 2013-04-12 21:43:40 -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 d7adb07f3f Fix merge snafu 2013-04-12 18:34:21 -04:00
Erik Tierney 2e357e63fe Merge branch 'master' into js-code-intelligence
Conflicts:
	src/extensions/default/JavaScriptCodeHints/ScopeManager.js
2013-04-12 18:23:37 -04:00
Peter Farland ec9a5afa83 Remember the resolved path we used with tern so that jump to definition across files work. Also clean-up some error conditions when the definition location is not known. 2013-04-12 16:51:35 -04:00
Erik Tierney aeee6aaa06 If we can't find a file relative to the current dir, look relative to the project dir. 2013-04-12 16:07:04 -04:00
Erik Tierney 1c62677c18 Move tern and acorn submodules into thirdparty directory. 2013-04-12 13:27:04 -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
Erik Tierney c3919edd08 Fix timing problem.
Could end up requesting completions before the tern server was initialized.
Use a $.Deferred so that we don't request any hints until we know the server has been initialized.
2013-04-11 15:49:07 -04:00
Erik Tierney fa2bebcfa0 Cleanup - mostly deleting unused code 2013-04-11 15:49:07 -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
jeffkenton 42ad4f7979 Cleanup grunt complaints. 2013-04-09 09:09:04 -04:00
jeffkenton af9a7f01ab Added Goto Definition. 2013-04-08 15:50:11 -04:00
Erik Tierney aab1d58ef8 more grunt cleanup 2013-04-05 13:25:34 -04:00
dloverin 9d56227b15 remove requestProperties 2013-04-05 13:00:25 -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
Jason San Jose 0315b1629d Add suite param option to SpecRunner and to grunt test-integration task. Fix bug in NativeFileSystem where an empty dir will list the entire disk contents. 2013-04-03 16:38:41 -07:00
Erik Tierney 98e37b1d1e Merge branch 'master' into tern-experiments
Conflicts:
	src/extensions/default/JavaScriptCodeHints/HintUtils.js
	src/extensions/default/JavaScriptCodeHints/ScopeManager.js
2013-04-03 11:30:12 -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
Erik Tierney 08f356c649 Merge pull request #5 from dloverin/cleanup-esprima
Remove espirma and related scope info code
2013-03-29 13:28:17 -07:00
dloverin 0746864409 Remove espirma and related scope info code 2013-03-29 16:08:20 -04:00
dloverin 01f6b2c496 add browser.json to tern environment by default 2013-03-29 14:52:16 -04:00
Erik Tierney 98d05fd296 Update to version of tern with bugfixes to avoid hang when requesting files 2013-03-28 17:05:29 -04:00
dloverin 7bfaedfa0a Use tern to sort ids by depth, remove scope info 2013-03-28 15:06:15 -04:00