Sublime Forum

Indexing content, and accessing indexed content

#1

I might have missed this somewhere, but how do you get symbols into the index so that Go to Definition and Go to Reference work?

The Syntax Definitions page explains how to test that symbols are being indexed, but I didn’t see how you identify a definition or reference?

And this post says there’s no API for accessing the project symbol index? If that’s still true… what a pity! It means I’d have to create my own, which seems, you know, a little silly.

0 Likes

#2

You probably want to study https://docs.sublimetext.io/reference/symbols.html to learn about how to define symbols.

Sublime Text provides APIs like

Sublime Text does however not provide APIs to iterate through or query for (possibly huge) lists of existing symbols - mainly for performance reasons, according to sublimehq devs. That’s also the reason for not providing completions for all indexed symbols.

It may also be of limited use, as indexed symbols can’t be provided with the sort of context language servers would do. A result may be huge lists of rather unrelevant tokens being suggested.

0 Likes

#3

Thank you; I hope to try it out later on today!

0 Likes