Hacker News new | past | comments | ask | show | jobs | submit login

LSP is a protocol while tree-sitter is a parsing tool and library. LSP is a protocol developed by Microsoft for IDEs to communicate with a separate process to provide annotations and insight into source code. Practically, tree-sitter is usually used for syntax highlighting, while servers implementing LSP are used for compilation errors, warnings, jump to definition, linter warnings, symbol highlighting, etc etc etc.



Tree-sitter works like a syntax highlighting plugin, and doesn’t require communication with an external process. It’s like syntax highlighting but with a deeper understanding of the programming language, not based just on regular expressions. So not only is the highlighting better, but you can do more things, such as selecting blocks or jumping among them. One of my favorite goodies is being able to ask the editor what function my cursor is inside.




Join us for AI Startup School this June 16-17 in San Francisco!

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: