Home Download Buy Blog Forum Support

Indexing API

Indexing API

Postby wwwsevolod on Sat May 11, 2013 12:12 pm

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
wwwsevolod
 
Posts: 17
Joined: Thu Feb 21, 2013 11:19 am

Re: Indexing API

Postby skuroda on Sat May 11, 2013 7:38 pm

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: Select all
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
    <key>scope</key>
    <string>entity.name.function, entity.name.type</string>
    <key>settings</key>
    <dict>
        <key>showInIndexedSymbolList</key>
        <string>1</string>
    </dict>
</dict>
</plist>


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().
skuroda
 
Posts: 687
Joined: Fri Oct 05, 2012 8:11 am

Re: Indexing API

Postby fjl on Sun May 12, 2013 12:50 am

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.
fjl
 
Posts: 36
Joined: Wed Dec 28, 2011 12:41 am


Return to General Discussion

Who is online

Users browsing this forum: Google [Bot], Yahoo [Bot] and 16 guests