Hacker News new | ask | show | jobs
by semiquaver 859 days ago
A large number of LSP servers and related software use tree-sitter as a backend.
1 comments

That's not possible, as Treesitter doesn't do for example type-checking (unification). It can be used as the parser to generate the AST with which you're actually doing the work.
Agree, though not sure that's what the parent meant. I think they meant:

1. Some LSP implementations use Tree Sitter as the parser in their implementation

2. But it's only part of the implementation. It just generates the parse tree, on which various other LSP features are built, e.g. enhanced syntax highlighting, go to definition, ...

Tree Sitter is pretty good for (1) because it was built specifically to cope with code that is (a) changing rapidly and (b) is, by default, not valid. So it has good error reporting and recovery.