News for hackers. Stuff that matters.
Re:Tree-sitter: an incremental parsing system for programmin... by pcr910303 on Monday February 22, 2021 @11:13AM (#26226170)
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

[1]: https://twitter.com/simonbs/status/1362492842141171720?s=21

Re:Tree-sitter: an incremental parsing system for programmin... by ACosmicDust on Monday February 22, 2021 @11:22AM (#26226292)
Emacs 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

Re:Tree-sitter: an incremental parsing system for programmin... by pdimitar on Wednesday February 24, 2021 @10:03AM (#26250587)
Wait what? You mean to tell me that Emacs LSP already uses tree-sitter?
Re:Tree-sitter: an incremental parsing system for programmin... by ducktective on Monday February 22, 2021 @11:18AM (#26226242)
Yeah but I don't think LSP specs contain syntax-highlighting or semantic highlighting.
Re:Tree-sitter: an incremental parsing system for programmin... by orra on Monday February 22, 2021 @11:30AM (#26226390)
LSP supports semantic highlighting: 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).

Re:Tree-sitter: an incremental parsing system for programmin... by picardythird on Monday February 22, 2021 @11:20AM (#26226267)
FYI there is tree-sitter.el for Emacs.