| Crates.io | typescript-language-server |
| lib.rs | typescript-language-server |
| version | 0.1.0 |
| created_at | 2025-11-27 23:08:08.830713+00 |
| updated_at | 2025-11-27 23:08:08.830713+00 |
| description | A high-performance TypeScript and JavaScript language server implemented in Rust |
| homepage | https://github.com/quinnjr/typescript-language-server |
| repository | https://github.com/quinnjr/typescript-language-server |
| max_upload_size | |
| id | 1954583 |
| size | 587,866 |
A high-performance Language Server Protocol (LSP) implementation for TypeScript and JavaScript, written in Rust.
.ts).tsx).js, .mjs, .cjs).jsx)| Feature | Status | Description |
|---|---|---|
| Document Symbols | ✅ | Outline view with functions, classes, variables |
| Semantic Tokens | ✅ | Rich syntax highlighting |
| Diagnostics | ✅ | Syntax errors and type diagnostics |
| Hover | ✅ | Type information and JSDoc comments |
| Folding Ranges | ✅ | Collapse functions, classes, imports |
| Selection Range | ✅ | Smart expand/shrink selection |
| Go to Definition | ✅ | Navigate to symbol definitions |
| Find References | ✅ | Find all usages of a symbol |
| Rename Symbol | ✅ | Rename across scope |
| Completions | ✅ | IntelliSense with built-ins and scope |
| Signature Help | ✅ | Function parameter hints |
| Inlay Hints | ✅ | Type and parameter annotations |
| Code Actions | ✅ | Quick fixes and refactorings |
# Clone the repository
git clone https://github.com/your-username/typescript-language-server.git
cd typescript-language-server
# Build the language server
cargo build --release
# The binary will be at target/release/typescript-language-server
cd editors/vscode
pnpm install
pnpm exec tsc
Then press F5 in VSCode to launch the extension development host.
# Start the language server (communicates via stdio)
./target/release/typescript-language-server
editors/vscode folder in VSCodepnpm install to install dependenciesF5 to launch the Extension Development HostThe language server uses standard LSP over stdio. Configure your editor's LSP client to run:
/path/to/typescript-language-server
┌─────────────────────────────────────────────────────────┐
│ LSP Server (tower-lsp) │
└─────────────────────────────┬───────────────────────────┘
│
┌─────────────────────────────▼───────────────────────────┐
│ Project System │
│ (tsconfig, file graph, workspace) │
└─────────────────────────────┬───────────────────────────┘
│
┌─────────────────────────────▼───────────────────────────┐
│ Type Checker │
│ (inference, narrowing, assignability) │
└─────────────────────────────┬───────────────────────────┘
│
┌─────────────────────────────▼───────────────────────────┐
│ Binder / Symbol Table │
│ (scopes, symbols, references) │
└─────────────────────────────┬───────────────────────────┘
│
┌─────────────────────────────▼───────────────────────────┐
│ Module Resolver │
│ (imports, node_modules, path mapping) │
└─────────────────────────────┬───────────────────────────┘
│
┌─────────────────────────────▼───────────────────────────┐
│ Parser (tree-sitter) │
│ (AST, syntax tree) │
└─────────────────────────────────────────────────────────┘
typescript-language-server/
├── src/
│ ├── main.rs # Entry point
│ ├── server.rs # LSP server implementation
│ ├── document.rs # Document management
│ ├── parser.rs # tree-sitter parsing
│ ├── analysis/ # Symbol table & binder
│ │ ├── scope.rs # Scope tree
│ │ ├── symbol.rs # Symbol definitions
│ │ ├── symbol_table.rs # Per-file symbol storage
│ │ └── binder.rs # AST → symbols
│ ├── capabilities/ # LSP features
│ │ ├── completions.rs
│ │ ├── diagnostics.rs
│ │ ├── hover.rs
│ │ ├── definition.rs
│ │ └── ...
│ ├── resolution/ # Module resolution
│ │ ├── resolver.rs
│ │ ├── tsconfig.rs
│ │ └── node_modules.rs
│ ├── project/ # Project system
│ │ ├── project.rs
│ │ ├── file_graph.rs
│ │ └── workspace.rs
│ └── types/ # Type system
│ ├── types.rs # Type representations
│ ├── checker.rs # Type checker
│ └── printer.rs # Type display
├── editors/
│ └── vscode/ # VSCode extension
├── benches/ # Criterion benchmarks
└── benchmarks/ # LSP comparison benchmarks
# Debug build
cargo build
# Release build
cargo build --release
# Run tests
cargo test
# Run with logging
RUST_LOG=debug cargo run
# Run all Rust tests
cargo test
# Run tests with output
cargo test -- --nocapture
# Run specific test
cargo test test_name
# Run VSCode extension tests
cd editors/vscode
pnpm test
# Install cargo-llvm-cov
cargo install cargo-llvm-cov
# Generate coverage report
cargo llvm-cov --html
# View report
open target/llvm-cov/html/index.html
# Run Rust benchmarks
cargo bench
# Run LSP comparison benchmarks
cd benchmarks
./run-benchmarks.sh
The language server respects tsconfig.json / jsconfig.json files:
{
"compilerOptions": {
"target": "ES2020",
"module": "ESNext",
"moduleResolution": "bundler",
"baseUrl": ".",
"paths": {
"@/*": ["src/*"]
}
},
"include": ["src/**/*"],
"exclude": ["node_modules"]
}
compilerOptions.targetcompilerOptions.modulecompilerOptions.moduleResolution (node, node16, nodenext, bundler)compilerOptions.baseUrlcompilerOptions.pathscompilerOptions.strict and related flagsinclude / exclude patternsextends for configuration inheritanceThis implementation uses:
Benchmarks show significant improvements over the official TypeScript language server for parsing and symbol resolution operations.
Contributions are welcome! Please feel free to submit a Pull Request.
git checkout -b feature/amazing-feature)git commit -m 'Add some amazing feature')git push origin feature/amazing-feature)cargo fmt before committingcargo clippy passesThis project is licensed under the MIT License - see the LICENSE file for details.