Rust Analyzer Lsp
Rust language server (rust-analyzer) providing code intelligence and analysis for .rs files.
- Rating
- 4.6 (282 reviews)
- Downloads
- 38,020 downloads
- Version
- 1.0.0
Overview
Rust language server (rust-analyzer) providing code intelligence and analysis for .rs files.
Complete Documentation
View Source →
rust-analyzer LSP
Rust language server integration providing comprehensive code intelligence through rust-analyzer.
Capabilities
- Code intelligence: Autocomplete, go-to-definition, find references
- Error detection: Real-time diagnostics for compilation errors
- Refactoring: Rename symbols, extract function/variable
- Analysis: Macro expansion, type hints, inlay hints
- Supported extensions:
.rs
Installation
Via rustup (recommended)
rustup component add rust-analyzer
Via Homebrew (macOS)
brew install rust-analyzer
Via package manager (Linux)
# Ubuntu/Debian
sudo apt install rust-analyzer
# Arch Linux
sudo pacman -S rust-analyzer
Manual download
Download pre-built binaries from the releases page.Verify installation:
rust-analyzer --version
Usage
The language server runs automatically in LSP-compatible editors. For manual operations:
Format code
cargo fmt
Run linter
cargo clippy
Build and test
cargo build
cargo test
Check without building
cargo check
Configuration
Create .rust-analyzer.json in project root:
{
"checkOnSave": {
"command": "clippy"
},
"inlayHints": {
"typeHints": true,
"parameterHints": true
}
}
Integration Pattern
When editing Rust code:
- rust-analyzer provides real-time diagnostics
- Run
cargo fmtto format code - Use
cargo clippyfor linting - Run
cargo testbefore committing
Common Cargo Commands
cargo new- Create new projectcargo build- Compile projectcargo run- Build and runcargo test- Run testscargo check- Fast compile checkcargo clippy- Run lintercargo fmt- Format codecargo doc --open- Generate and open docs
More Information
Installation
openclaw install rust-analyzer-lsp
💻Code Examples
### Via package manager (Linux)
# Ubuntu/Debian
sudo apt install rust-analyzer
# Arch Linux
sudo pacman -S rust-analyzer### Build and test
cargo build
cargo test{
"checkOnSave": {
"command": "clippy"
},
"inlayHints": {
"typeHints": true,
"parameterHints": true
}
}Tags
Quick Info
Ready to Install?
Get started with this skill in seconds
Related Skills
4claw
4claw — a moderated imageboard for AI agents.
Aap Passport
Agent Attestation Protocol - The Reverse Turing Test.
Acestep Lyrics Transcription
Transcribe audio to timestamped lyrics using OpenAI Whisper or ElevenLabs Scribe API.
Adaptive Suite
A continuously adaptive skill suite that empowers Clawdbot.