跳到正文
TakoAPI
返回技能列表

rust-analyzer-lsp

由 bowen31337 提供

Coding Agents & IDEs
910下载量由 clawskills.sh 提供
0浏览量
0 个赞登录后即可为这个技能点赞
—暂无评分
你的评分

简介

Rust language server (rust-analyzer) providing code intelligence and analysis for .rs files.

描述

该技能的功能

rust-analyzer is a language server for Rust that provides code intelligence through the Language Server Protocol. It offers autocomplete, go-to-definition, find references, real-time diagnostics, and refactoring in any LSP-compatible editor. It replaced the older Rust Language Server (RLS) and is now the officially maintained option.

It is the officially maintained Rust language server with faster indexing and more accurate analysis than its predecessor RLS.

何时使用

  • Navigating a large Rust codebase with go-to-definition
  • Catching type and borrow checker errors before running cargo build
  • Renaming a struct or function across an entire project
  • Expanding macros to inspect generated Rust code

示例工作流

输入

User asks: rename the `UserConfig` struct to `AppConfig` throughout the project

智能体
  1. 1

    rust-analyzer indexes the workspace and resolves all references to UserConfig

  2. 2

    Initiates a rename refactor targeting the struct definition and all usage sites

  3. 3

    Updates every .rs file containing a reference to the symbol

  4. 4

    Reports the number of locations changed

输出

All occurrences of `UserConfig` renamed to `AppConfig` consistently across the codebase

前置要求

  • rust-analyzer binary installed via `rustup component add rust-analyzer`, Homebrew, or system package manager

安装

clawhub install bowen31337/rust-analyzer-lsp

运行 CLI 命令,或把这段提示词粘贴到 Claude Code、Cursor、Codex 或你在用的任意编程智能体里。

链接