| name | tools-lsp-tree-sitter |
| description | Gather resolved semantic evidence with LSP and syntax fallback with tree-sitter. Use when architecture findings need actual definitions, references, callers, implementations, diagnostics, or symbols rather than text matches — especially for coupling and boundary claims. Use tree-sitter when no language server is available or the question is purely syntactic. NOT for exact text discovery (use tools-code-search), repo-scale dependency graphs (use tools-codegraph), or git history (use tools-gitnexus). |
LSP and tree-sitter
A language server resolves symbols the way the compiler does: it knows the real
definition, every reference, the implementations of an interface, and the
diagnostics the toolchain reports. tree-sitter parses syntax without resolution
— fast, language-agnostic, but it cannot tell you what a name resolves to. Reach
for LSP when you need semantic truth; fall back to tree-sitter when no server is
configured.
Evidence dimensions: semantic (LSP) and structural (tree-sitter).
When to use
Use LSP to confirm a real call/reference relationship before claiming coupling,
to find every implementation of a boundary interface, to verify callers/callees
at a seam, and to surface compiler diagnostics. Use tree-sitter syntax queries
when LSP is unavailable or when the question is purely syntactic (find all
functions, all type declarations) and a server would be overkill.
Commands
LSP access depends on the runtime's LSP integration; use only exposed runtime
operations, and do not invent tool names. Operations to request:
definition <file>:<line>:<col> # where a symbol is defined
references <file>:<line>:<col> # every use of a symbol
implementations <symbol> # implementors of an interface/abstract type
diagnostics <file|workspace> # compiler/linter diagnostics
documentSymbols <file> # outline of one file
workspaceSymbols <query> # find a symbol across the project
tree-sitter syntax queries (no resolution, pattern over the parse tree):