What’s the difference between tree-sitter and LSP[0]? They both seem to provide the same functionality.
[0]: https://microsoft.github.io/language-server-protocol/
They're often used together. I've written a couple of language servers that use Tree-Sitter to parse documents.
For example when you hover something in VSCode it uses the LSP to communicate with the language server and say "oi, what's on line 5 column 10" and then the language server uses Tree Sitter to parse the document and figure out the answer (or some other parser).