#language-server #tree-sitter #lsp #parser

auto-lsp

A rust crate for creating AST and LSP servers powered by tree-sitter

3 releases

0.6.2 Jun 17, 2025
0.6.1 Jun 9, 2025
0.5.1 Mar 15, 2025
0.4.0 Mar 3, 2025
0.1.0 Jan 20, 2025

#1821 in Parser implementations

Download history 21/week @ 2025-11-25 13/week @ 2025-12-02 165/week @ 2025-12-09 45/week @ 2025-12-16

686 downloads per month
Used in varlink-language-server

GPL-3.0 license

2.5MB
4.5K SLoC

Rust 2.5K SLoC // 0.2% comments JavaScript 2K SLoC // 0.0% comments Shell 1 SLoC

Auto LSP

A Rust crate for creating Abstract Syntax Trees (AST) and Language Server Protocol (LSP) servers powered by Tree-sitter

CI Status CI Status Book crates.io Rust Version

auto_lsp is a generic library for creating Abstract Syntax Trees (AST) and Language Server Protocol (LSP) servers.

It leverages crates such as lsp_types, lsp_server, salsa, and texter, and generates the AST of a Tree-sitter language to simplify building LSP servers.

auto_lsp provides useful abstractions while remaining flexible. You can override the default database as well as all LSP request and notification handlers.

It is designed to be as language-agnostic as possible, allowing any Tree-sitter grammar to be used.

See ARCHITECTURE.md for more information.

✨ Features

  • Generates a thread-safe, immutable and iterable AST with parent-child relations from a Tree-sitter language.
  • Supports downcasting of AST nodes to concrete types.
  • Integrates with a Salsa database and parallelize LSP requests and notifications.

📚 Documentation

Examples

Cargo Features

  • lsp_server: Enables the LSP server (uses lsp_server).
  • wasm: Enables WASM support (compatible only with wasi-p1-threads).

Inspirations / Similar Projects

Dependencies

~19–27MB
~389K SLoC