Sublime Forum

API accessing the symbol index

#1

Hello,

I can’t find anyway in the API to access the indexed symbols?
Is it not possible?

Regards,
Fredrik

0 Likes

#2

As far as the API goes, there are 2 of them

  1. View.indexed_symbols() - Returns a list of (symbol_region, symbol_name)
  2. View.indexed_symbol_regions() - Which also returns the same kind of information I believe but offers a lot more details https://www.sublimetext.com/docs/api_reference.html#sublime.SymbolRegion

Looks like the first one is not documented in the docs, but the second one is.

0 Likes

#3

Yeah but they only return symbols which are part of the view. Or can I maybe use them to get the whole index in some way?

0 Likes

#4

I believe the whole project symbol index isn’t exposed via the API because it can get very large which would result in potential performance drops (since it has to go through the the plugin host) if you are doing some intensive work with them.

1 Like