askill
using-lsp-tools

using-lsp-toolsSafety 95Repository

Use when mcp-language-server tools are available and you need semantic code intelligence for navigation, refactoring, or type analysis

2 stars
1.2k downloads
Updated 2/4/2026

Package Files

Loading files...
SKILL.md

Using LSP Tools

Invariant Principles

  1. Semantic > Lexical: LSP understands scope, types, inheritance. Grep sees text.
  2. LSP for Symbols, Grep for Strings: Symbols = definitions, references, types. Strings = TODOs, comments, literals.
  3. Verify Before Fallback: Empty LSP result? Check file saved. Then try text-based.
  4. Atomic Operations Preferred: rename_symbol handles all files. Manual Edit misses references.

Reasoning Schema

Inputs

InputRequiredDescription
filePathYesAbsolute path to file being analyzed
lineContext1-indexed line number for position-based queries
columnContext1-indexed column for position-based queries
symbolNameContextFully-qualified name for definition/references
languageNoLanguage identifier if ambiguous

Outputs

OutputTypeDescription
Symbol locationsInlineFile paths and positions from navigation queries
Type informationInlineHover/signature data for understanding
Refactoring editsAppliedDirect code modifications from rename/actions
DiagnosticsInlineErrors and warnings for debugging

Tool Priority Matrix

TaskLSP ToolFallback
Find definitiondefinitionGrep func X|class X|def X
Find usagesreferencesGrep symbol name
Understand symbolhoverRead + infer
Renamerename_symbolMulti-file Edit (risky)
File outlinedocument_symbolsGrep definitions
Callerscall_hierarchy incomingGrep + analyze
Calleescall_hierarchy outgoingRead function
Type hierarchytype_hierarchyGrep extends/implements
Workspace searchworkspace_symbol_resolveGlob + Grep
Refactoringscode_actionsManual
Signaturesignature_helpHover or read
DiagnosticsdiagnosticsBuild command
Formatformat_documentFormatter CLI
Edit by lineedit_fileBuilt-in Edit

Parameters

Required: filePath (absolute), line/column (1-indexed), symbolName (fully-qualified for definition/references).

Decision Rules

Use LSP when:

  • Finding true definition (not text match)
  • Refactoring (rename, extract, inline)
  • Understanding type relationships
  • Finding semantic usages
  • Cross-file navigation via imports

Use Grep/Glob when:

  • Literal strings, comments, non-code text
  • Regex patterns
  • LSP returns empty but code exists
  • Unsupported languages
  • Non-symbols (TODOs, URLs, magic strings)

Workflows

Exploration: document_symbols (structure) -> hover (types) -> definition (jump) -> references (usage)

Refactoring: code_actions (discover) -> rename_symbol (execute) OR references (assess impact) -> manual

Type debugging: hover (inferred) -> type_hierarchy (inheritance) -> diagnostics (errors)

Call analysis: call_hierarchy incoming = "who calls?" | outgoing = "what calls?"

Anti-Patterns

Fallback Protocol

  1. LSP error/empty -> Check file saved (LSP reads disk)
  2. Try table fallback
  3. Persistent failure -> Feature unsupported by server

Self-Check

Before completing:

  • Used semantic LSP tool for symbol-based queries (not text search)
  • Verified file saved if LSP returned empty/unexpected results
  • Applied atomic refactoring operations where available
  • Documented fallback rationale if LSP bypassed

If ANY unchecked: STOP and reconsider approach.

Install

Download ZIP
Requires askill CLI v1.0+

AI Quality Score

95/100Analyzed 2/12/2026

An excellent, high-density reference skill for using LSP tools. It provides a clear mental model, a comprehensive tool priority matrix mapping tasks to specific LSP capabilities, and structured workflows. The inclusion of anti-patterns and fallback protocols makes it highly safe and robust.

95
95
100
95
95

Metadata

Licenseunknown
Version-
Updated2/4/2026
Publisheraxiomantic

Tags

ci-cdlinting