Sublime Forum

Indexing API

#1

I love sublime text, and bought st3, but for full happiness i need api through which i can add symbols to index, add rules to index, check is some symbols in index or not, and etc.
When ST3 became stable, any chances to see this kind of API here?)

Thank you for answers, and sorry for my bad english language skills

0 Likes

#2

You can’t explicitly add symbols to the index. Instead, you can create a tmPreferences file with the appropriate scope. Here is the entry that is built into ST.

[code]<?xml version="1.0" encoding="UTF-8"?>

scope entity.name.function, entity.name.type settings showInIndexedSymbolList 1 [/code]

These files are merged together, so no need to include “entity.name.function, entity.name.type” elsewhere. To view indexed symbols, take a look at window.lookup_symbol_in_index() and window.lookup_symbol_in_open_files().

0 Likes

#3

The upshot of the current implementation is that it behaves deterministically when files are added, changed or removed. While an API to manipulate its contents would be nice to have, the index could easily get out of sync.

0 Likes