跳到正文
cccskills
免费在 GitHub 公开

lsp-guide

Investigate code with the lsp tool, which uses a language server to understand names, imports, and types. Find definitions and usages, inspect signatures and file outlines, and check compiler or type errors after edits.

中文简介正在准备中。当前显示英语简介。

原文查看原文说明

Recipes for the lsp tool — resolving where a symbol is defined, every place it is used, type signatures and docs, file outlines, and compiler/type errors through a real language server (Go, TypeScript/JavaScript, Python, Rust). Use when navigating or explaining code by symbol, finding callers or usages, checking what broke after an edit, or deciding between lsp and text search.

查看安装方法

适用场景

  • Finding where a function or variable is defined
  • Tracing symbol usages across imports and aliases
  • Reading type signatures and documentation
  • Inspecting a file’s functions and types
  • Checking errors after editing code

包含的文件(1)

  • SKILL.md3.1 KB

SKILL.md(原文)

安装前可以查看交给 AI 代理的指令内容。

Using the lsp tool

The lsp tool answers semantic questions through the language's own server: it resolves through imports, types, and aliases, where grep only matches text. Reach for it whenever the question is about a symbol; keep grep for plain strings, comments, and file types no server supports.

Operations

OperationAnswersNeeds
definitionwhere the symbol at a position is definedpath, line, column
referencesevery place the symbol at a position is usedpath, line, column
hovertype signature + docs for the symbol at a positionpath, line, column
documentSymbolthe outline (types, functions, methods) of one filepath
diagnosticscompiler/type errors and warnings for one filepath

Positions are 1-based, and column must point at the identifier (its first character works). All paths resolve against the working directory.

Recipes

"Where is X defined?" — from any usage site of X: {"operation": "definition", "path": "<file>", "line": <L>, "column": <C>}. Don't know a usage site? Find one first (see next recipe's step 1).

"Everywhere X is used" — two steps, always:

  1. Locate the declaration: rg -n --column '\bX\b' (the --column output is exactly the coordinate the next call needs), or documentSymbol when you already know the file.
  2. {"operation": "references", "path": "<decl file>", "line": <L>, "column": <C>}.

A grep hit list is not a references answer: it includes comments and strings, misses aliased imports, and can't distinguish same-named symbols. Step 2 is what makes the answer authoritative.

"What is this / what's its signature?" — hover at the symbol. Prefer it over reading the definition file when you only need the type or doc comment.

"What's in this file?" — documentSymbol before reading a large file; jump straight to the line the outline gives you.

"Did my edit break anything here?" — diagnostics on the file after editing. It reports the server's current analysis of the saved file.

Behavior worth knowing

  • First query per workspace is slow (the server indexes — up to a minute in a big repo). Later queries on that workspace are fast; don't give up after one timeout, retry once.
  • References are capped (default 100, header says how many exist).
  • Unsupported file type or missing server returns advice text, not an error — fall back to grep for that file. A missing server can be installed with the user's consent via lsp_enable (see the install-lsps skill for toolchain prerequisites).
  • Works inside dispatch subagents too (they share the parent's warm servers), so symbol lookups are safe to fan out.

评价

还没有评价。欢迎分享你的使用感受。

评论

无需登录即可发表。欢迎分享使用感受、提问,或说明在哪些环境下无法运行。

还没有评论。来写第一条吧。

提交后会立即公开。请勿填写邮箱、电话等个人信息。URL 最多 2 个。

0 / 1000 字

此表单受 reCAPTCHA 保护,适用 Google 的隐私权政策和服务条款。

同一仓库的技能

Investigate unexpected Claude Code output by matching a session’s local transcript with production router logs. Identify the serving model and trace response conversion code to explain empty blocks, tool output, or other rendering symptoms.

中文简介正在准备中。当前显示英语简介。

  • Investigate unexpected output in a specific session
  • Examine an empty thinking block
  • Match displayed content to the serving model and provider
weave-os/router55952026年10月20日 更新

Investigate a Codex CLI session by matching its local conversation record with production router logs. Use the session ID to examine missing reasoning summaries, routing markers, unexpected models, or unusual tool calls and trace relevant code paths.

中文简介正在准备中。当前显示英语简介。

  • Investigate missing reasoning summaries
  • Confirm which model actually served a turn
  • Trace missing or unexpected routing markers
weave-os/router55952026年10月20日 更新

Switch Codex from Weave Router back to its normal provider for future sessions. Keep the existing login and router configuration, receive the command result, and retain the option to turn routing on again later.

中文简介正在准备中。当前显示英语简介。

  • Return Codex to its normal provider
  • Disable routing while keeping router configuration
  • Switch providers without logging out
weave-os/router55952026年10月20日 更新

fm

免费

Pin the current Codex session to a chosen model through Weave Router. This short alias accepts a model ID, runs the included script, and reports the router’s response while allowing the current turn to continue.

中文简介正在准备中。当前显示英语简介。

  • Pinning a Codex session to a chosen model
  • Using a short alias for force-model
  • Checking the router’s response after pinning a model
weave-os/router55952026年10月20日 更新

Pin the current Codex session to a specific model through Weave Router by providing its model ID. The skill applies the pin, continues the same turn, and reports the router's response.

中文简介正在准备中。当前显示英语简介。

  • Pinning the current Codex session to a model
  • Specifying a model by its ID
  • Applying a model pin while continuing the same turn
weave-os/router55952026年10月20日 更新

Set up language servers, programs that help tools understand source code, for Go, TypeScript, Python, and Rust. Check missing prerequisites, install them with approval, and verify the lsp tool against a real source file.

中文简介正在准备中。当前显示英语简介。

  • Enable language support for the lsp tool
  • Install a missing language server
  • Set up prerequisite development tools
weave-os/router55952026年10月20日 更新

查看 weave-os 的全部技能

报告此技能的问题