Commit Graph
99 Commits
Author SHA1 Message Date
dloverin 9e15de2eb7 Function Hints 2013-08-01 21:05:06 -04:00
Ian Wehrman 4485ae8e22 Remove default extension from untitled documents and new files 2013-07-16 14:19:40 -07:00
Ian Wehrman 0caa95c6a6 Untitled document support using InaccessibleFileEntry objects. 2013-07-12 13:32:00 -07: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 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 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
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
dloverin 69410b1ac1 insert hint without replacing text to the right of the caret 2013-06-07 13:12:18 -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
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
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
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
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
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
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
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 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
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
Erik Tierney 72b3669769 Only init a Session for html & js files 2013-05-14 11:00:43 -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
Kevin Dangoor 89ba0925e9 Merge branch 'master' into dangoor/prefer-prefix
Conflicts:
	src/extensions/default/JavaScriptCodeHints/main.js
2013-05-13 14:33:22 -04:00
dloverin 47de2cb19c Merge branch 'master' into load-subdirs 2013-05-13 08:29:31 -04:00
Erik Tierney dfdff356a6 Fix Issue #3614
Don't hint on function, parameter, or variable declarations.
no hints for
var fo// we used to pop up hints here
2013-05-10 16:00:16 -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 678ae5aed0 Code review cleanup - mostly in the unittests 2013-05-09 14:54:40 -04:00
Erik Tierney c162a75dc8 Merge branch 'master' into html-script-hinting 2013-05-09 14:25:58 -04:00
Randy Edmunds e73a877ee6 change deprecated .className to .type 2013-05-05 11:25:25 -07:00
Randy Edmunds 53bf87ed22 Revert "Merge pull request #3697 from jeffslofish/Issue-3676"
This reverts commit 9e99101057, reversing
changes made to a9e27717f4.
2013-05-05 10:46:07 -07:00
Erik Tierney 84c239cf39 Merge branch 'master' into html-script-hinting
Fixup branch so it will merge cleanly again.

Conflicts:
	src/extensions/default/JavaScriptCodeHints/unittests.js
2013-05-03 14:50:57 -04:00
Narciso Jaramillo 984ed97ddd Hack yet another place where we need to use _codeMirror.replaceRange() in code hints to make them work in inline editors because of #1688. 2013-05-03 10:30:35 -07:00
Erik Tierney a5b7100bd8 Merge pull request #3692 from dloverin/first-hint-perf
prime pump to improve first hint performance
2013-05-03 10:16:06 -07:00
dloverin d8b960d12f Merge pull request #3598 from eztierney/iss-3511
[JS Code Hints] Fix Issue #3511
2013-05-03 08:19:29 -07: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
Jeffrey Fisher c81d79ad4a Changed all usages of the depreciated ".className" to ".type" that were being used on objects returned from the getTokenAt() method. There are many ".className" references that refer to the name of the CSS class, and all these were left alone. Also, any uses of ".className" in the third party code was left alone as well. 2013-05-01 19:09:25 -07:00
dloverin 520ab57716 bypass pump when unittesting 2013-05-01 14:04:52 -04:00
dloverin 51805f0f8f prime pump to improve first hint performance 2013-05-01 08:24:26 -04:00
dloverin 3a22861211 small changes for code review 2013-04-26 16:57:15 -04:00
dloverin 8fed6323fd fix backspace key 2013-04-26 12:11:08 -04:00