Does "go to definition" work in Eclipse for javascript?

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

+4
source share
2 answers

I think this probably does not work, because many methods in JavaScript define something ..

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

In particular, the latter would - even if it was hardly ever used in real code - it is almost impossible to detect an IDE without executing all the code, and then keep track of where the global is defined for the first time.

Another example is libraries that implement a class system. Without knowing the details of each library, it is quite difficult to determine which class names they define.

+5
source

Intellij Idea supports this functionality. I searched if there is a plugin in Eclipse and stumbled upon your post, I use it to work with Intellij Idea, and I have such functionality that is very useful, so for a user who says it is impossible for IDEA, please look at Intellij Idea you You will be surprised at all the functionality you can find.

+2
source

All Articles