5 ms·
To me, the most impressive use of tree-sitter was an iOS text editor that uses it to parse huge JSON files / mixed language files and highlight them in a very r
by pcr910303 6y ago
To me, the most impressive use of tree-sitter was an iOS text editor that uses it to parse huge JSON files / mixed language files and highlight them in a very robust way. [0][1] I’m hoping tree-sitter becomes more common like LSP and Emacs can get exact highlighting and other tools with it…
[0]: https://twitter.com/simonbs/status/1352697855845273600 https://twitter.com/simonbs/status/1352697855845273600
[1]: https://twitter.com/simonbs/status/1362492842141171720?s=21 https://twitter.com/simonbs/status/1362492842141171720?s=21
- ducktective 6y agoYeah but I don't think LSP specs contain syntax-highlighting or semantic highlighting.
- deleted 6y ago[deleted]
- orra 6y agoLSP supports semantic highlighting: https://microsoft.github.io/language-server-protocol/specification#textDocument_semanticTokens https://microsoft.github.io/language-server-protocol/specifi... Though AIUI the basic syntax highlighting is done by the editor (e.g. VSCode uses Textmate grammar support).
- picardythird 6y agoFYI there is tree-sitter.el for Emacs.
- ACosmicDust 6y agoEmacs does have a package to use tree-sitter [0]. I think emacs-lsp is aware of this highlighting backend and performs pretty well. (semantic highlighting is pretty slow for C++ with font-lock, with tree-sitter it's a breeze :)) [0]: https://github.com/ubolonton/emacs-tree-sitter https://github.com/ubolonton/emacs-tree-sitter
- pdimitar 6y agoWait what? You mean to tell me that Emacs LSP already uses tree-sitter?