TypeScript/JavaScript LSP (Rust) - VSCode Extension
A VSCode extension that provides TypeScript and JavaScript language support using a high-performance Rust-based language server.
Features
- IntelliSense - Code completions with type information
- Go to Definition - Navigate to symbol definitions
- Find References - Find all usages of a symbol
- Rename Symbol - Rename across your project
- Hover Information - Type info and documentation on hover
- Diagnostics - Syntax and type error reporting
- Semantic Highlighting - Rich syntax highlighting
- Code Actions - Quick fixes and refactorings
- Inlay Hints - Type and parameter annotations
- Signature Help - Function parameter hints
Requirements
- VSCode 1.75.0 or newer
- The Rust language server binary (built from the parent project)
Extension Settings
| Setting |
Default |
Description |
tsLspRust.enable |
true |
Enable the language server |
tsLspRust.serverPath |
"" |
Path to the language server binary |
tsLspRust.trace.server |
"off" |
Trace communication with server |
Development
Prerequisites
- Node.js 18+
- pnpm
- Rust toolchain (for building the server)
Building
# Install dependencies
pnpm install
# Build the extension
pnpm run build
# Build in watch mode
pnpm run bundle:watch
Running
- Open this folder in VSCode
- Press
F5 to launch the Extension Development Host
- The extension will automatically find the language server in
../../target/debug/
Testing
# Run tests
pnpm test
# Run tests with coverage
pnpm test:coverage
Packaging
# Create .vsix package
pnpm run package
Commands
| Command |
Description |
TypeScript LSP (Rust): Restart Language Server |
Restart the language server |
Troubleshooting
Server not found
If you see "Could not find language server", either:
- Build the server:
cargo build in the project root
- Set
tsLspRust.serverPath in settings to point to your server binary
View logs
- Open the Output panel (
View > Output)
- Select "TypeScript/JavaScript LSP (Rust)" from the dropdown
License
MIT
| |