rust-lsp
Original:🇺🇸 English
Translated
1 scriptsChecked / no sensitive code detected
This skill MUST be used for semantic Rust navigation and analysis: resolving definitions across crate boundaries, finding all references to a symbol, inspecting inferred types or trait implementations, searching symbols by name, and renaming symbols safely. SHOULD be preferred over grep or file reads whenever the task requires Rust-aware understanding.
17installs
Added on
NPX Install
npx skill4agent add fedemagnani/rust-lsp-plugin rust-lspTags
Translated version includes tags in frontmatterSKILL.md Content
View Translation Comparison →Rust Analyzer Agent Skill
When to use
MUST use the MCP tools when the task involves:
- Resolving where a symbol is defined, including across crate boundaries
- Finding all references to a function, type, field, or trait method
- Inspecting type signatures, inferred types, or trait implementations
- Searching for symbols by name across a workspace
- Renaming a symbol across all usage sites
SHOULD prefer the MCP tools over grep or file reads when the task requires Rust-aware
semantic understanding (scoping, imports, trait dispatch, macro expansion).
Fall back to grep or file reads when the task is not Rust-specific, targets string literals
or comments, or covers files outside the Rust compilation.
Installation
If the Rust LSP tools are not available yet, run from this skill before using the MCP tools. Treat the tools as "not available yet" whenever the current session does not expose the Rust LSP MCP tool APIs: attempt the install/setup path first, then verify whether the tools become usable.
scripts/install.shCommon workflows
Navigate to a definition
- at the symbol position
definitions - Read the target file at the returned location
Find all callers
- at the function name position
references - Review the returned locations
Inspect a type
- at the position — returns the resolved type even for inferred types, trait objects, and generic instantiations
hover
Find a symbol by name
- with the name as query
workspace_symbols - Read the returned location if needed
Rename a symbol safely
- with the file contents
open_document - at the position with the new name
rename_symbol - Apply the returned workspace edits to disk
- when done
close_document
Update in-memory content for analysis
Position-based tools work on saved files without . Use the document
lifecycle only when analyzing unsaved or in-memory content:
open_document- to synchronize contents with rust-analyzer
open_document - to update contents (version auto-increments)
replace_document - when done (idempotent)
close_document
React to project structure changes
- after editing
reload_workspaceor adding/removing cratesCargo.toml - if proc-macro source changed
rebuild_proc_macros