1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
/*
This file is part of auto-lsp.
Copyright (C) 2025 CLAUZEL Adrien
auto-lsp is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>
*/
//!<div align="center" style="margin-bottom: 50px">
//! <h1>Auto LSP</h1>
//! <p>
//! <strong>A Rust crate for creating <a href="https://en.wikipedia.org/wiki/Abstract_syntax_tree">Abstract Syntax Trees</a> (AST)
//! and <a href="https://microsoft.github.io/language-server-protocol/">Language Server Protocol</a> (LSP) servers powered by <a href="https://tree-sitter.github.io/tree-sitter/">Tree-sitter</a></strong>
//! </p>
//!
//! [](https://github.com/adclz/auto-lsp/actions/workflows/codegen.yml/)
//! [](https://github.com/adclz/auto-lsp/actions/workflows/test-ast-native.yml)
//! [](https://adclz.github.io/auto-lsp/)
//! [](https://crates.io/crates/auto-lsp)
//! 
//!
//!</div>
//!
//! `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](https://docs.rs/lsp-types/0.97/lsp_types/), [lsp_server](https://docs.rs/lsp-server/latest/lsp_server/), [salsa](https://docs.rs/salsa/latest/salsa/), and [texter](https://docs.rs/texter/latest/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](https://github.com/adclz/auto-lsp/blob/main/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
//!
//! - [book](https://adclz.github.io/auto-lsp/)
//! - [docs.rs](https://docs.rs/auto-lsp)
//!
//! ## Examples
//!
//! - [HTML AST](https://github.com/adclz/auto-lsp/tree/main/examples/ast-html)
//! - [Python AST](https://github.com/adclz/auto-lsp/tree/main/examples/ast-python)
//! - [Simple LSP Server](https://github.com/adclz/auto-lsp/tree/main/examples/native)
//! - [Vscode extension](https://github.com/adclz/auto-lsp/tree/main/examples/vscode-native)
//! - [Vscode extension with WASI](https://github.com/adclz/auto-lsp/tree/main/examples/vscode-wasi)
//!
//! # Cargo Features
//!
//! - `lsp_server`: Enables the LSP server (uses [`lsp_server`]).
//! - `wasm`: Enables wasm support (only compatible with `wasi-p1-threads`).
//!
//! # Inspirations / Similar projects
//!
//! - [Volar](https://volarjs.dev/)
//! - [Type-sitter](https://github.com/Jakobeha/type-sitter/)
//! - [Rust Analyzer](https://github.com/rust-lang/rust-analyzer)
//! - [Ruff](https://github.com/astral-sh/ruff)
//! - [airblast-dev](https://github.com/airblast-dev)'s [texter](https://github.com/airblast-dev/texter), which saved hours of headache
// LSP server (enabled with the feature `lsp_server`)
/// Re-export of the [`auto_lsp_core`] crate
/// Configuration utilities
pub use anyhow;
pub use lsp_server;
pub use lsp_types;
pub use salsa;
pub use texter;
pub use tree_sitter;