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.
* 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)
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.
This also alters StringMatch.multiFieldSort to use an array to define the sort order,
though I stopped short of deprecating the old { key: priority } format.
Only replace the 'fn' in the function type hint if the token that was called looks like an identifier/property. If it is an expression, resulting in a function call, then just display 'fn' since we don't have a way to determine a 'name' for the called function.
The js code hinting code needed to find script blocks, so refactor the style block code to find any kind of block, and call that instead of having another copy of the code. findStyleBlocks now just calls the generic method, looking for "css" blocks.
Also fixed up the block finding code to handle empty blocks, which I ran into when looking for "javascript" blocks.
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.
when inserting a hint which is not a valid property name, such as 'my-key', insert the hint as ["my-key"] instead of .my-key.
insertHint now runs the hint through the acorn tokenizer to see if it looks like a valid property name. If it's invalid, it replaces the '.' with brackets.
Refactored some code in Session.getType() - pulled out a method to find the leading '.' in a property lookup, and use that method from the insertHint logic as well.
Added 3 new unittests to test this new behavior.
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
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.
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.