sublime-treesitter / TreeSitter

Sublime Text Tree-sitter configuration and abstraction layer
MIT License
19 stars 1 forks source link

Question: What would it take to update themes to work with TreeSitter? #11

Closed distefam closed 7 months ago

distefam commented 7 months ago

My understanding, admittedly limited, about SublimeText syntax highlighting themes is that they use the "scopes" reported by SublimeText. This makes it necessary to install plugins for syntaxes not built-in to Sublime Text (ElixirSyntax, for example), which have complex rules for reporting scopes based on patterns.

Given that TreeSitter more accurately represents "scopes" as nodes, what would be involved in making syntax highlighting work for a language using TreeSitter so that color schemes can pick it up?

kylebebak commented 7 months ago

@deathaxe does a good job of explaining why Tree-sitter can't be used in Sublime Text for syntax highlighting, in this thread: https://forum.sublimetext.com/t/tree-sitter-support/40559/27

And here's an issue asking for support in Sublime for exactly this kind of syntax highlighting: https://github.com/sublimehq/sublime_text/issues/817#issuecomment-1403334786

If something like this is implemented in ST, it might make sense to reopen this issue. But for now syntax highlighting in Sublime with Tree-sitter isn't possible, so it's not in scope. I'll add something to the README clarifying this.