跳到正文
Skillpedia
通用编程70k · #3113

lsp

它能做什么

这个工具可以帮你理解和管理辅助编程的“语言服务器”。它可以检查错误、查找代码定义、搜索某个内容在哪里被使用,还能帮你安全地重命名代码中的部分内容。

适用场景

  • ✓想知道哪些编程工具已安装并正常运行时。
  • ✓修改文件后,想查找该文件中的错误时。
  • ✓想在整个项目中重命名变量或函数,又不想破坏代码时。

技能链接

https://github.com/code-yeongyu/oh-my-openagent/blob/dev/packages/omo-codex/plugin/components/lsp/skills/lsp/SKILL.md

复制后粘贴给你的 AI(Claude、ChatGPT 或 Cursor),让它按照说明操作。

使用方法

最简单的方法:复制下面的消息,粘贴给你的 AI。它会读取这个技能并按说明操作。

可直接粘贴的消息

请用这个技能帮我:https://github.com/code-yeongyu/oh-my-openagent/blob/dev/packages/omo-codex/plugin/components/lsp/skills/lsp/SKILL.md 阅读该链接中的 SKILL.md 文件,并在我的任务中按照它的说明来做。
想让你的 AI 自己找到这样的技能吗?安装免费的 Skillpedia MCP:只需一行,每次任务前它都会在 15,000+ 个技能中搜索。1 分钟完成安装 →

可以这样问 AI

“检查我的“main.py”文件中是否有错误,并告诉我整个项目中在哪些地方调用了“calculate_total”函数。”

每周 5 个新技能,1 分钟读完。

工作原理

这个工具会与分析你代码的“语言服务器”通信。它会使用特定命令请求错误、定义或引用等信息,再把返回的结果展示给你。

技术内容(原始 SKILL.md)

作者在 GitHub 上的英文原文。

Codex LSP

Call lsp MCP tools through the tool interface; lsp.*/mcp__lsp__* are tool-call names, not shell commands.

Tools

  • lsp.status: list configured, installed, missing, disabled, and active language servers.
  • lsp.diagnostics: check one file or directory for LSP diagnostics. Prefer severity: "error" after edits.
  • lsp.goto_definition: locate a symbol definition from file, line, and character.
  • lsp.find_references: find usages of a symbol across the workspace.
  • lsp.symbols: inspect document symbols or search workspace symbols.
  • lsp.prepare_rename: check whether a rename is valid at a position.
  • lsp.rename: apply a language-server workspace edit for a rename.

Config

Project config lives at .codex/lsp-client.json; user config lives at ~/.codex/lsp-client.json.

{
	"lsp": {
		"typescript": {
			"command": ["typescript-language-server", "--stdio"],
			"extensions": [".ts", ".tsx", ".js", ".jsx"]
		}
	}
}

Use lsp.status first when diagnostics report a missing language server.

常见问题

什么是“语言服务器”?

它们是帮助代码编辑器理解你代码的程序,提供错误检查、自动补全和代码导航等功能。

为什么要先使用 `lsp.status` 命令?

它会显示哪些语言服务器已配置、已安装、缺失或被禁用。如果另一个功能需要的服务器不存在,这个命令能帮你及时发现。

如果我尝试重命名,结果出错了怎么办?

重命名之前,你可以使用 `lsp.prepare_rename` 检查重命名是否安全。`lsp.rename` 工具会尝试在整个项目中安全地应用重命名。

详情

作者的原始描述

Use when Codex needs language-server diagnostics, definitions, references, symbols, or rename safety checks in the current workspace.

repo: code-yeongyu/oh-my-openagent

热度

GitHub 星标
70k
排名
#3113
许可证
NOASSERTION
更新时间
2026/10/15

这个技能有用吗?

0

登录 后即可投票。

评论

  • …

同一仓库的更多技能

相似技能