Live data from Hacker News

Tree-sitter: an incremental parsing system for programming tools

github.com

1–10 of 138 posts

Re: Tree-sitter: an incremental parsing system for programming tools

#3

Is this the same thing neovim uses for syntax highlighting? Is there a chance for it getting integrated to vim? Last I checked vim used a regex method which was slow and faulty.

Yup, neovim 0.5+ will be using treesitter for any supported languages, with the current Regex highlighting as a fallback.

Re: Tree-sitter: an incremental parsing system for programming tools

#4
post #3

Is this the same thing neovim uses for syntax highlighting? Is there a chance for it getting integrated to vim? Last I checked vim used a regex method which was slow and faulty.

Yup, neovim 0.5+ will be using treesitter for any supported languages, with the current Regex highlighting as a fallback.

[deleted]

Re: Tree-sitter: an incremental parsing system for programming tools

#5
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 programming tools

#6

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

Yeah but I don't think LSP specs contain syntax-highlighting or semantic highlighting.

Re: Tree-sitter: an incremental parsing system for programming tools

#7

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

FYI there is tree-sitter.el for Emacs.

Re: Tree-sitter: an incremental parsing system for programming tools

#8

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

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 programming tools

#10

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

Yeah but I don't think LSP specs contain syntax-highlighting or semantic highlighting.

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).

Post reply on HN