Commit Graph
368 Commits
Author SHA1 Message Date
Kevin Dangoor 232ee9bb0e Turn on preferPrefixMatches for JS code hints.
Adding this option to string matching provides a fix for #3534 by putting
the matches at the same score and using the scope as a tie breaker.
2013-04-24 10:16:19 -04:00
dloverin e1f43e4271 do not add depth color for builtins 2013-04-23 13:22:03 -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
Kevin Dangoor bb7b3c4ce4 Merge branch 'master' of https://github.com/adobe/brackets 2013-04-22 10:16:23 -04:00
Kevin Dangoor 83e5c2de59 Merge branch 'master' into adobe-iwehrman/js-hinter-cruft-removal
Conflicts:
	src/extensions/default/JavaScriptCodeHints/main.js
2013-04-22 10:14:17 -04:00
Kevin Dangoor 5544fd6f38 Merge pull request #3477 from eztierney/codereview-cleanup
Cleanup for comments from pull request #3439, switch to tern hinting
2013-04-22 06:47:48 -07:00
Jason San Jose 10b3aeb7c1 Merge pull request #3491 from dloverin/fix-monospace-font
Fix regressions (from Sprint 23) in the display of literals and keywords in code hints.
2013-04-19 17:13:19 -07:00
dloverin cb96db453c Fix regressions in the display of literals and keywords in code hints.
1. keywords should be monospace.
2. literals should be dark grey.
2013-04-19 09:40:47 -04:00
dloverin 5bd169120c add new identifier colors from Lawrence Hsu. 2013-04-19 08:49:30 -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 f6a073ca3d When typing, only automatically show hints for the "." character and JS identifier characters. 2013-04-17 17:29:48 -04:00
dloverin 725a1e8553 remove Collections.forEach loop 2013-04-17 09:12:42 -04:00
Erik Tierney c5052f8e33 Add a couple of unit tests for jump to definition
Only tests in file, inter file needs more work - have to figure out how to make CommandManager work from the unittester.
2013-04-16 18:49:09 -04:00
dloverin 0f43f548d1 remove CollectionsUtils.hasProperty inside of CollectionUtils.forEach 2013-04-16 16:14:15 -04:00
Erik Tierney ebc6b647c6 Add some more unit tests
covers require support, jsdoc, function types
2013-04-16 11:51:41 -04:00
Erik Tierney daa64a3f3a cleanup from code review
fixed type, delimeter -> delimiter
don't need to escape single quote in double quoted string
2013-04-16 08:48:12 -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
dloverin e0c551d624 remove unused hinting for globals 2013-04-15 10:38:59 -04:00
Erik Tierney d96d73d895 cleanup jslint warnings 2013-04-15 09:43:37 -04:00
dloverin 3eee0bef6f use .value instead of .label to reduce confusion 2013-04-13 11:01:46 -04:00
dloverin ab0b3728a1 Get hint value from 'label' property instead of 'value' property 2013-04-13 09:50:54 -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
dloverin aba25e2705 use StringMatch class to sort hints 2013-04-12 20:54:51 -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 05e0640154 Update tern to pick up a bugfix around Object properties 2013-04-12 15:16:14 -04:00
Erik Tierney e46d260a09 Get all unit tests passing
Fix a caching problem where old hints were getting used.
Update selection tests to search for the index to insert instead of hardcoding the index so the tests are less fragile.
2013-04-12 15:14:26 -04:00
jeffkenton 51edab6185 Fix Jump-To-Definition bug: trying to open new file when search fails. 2013-04-12 13:42:59 -04:00
Erik Tierney 5e11b5abf1 Updates to expected results. 2013-04-12 13:30:11 -04:00
Erik Tierney 1c62677c18 Move tern and acorn submodules into thirdparty directory. 2013-04-12 13:27:04 -04:00
Erik Tierney 40e159981a Remove tern and acorn from current location 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
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 8131900e9b Some unit test cleanup 2013-04-11 15:49:07 -04:00
Erik Tierney fa2bebcfa0 Cleanup - mostly deleting unused code 2013-04-11 15:49:07 -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