简体   繁体   中英

Does “go to definition” work in Eclipse for javascript?

Working with Eclipse for Javascript, Ctrl-click seems to work on some objects but will not take me outside of the current javascript file. Is there any way to get this "go to definition" to work more fully? I use Eclipse for Java and depend on this functionality, would like to see it work better in Javascript as I'm just trying to learn Javascript.

I think it probably doesn't work because of the many ways in JavaScript to define something..

  • function foo() {}
  • var foo = function() {};
  • window.foo = function() {};
  • window['foo'] = function() {};
  • var z = 'foobar'; window[z.substr(0, 3)] = function() {};

Especially the last one would be - even though it's unlikely to be ever used in real code - pretty much impossible to be detected by an IDE without executing the whole code and then tracking where a global is defined for the first time.

Another example would be with libraries implementing a class system. Without knowing the details of every library it's pretty hard to find out what class names they define.

Intellij Idea support that functionality. I was looking to see if Eclipse has a plugin and came across your post, I use to work with Intellij Idea and I have that functionality that is very helpful so to the user that is saying that is impossible for a IDEA please take a look in Intellij Idea you will be surprise of all the functionality that you can find.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM