Sublime Forum

GoTo Symbol/Function Usages

#1

Now that the stable release is out, I wanted to say thanks to the dev team!

Additionally, I wanted to mention that finding the usages of functions through sublime would be great. Is this something that is in the plans?

Additionally, any plans for automatic imports?

Thanks again!

0 Likes

#2

these features are much better suited for a plugin - for example those using the Language Server Protocol

3 Likes

#3

Why is that? The editor supports go to definition, why is go to usage doesn’t belong to it?

0 Likes

#4

because Goto Definition is very naive - if you have 2 functions named the same in 2 different classes, ST doesn’t know which one you mean. Proper code analysis is needed for correctly determining usages, and ST, as a text editor, (as opposed to an IDE) can’t be expected to do it (for all languages) without a plugin.

0 Likes

#5

Even IDEs use plugins and external tools to do so. They are just provided out of the box.

I agree with the LSP being the best approach to achieve a common interface for such things. But this technology will take a while to grow up.

0 Likes

#6

Thanks for the quick responses. TBH, I would like to use ST as much as possible, that’s why I am after this functionality. What are the best alternatives that offer this functionality? I have looked at WhoCalled plugin however couldn’t make that work.

0 Likes

#7

Depends on the language. I use LSP package together with python-language-server for a while now. It comes with a function called “Show references”. It is exactly what you want. It shows an output panel with all locations a function is used.

LSP supports a couple of other language-servers as well.

0 Likes