lsp-code-analysis
Compiler-accurate semantic code analysis via LSP. Navigate definitions, references, and implementations, perform workspace-wide renames, and get file outlines for Python, Rust, Go, TypeScript/JS, and Java.
Introduction
This skill provides an agent with compiler-accurate code intelligence by leveraging industry-standard Language Server Protocol (LSP) servers, specifically managed via Mason. Unlike text-based tools like grep or simple read operations, this agentic skill understands the actual structural relationship between symbols, types, and dependencies, making it essential for deep code comprehension and structural refactoring in complex repositories.
The tool is designed for software engineers and AI coding agents tasked with exploring unfamiliar codebases, tracing complex call chains across files, or performing safe, large-scale code modifications. It treats the repository as a structured graph of interconnected symbols rather than just a collection of text files, significantly reducing hallucinations during code navigation or modification tasks.
-
Precise navigation: Instantly jump to definitions, type definitions, or symbol declarations using scope-based targeting.
-
Contextual analysis: Generate file outlines to map architecture before diving into specific logic, and retrieve full source for individual functions or classes.
-
Global operations: Perform project-wide symbol renaming with an integrated preview step to ensure structural safety, allowing for exclusions of specific directories.
-
Universal search: Locate symbols across the entire workspace by kind (function, class, interface, variable, module, etc.) even when the exact file location is unknown.
-
Implementation tracking: Find all references and implementations for specific objects, essential for understanding the impact of changes in polymorphic systems.
-
Usage strategy: Use lsp-outline for high-level structure, lsp-symbol to fetch specific block content, lsp-reference for impact analysis, and lsp-definition for call-chain tracing.
-
Targeting syntax: Employs an optional --scope parameter to specify classes or methods (e.g., --scope MyClass.method) and a --find flag with a <|> cursor marker to pin target positions within lines.
-
Pre-requisites: Requires Mason-managed language servers (pyright, rust-analyzer, typescript-language-server, gopls) installed locally.
-
Performance notes: Initial startup takes approximately 3 seconds for manager initialization; subsequent calls are warmed and typically respond within 2 seconds.
-
Safety: Always execute lsp-rename preview before performing an execution to review the scope of changes, specifically checking against the generated ID from the preview output.
Repository Stats
- Stars
- 1
- Forks
- 0
- Open Issues
- 0
- Language
- Python
- Default Branch
- main
- Sync Status
- Idle
- Last Synced
- May 3, 2026, 09:15 PM