Sublime Forum

How|when is the symbol list built/refreshed?

#1

I’m building a syntax plugin to support scripting for a game that uses a custom domain-specific language. The language doesn’t allow to create your own functions and classes, but instead provides a fixed (only partially documented) amount of functions, of several hundreds.

Now while building the syntax,I came up with a “clever trick” (probably not). have every non-whitespace token that is not captured by the conventional categories of the already developed syntax as invalid.illegal, and add that only that scope to the global symbol list. This way, I can use the global symbol list (i.e. ctrl + shift + r) as an error-checker of sorts without having to manually open every script file in the game folder.

My problem is, I can’t seem to predict when or how is the list populated, so for example, I spor an error in the syntax, fix the syntax, the script is no longer scoped as invalid, but still is shown in the symbol list. Sometimes, closing and reopening the project fixes this, but more often than not, closing and reopening means the list is depopulated and when repoening it is only populated with from the opened files.

So, is there a known behaviour of how and when is the global list updated? Ideally, I’d like to make the end users of my plugin be able to use (a refined version of) my “trick” to be able to catch the most harmfull syntax error that way

0 Likes

#2

Surely your company has a linter / syntax checker if it has a documented DSL? If so, I am sure you can extend SublimeLinter to check for such errors with your company’s tool. I think you’re trying to swim upstream by trying to implement a linter via an ST syntax file.

0 Likes

#3

It’s not my company, I’m just a fan modder looking to add support to it as much as I can.

And I get your point. I’m just doing this for basic syntax errors like missing brackets or mispelled keywords, which a lexer can catch. If I get enough free time and learning materials, I’d like to try implementing a linter, even if it’s based on community knowledge.

0 Likes

#4

in my experience it updates instantly after the indexing has finished - when I next open the goto symbol in project panel it always contains everything it indexed. Do you have any minimum verifiable example of this not happening?

0 Likes

The list shown with ctrl+shit+r is not updated after reindexing has ended
#5

Hum, tried fabricating a minimum example and failed. I guess I’ll need to keep investigating it on my own.

0 Likes