auto-lsp-0.3.0 has been yanked.
auto_lspis at an early stage, expect frequent breaking changes.
Quick Example
auto_lsp is designed to be as language-agnostic as possible, allowing any Tree-sitter grammar to be used.
Defining a simple AST involves two steps: writing the queries and then defining the corresponding AST structures in Rust.
Let's say you have a toy language with a root node named document containing a list of function nodes, each containing a unique name.
A simple query file to capture the root document and function names:
@document
@function
The corresponding AST definition in Rust:
Now that you have your AST defined, you can:
- Implement the LSP traits and create a LSP server (with the
lsp_serverfeature). - Add your own logic for testing purposes, code_generation, etc.
You can find more examples in the src/tests folder.
Features
deadlock_detection: Enableparking_lot's deadlock detection (not compatible withwasm).log: Enable logging. (usesstderrlog)lsp_server: Enable the LSP server (useslsp_server).rayon: Enablerayonsupport (not compatible withwasm).wasm: Enable wasm support.html: Enable the html workspace mock for testing purposes.python: Enable the python workspace mock for testing purposes.incremental: Enable incremental updates.miette: Enablemietteerror handling.
Documentation
Inspirations / Similar projects
- Volar
- Rust-sitter
- StackGraphs
- airblast-dev's texter, which saved hours of headache