Sublime Forum

Go to Declaration

#1

Hi, i’m new to sublimetext, i was wondering if it’s possible to “go to Declaration”. I use it a lot on my everyday PHP coding.
On keybind pressed, when I’m over a function, what it does is Open the project file where the function is and place the cursor on it. This way i can jump around my code without need to open files manually.

I was triying with “Ctrl+P” but i need to especify file and function.

0 Likes

#2

This is a really great idea. I just started using Sublime Text 2, and the Goto Anything feature is brilliant.

However, if there was a way to goto symbols in a cross-file way, that’d be awesome. I presume this would mean the editor would have to keep an in-memory index of all symbols in your project so it’s fast enough. (I don’t mean an index file like ctags, because Sublime already knows what symbols are based on the language definition.)

For instance, you could type something like Ctrl+P then “@@my_func” to start searching for the symbol my_func in any of your files.

Would it be possible to do this via a plugin?

At present, do most people do this using Find in Files? (Not as slick, because it’ll match more than just symbol definitions, but does the job.)

0 Likes

#3

Are there any plans to support this in the future?

This is the number one reason that keeps me going back to more heavyweight IDEs like Eclipse. E.g. when programming in Scala where symbols can be in files that have a completely unrelated name, it is very hard to find these.

Thanks!

0 Likes

#4

If you’re up for these features ‘go to declaration’ and others vote for this feature request: sublimetext.userecho.com/topic/5 … -indexing/

0 Likes

#5

Use SublimeCodeIntel plugin !

0 Likes

#6

It only works (with all features) for python

0 Likes