✓ Verified 💻 Development ✓ Enhanced Data

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)

bash
rustup component add rust-analyzer

Via Homebrew (macOS)

bash
brew install rust-analyzer

Via package manager (Linux)

bash
# 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:

bash
rust-analyzer --version

Usage

The language server runs automatically in LSP-compatible editors. For manual operations:

Format code

bash
cargo fmt

Run linter

bash
cargo clippy

Build and test

bash
cargo build
cargo test

Check without building

bash
cargo check

Configuration

Create .rust-analyzer.json in project root:

json
{
  "checkOnSave": {
    "command": "clippy"
  },
  "inlayHints": {
    "typeHints": true,
    "parameterHints": true
  }
}

Integration Pattern

When editing Rust code:

  • rust-analyzer provides real-time diagnostics
  • Run cargo fmt to format code
  • Use cargo clippy for linting
  • Run cargo test before committing

Common Cargo Commands

  • cargo new - Create new project
  • cargo build - Compile project
  • cargo run - Build and run
  • cargo test - Run tests
  • cargo check - Fast compile check
  • cargo clippy - Run linter
  • cargo fmt - Format code
  • cargo doc --open - Generate and open docs

More Information

Installation

Terminal bash

openclaw install rust-analyzer-lsp
    
Copied!

💻Code Examples

### Via package manager (Linux)

-via-package-manager-linux.sh
# Ubuntu/Debian
sudo apt install rust-analyzer

# Arch Linux
sudo pacman -S rust-analyzer

### Build and test

-build-and-test.sh
cargo build
cargo test
example.json
{
  "checkOnSave": {
    "command": "clippy"
  },
  "inlayHints": {
    "typeHints": true,
    "parameterHints": true
  }
}

Tags

#coding_agents-and-ides #code

Quick Info

Category Development
Model Claude 3.5
Complexity One-Click
Author bowen31337
Last Updated 3/10/2026
🚀
Optimized for
Claude 3.5
🧠

Ready to Install?

Get started with this skill in seconds

openclaw install rust-analyzer-lsp