4 ms·
> 3. Create a Nova extension that says "use this .dylib to highlight that language." How is that possible if the different tokens emitted by tree sitter don't
by duped 3y ago
> 3. Create a Nova extension that says "use this .dylib to highlight that language."
How is that possible if the different tokens emitted by tree sitter don't have standardized names? Isn't there some kind of configuration that maps the rules in the grammar to whatever convention Nova uses for their token names?
Now tree sitter does make this super easy, but my point was you still have to have some kind of per-language configuration/logic to work, whereas the entire point of LSP is to have none.
- kstrauser 3y agoThat's done with the "highlights.scm" query (https://tree-sitter.github.io/tree-sitter/syntax-highlighting#highlights https://tree-sitter.github.io/tree-sitter/syntax-highlightin...) that maps nodes to their types with lots of standard names (https://github.com/tree-sitter/tree-sitter/blob/master/highlight/src/lib.rs https://github.com/tree-sitter/tree-sitter/blob/master/highl...). The maintainer of the tree-sitter grammar is usually one who maintains that mapping. At least, every time I've wanted to use it, it's been the case that all of that was already done and part of the grammar's repo.