Closed banacorn closed 4 years ago
I think your best bet is to just fork this repo and make your own extension.
I see, thank you!
I'm wondering if it's a good idea to make this extension language-agnostic. Make tree-sitter grammars standalone extensions, and let user choose which language to highlight by installing this extension and a grammar extension?
You have to compile your grammar into WASM, so hard to see how to make this reusable. Probably better to make a "template" showing the minimal code to tree-sitterize your grammar.
If I compile my tree-sitter grammar into WASM, and package it as a vscode extension would that make this hypothetical language-agnostic syntax highlighter easier to plug the grammar in?
I'm not sure what you're getting at...if you compile your grammar into WASM and package it as a vscode extension there's not much else you need to do, just use the VSCode syntax coloring API. Most of the complexity in this extension relates to getting the correct colors from the current theme, and VSCode now has an officially supported API for that. I just haven't yet updated this extension to use it---once I do, it will be a very thin shim around tree-sitter.
I'm just trying to put my tree-sitter grammar to work on VSCode. Thanks for the direction! I'll close this.
I already have a tree-sitter grammar working on Atom, and I'm trying to port it to VS Code.
However, after reading the steps in README, I realized that it's probably a bad idea to hardcode and integrate our experimental-ever-changing-toy language into this repo, and pollute everyone's editor.
Is it possible to highlight any tree-sitter grammar in a "plug-and-play" manner?