Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 427299 - Add support to find the declaration of a node
Summary: Add support to find the declaration of a node
Status: RESOLVED FIXED
Alias: None
Product: Orion
Classification: ECD
Component: JS Tools (show other bugs)
Version: 5.0   Edit
Hardware: All All
: P3 enhancement (vote)
Target Milestone: 9.0   Edit
Assignee: Michael Rennie CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on: 427302
Blocks: 418861 423096
  Show dependency tree
 
Reported: 2014-02-03 12:15 EST by Michael Rennie CLA
Modified: 2015-04-30 15:50 EDT (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Michael Rennie CLA 2014-02-03 12:15:16 EST
Given an offset (hover or selection) we should be able to find the declaration of a chosen token (if there is one). This would be immediately usable for hover / ctrl-click navigation for parameters / function calls / object properties.

Our current mark occurrences support finds declaring nodes, so we should be able to extend that support to find a decl.
Comment 1 Michael Rennie CLA 2014-10-28 13:20:00 EDT
I added a command impl and some unit tests, the command is not hooked up yet in the JS plugin due to some other conflicting changes I'm not ready to commit yet:

http://git.eclipse.org/c/orion/org.eclipse.orion.client.git/commit/?id=2246385e5a090a43efd09e1e17f408bb9269e922
Comment 2 Michael Rennie CLA 2014-11-07 13:26:43 EST
(In reply to Michael Rennie from comment #1)
> I added a command impl and some unit tests, the command is not hooked up yet
> in the JS plugin due to some other conflicting changes I'm not ready to
> commit yet:
> 
> http://git.eclipse.org/c/orion/org.eclipse.orion.client.git/commit/
> ?id=2246385e5a090a43efd09e1e17f408bb9269e922

Hooked the command up in the plugin: http://git.eclipse.org/c/orion/org.eclipse.orion.client.git/commit/?id=2c02aeb10fc0f6017e6a827a7a40bae2a80f045b
Comment 3 Michael Rennie CLA 2014-11-20 11:49:18 EST
(In reply to Michael Rennie from comment #2)
> (In reply to Michael Rennie from comment #1)
> > I added a command impl and some unit tests, the command is not hooked up yet
> > in the JS plugin due to some other conflicting changes I'm not ready to
> > commit yet:
> > 
> > http://git.eclipse.org/c/orion/org.eclipse.orion.client.git/commit/
> > ?id=2246385e5a090a43efd09e1e17f408bb9269e922
> 
> Hooked the command up in the plugin:
> http://git.eclipse.org/c/orion/org.eclipse.orion.client.git/commit/
> ?id=2c02aeb10fc0f6017e6a827a7a40bae2a80f045b

Added support hooks for define/require/importScripts pending new API to actually be able to open another file from a command invocation:

http://git.eclipse.org/c/orion/org.eclipse.orion.client.git/commit/?id=ba6aee308818b386571a9ce40f6f395374252830
Comment 4 Michael Rennie CLA 2015-04-30 15:50:58 EDT
Fixed in:

http://git.eclipse.org/c/orion/org.eclipse.orion.client.git/commit/?id=9c353ad48aa9c2e0b55f2ae8b9abe833daea2554

The new support uses Tern to find definitions. It currently only works in the current file context, but with the coming fix for bug 464821 it will work across files.

The support for being able to follow defines, etc, has been removed (it was disabled anyway). And the new Tern-based support has also been hooked up to HTML files as well.