3 ms·
What is the significance of TreeSitter? Emacs has syntax highlighting already- so how is it an improvement?
by fergie 3y ago
What is the significance of TreeSitter? Emacs has syntax highlighting already- so how is it an improvement?
- lycopodiopsida 3y agoSyntax highlighting now runs on regex, which means that it is slower and prone to errors. In the end, it understands nothing about the code it highlights. Tresitter, on the other end, makes a proper syntax tree.
- bananapub 3y agoit's faster, builds a proper parse tree so is more reliable, it's shared between editors so will have greater opportunity for improvement, and exposes related things like indentation and code movement from the same system. it's very very cool that this late in the world of computers we ~suddenly get cross-editor analysis system (LSP) and cross-editor highlighting/indentation/rough parsing support.
- jart 3y agoCross-editor? Who runs multiple editors? The only thing you need is Emacs. Why are they breaking apart Emacs' functionality into separate things? Is TreeSitter even written in Lisp? If not, then how would this be hackable in the same way?
- cyrialize 3y agoI think this is a pretty good article that highlights the benefits of TreeSitter in Emacs: https://www.masteringemacs.org/article/tree-sitter-complications-of-parsing-languages https://www.masteringemacs.org/article/tree-sitter-complicat... I'm happy that TreeSitter is in Emacs Core rather than elisp, it'll run faster.