fedemagnani/rust-lsp-plugin

rust-lsp

- 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.

소스 보기

사용 방법

  1. 설치 명령을 복사하고 자신의 에이전트 환경에 설치하기 전에 소스 패키지를 확인하세요.
  2. 필요한 도구, 인증 정보, 지원 환경은 원본 문서에서 확인하세요.
  3. 입력과 원하는 산출물을 설명하고 출처와 결과를 대조하세요.
npx skills add https://github.com/fedemagnani/rust-lsp-plugin --skill rust-lsp

시작 전 확인

  • 설치에는 모델 구독, API 한도, 파일 접근 권한이 포함되지 않습니다.
  • 별점 수와 설치 수는 활동 지표이며 독립적인 품질·보안 검증이 아닙니다.
원본 Skill 문서

원본 저장소의 제목, 예시, 코드, 표, 링크, 이미지를 유지해 표시합니다.

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 scripts/install.sh 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.

Common workflows

Navigate to a definition

  1. definitions at the symbol position
  2. Read the target file at the returned location

Find all callers

  1. references at the function name position
  2. Review the returned locations

Inspect a type

  1. hover at the position — returns the resolved type even for inferred types,

trait objects, and generic instantiations

Find a symbol by name

  1. workspace_symbols with the name as query
  2. Read the returned location if needed

Rename a symbol safely

  1. open_document with the file contents
  2. rename_symbol at the position with the new name
  3. Apply the returned workspace edits to disk
  4. close_document when done

Update in-memory content for analysis

Position-based tools work on saved files without open_document. Use the document lifecycle only when analyzing unsaved or in-memory content:

  1. open_document to synchronize contents with rust-analyzer
  2. replace_document to update contents (version auto-increments)
  3. close_document when done (idempotent)

React to project structure changes

  1. reload_workspace after editing Cargo.toml or adding/removing crates
  2. rebuild_proc_macros if proc-macro source changed

관련 작업