DSH 的 LSP 动作面:诊断、格式化、补全、代码动作、符号、签名提示、inlay 提示与重命名,全部由真实语言服务器驱动。
安装
# npm 包(预构建)
dsh plugin --profile web add dsh-lsp-actions
# GitHub 源码(首次需按提示配置 allowBuilds 构建授权后重试)
dsh plugin --profile web add github:PerryLink/dsh-lsp-actions
装任何插件都等于在你的机器上跑第三方代码,权限和你本人一样大——能读你的文件、用你的凭据、访问网络,工具审批管不到它。GitHub 来源的插件还会在安装时执行构建脚本——pnpm 默认拦截,所以安装可能停在 ERR_PNPM_GIT_DEP_PREPARE_NOT_ALLOWED 或 ERR_PNPM_IGNORED_BUILDS;dsh 会打印出需要添加的确切键名,把它加进该 profile 的 pnpm-workspace.yaml 的 allowBuilds 下,重跑一次即可装上。放行构建本身就是一次信任判断:请只安装可信来源,并尽量锁定 commit(github:owner/repo#sha)。
README
🛰️ dsh-lsp-actions
- 1024 商店渠道:先
npm i -g dsh1024,再dsh1024 plugin --profile web add dsh-lsp-actions(计入 deepseek1024.com 安装排行)。
DeepSeek Harness 的 LSP 动作面 —— 真实的语言服务器、真实的反馈,以及面向编辑器的 IDE 集成后端。
为你的 agent 编辑循环提供诊断、格式化、补全、代码动作、符号、签名提示、内联提示与重命名 —— 外加稳定的编辑器 action 协议(lsp.actions.*),让任何编辑器都能直接消费这些能力。
English · 简体中文 · Español · Português · हिन्दी
⭐ 如果它帮到了你
这个插件是 DSH 插件家族的一员(40+ 个,全部 Apache-2.0)。如果你在用,给个 star —— 它不会解锁任何功能,但会让下一个人在搜索里更容易找到它。
English: part of a 40+ plugin family for DeepSeek Harness. If it is useful, a star helps the next person find it — nothing is gated behind it.
Compatibility
| Surface | Status |
|---|---|
| Harness | DeepSeek Harness dsh-v0.1.7-rc.2(对 >=0.1.2-rc.1 <0.2.0 || >=0.1.5-alpha.1 <0.2.0 || >=0.1.6-0 <0.2.0 || >=0.1.7-0 <0.2.0 声明兼容);插件不自写会话事件——宿主记录标准 tool/call + tool/result 事件。已发布 seam 仍只有四个 legacy 操作,故插件保留自建客户端并在首次动作调用时记录该 vintage。已于 2026-09-24 核验(双 typecheck 尺子 + 全量测试 + self-contained/artifacts 门)。 |
| Node | ^22.19.0 || >=24.0.0 |
| Platforms | 全部(纯 host;子进程 + 文件系统,无网络) |
| Model | 任意(工具与模型无关;插件从不调用模型) |
What you get
dsh-lsp-actions 以单个 host 行挂载(id: lsp-actions、name: dsh-lsp-actions、inject: [tools, fs, subprocess])。官方 DeepSeek Harness 的 ctx.lsp seam 覆盖导航(跳转定义、引用、实现、悬停);本插件补齐了动作面 —— agent 写代码和修代码时需要的反馈闭环:
- 八个
lsp_*工具 —— 诊断、格式化、补全、代码动作、符号、签名提示、内联提示与重命名,全部由你 IDE 所用的那些语言服务器提供。 - 编辑器 action 协议 v1 —— 稳定的 JSON-RPC 面(
lsp.actions.list/lsp.actions.run/lsp.events),让任何编辑器(先行 VS Code)直接消费这些能力。 - 真实服务器验证 —— 测试套件包含一次真实的
typescript-language-server运行(自包含,CI 在 Node 22/24 × Linux/Windows/macOS 上运行),而非只有 mock。
Quick start
# 1. install the bundle into your profile
dsh plugin --profile web add "github:PerryLink/dsh-lsp-actions#main"
# or from npm (published releases)
dsh plugin --profile web add dsh-lsp-actions
# 2. restart and verify the row
dsh --profile web --dump-config | grep -A3 'id: lsp-actions'
Install & uninstall
- git channel(最新
main):dsh plugin --profile web add "github:PerryLink/dsh-lsp-actions#main"——prepare脚本负责构建(tsc --noEmitOnError)。 - npm channel(发布版本):
dsh plugin --profile web add dsh-lsp-actions。 - tarball channel:在本仓库执行
pnpm pack,然后dsh plugin --profile web add ./dsh-lsp-actions-<version>.tgz。 - uninstall:
dsh plugin --profile web remove dsh-lsp-actions(或从 profile patch 中移除该行)。
Configuration
所有可调项都是 Schemastery Config 字段(可从 cordis.yml 修改)。以 id 为目标的覆盖会替换整行 —— 你需要重述每一个键。cordis.patch.yml 对每个键都有内联说明。
| Key | Default | Meaning |
|---|---|---|
servers |
{} |
命名的语言服务器;空表不激活任何服务器 |
editor.enabled |
false |
通过 JSON-RPC stdio 提供编辑器 action 协议(仅限 headless 后端) |
editor.requestTimeoutMs |
60000 |
编辑器协议每次运行的超时预算(毫秒) |
editor.diagnosticsCacheMaxFiles |
64 |
有界 LRU 诊断缓存大小(按文件数) |
maxDiagnostics |
200 |
每次结果的诊断上限 |
maxCompletionItems |
20 |
每次结果的补全项上限 |
maxCodeActions |
50 |
每次结果的代码动作上限 |
maxSymbols |
100 |
符号结果上限 |
maxSignatures |
10 |
签名提示上限 |
maxInlayHints |
200 |
内联提示上限 |
maxResultChars |
16000 |
渲染结果上限(字符数) |
maxDocumentBytes |
4000000 |
文档读取上限(字节数) |
timeoutMs |
60000 |
每次调用的超时,由官方 timeout 策略执行 |
每个 servers 条目都是一个 LspServerEntry:command(可执行文件,加载期在 PATH 上解析)与 extensionToLanguage(".ts" → typescript)为必填;可选的 fileGlobs、projectMarkers、args、env、initializationOptions、configuration、formattingOptions、maxMessageBytes、maxStderrBytes、killGraceMs、shutdownTimeoutMs、diagnosticsSettleMs、diagnosticsDebounceMs 与 idleTimeoutMs(0 = 保持服务器进程存活)用于调校内置 stdio 客户端。
路由是确定性的,且完全由配置决定。每个文件按以下顺序取第一个命中:(1) 某条目的 fileGlobs 匹配该路径;(2) 从文件所在目录向上走到工作区根,最近的、含有某个条目 projectMarkers 所列工程配置文件的目录——且该条目同时映射该文件的扩展名;(3) 按配置顺序,extensionToLanguage 映射该扩展名的条目。因此同一工作区内的 apps/node-app/{package.json,tsconfig.json,src/main.ts} 与 apps/deno-app/{deno.json,src/main.ts} 会各自用本工程的服务器处理 main.ts:无需维护任何路径规则,新增、改名或移动工程也不必改动配置:
servers:
typescript:
command: typescript-language-server
args: ["--stdio"]
extensionToLanguage: { ".ts": typescript, ".tsx": typescriptreact }
projectMarkers: ["package.json", "tsconfig.json"]
deno:
command: deno
args: ["lsp"]
extensionToLanguage: { ".ts": typescript, ".tsx": typescriptreact }
projectMarkers: ["deno.json", "deno.jsonc"]
工程标记只在该文件扩展名已被若干服务器映射的前提下做选择(绝不会扩大某个服务器的文件类型范围);向上查找永不越过工作区根;某个目录里的工程配置绝不会作用于同级目录。第 (1) 步优先于工程标记:若某条目的 fileGlobs 命中该路径,仍以它为准——采用 projectMarkers 时请一并删掉项目级的 glob,否则残留的 **/*.ts 会继续把这些文件抢走。以上规则作用于内置 stdio 客户端;挂载的 ctx.lsp seam provider 自行决定路由。
Tools & surfaces
| Surface | Kind | Notes |
|---|---|---|
lsp_diagnostics |
tool | <file> —— 编译器/分析器的错误、警告与提示,含严重级、范围、消息与来源服务器(只读) |
lsp_format |
tool | <file> [range?] —— 通过语言服务器格式化文件/选区并应用,返回 diff(经 fs/write-intent 写盘) |
lsp_completion |
tool | <file> <line> <character> —— 光标处的补全建议,含插入文本(只读) |
lsp_code_action |
tool | <file> [range?] [only?] —— 服务器验证过的快速修复/重构(含其编辑),作用于某范围或首个诊断(仅参考) |
lsp_symbols |
tool | <query?> <file_path?> —— 按名字全局搜索符号,或列出单个文件的大纲(只读) |
lsp_signature |
tool | <file> <line> <character> —— 调用点处的签名提示(参数与文档)(只读) |
lsp_inlay_hints |
tool | <file> [range?] —— 服务器给出的类型标注与参数名提示(只读) |
lsp_rename |
tool | <file> <line> <character> <new_name> —— 服务器验证过的重命名,跨工作区应用并返回逐文件 diff(经 fs/write-intent 写盘) |
lsp.actions.* |
protocol | 编辑器 action 协议 v1:经 JSON-RPC 的 lsp.actions.list / lsp.actions.run / lsp.events |
examples/vscode/ |
extension | 纯 UI 的 VS Code 扩展,及其所连接的 headless 后端组合 |
Editor action protocol v1
在专用 headless 组合中设置 editor.enabled: true 后,dsh-lsp-actions 通过换行分帧的 JSON-RPC 2.0(与官方 SDK/ACP 传输同一线格式)提供稳定的编辑器协议:
| Method | What it does |
|---|---|
lsp.actions.list |
返回 lsp-actions/v1 协议版本、动作目录(diagnostics.get、completion.get、quickfix.apply、format,逐个标注 writes)与可寻址的 DSH 会话 |
lsp.actions.run |
执行一个动作,返回结构化 { requestId, action, status, result | error } 信封;错误携带稳定的 LSP_ACTION_* 码 |
lsp.events |
订阅流式 lsp.event 通知:diagnostics.updated、action.status、file.changed、sessions.changed |
所有写动作(quickfix.apply、format)都走官方权限预设与审批:read-only 会话在任何服务器往返前以 LSP_ACTION_READ_ONLY 拒绝;编辑走 fs/write-intent waterfall;sandbox_permissions + justification 升级对经官方 approveEscalation 询问(无应答方时 fail-closed)。完整线上规范(双语):docs/editor-protocol.md · docs/editor-protocol.zh-CN.md。
版本化与向后兼容承诺
- 协议带版本 ——
lsp.actions.list返回protocol: "lsp-actions/v1"、version: 1。**v1 已冻结:**字段名、动作 id、事件类型与错误码永久稳定。 - 演进只做加法:新动作、新字段、新事件类型无需升版本;既有语义绝不原地变更;破坏性变更以新的
protocol版本发布,服务端可并行服务多版本。 - 客户端必须忽略未知字段、未知事件类型与未知动作,并按稳定的错误
code路由,绝不解析消息文本。
错误码
每个失败都携带稳定 code;模型与调用方按 code 路由,绝不解析消息文本。
| Code | Meaning |
|---|---|
LSP_ACTION_UNAVAILABLE |
没有服务器 entry、seam provider 也不处理该文件 |
LSP_ACTION_UNSUPPORTED |
服务器(或 seam provider)未广告该操作 |
LSP_ACTION_SERVER_FAILED |
服务器失败(附 stderr 尾部);启动失败重试一次 |
LSP_ACTION_MALFORMED_RESPONSE |
服务器返回了结构非法的负载 |
LSP_ACTION_CONFLICT |
文件读后已变,或编辑重叠 / 越界 / 越出工作区 |
LSP_ACTION_READ_ONLY |
会话沙箱模式禁止格式化/重命名写入 |
LSP_ACTION_WORKSPACE_REQUIRED |
调用会话没有可扎根的 workspace cwd |
LSP_ACTION_NO_SYMBOL |
服务器在光标位置找不到可重命名的符号 |
LSP_ACTION_UNKNOWN |
编辑器协议:未知动作 id,或没有 code action 匹配 title/index |
LSP_ACTION_INVALID_ARGS |
编辑器协议:动作参数不合法 |
LSP_ACTION_APPROVAL_UNAVAILABLE |
编辑器协议:审批路径未能授予更宽沙箱模式(fail-closed) |
LSP_PROTOCOL_VERSION_UNSUPPORTED |
编辑器协议:所声明的协议版本不被支持 |
VS Code extension
examples/vscode/ 附带纯 UI 扩展(侧栏:DSH 会话、诊断列表、quickfix 一键应用、点击定位、格式化)及其经 ACP 风格 JSON-RPC 连接的 headless 后端组合(backend/cordis.yml)。扩展不实现任何 LSP 逻辑——所有能力与每一笔写入都属于插件。安装步骤、设置项与动图录制脚本见 examples/vscode/README.md。

Permissions & data
- 权限:格式化与重命名走官方权限预设与审批 ——
fs/write-intentwaterfall 与sandbox_permissions/justification升级对,经ctx.approval裁决。插件在其 workshop manifest 中声明fs:read、fs:write、subprocess:spawn与network:none。 - 数据:不向磁盘写入任何东西;工具结果只存在于会话日志(无跨会话持久化)。编辑器协议只保留一个有界的内存 LRU 诊断缓存,带新鲜度戳,绝不跨重启持久化。
- 无网络:插件不发起任何网络请求;它通过本地子进程 stdio 与语言服务器通信。
Security boundaries
- 默认只读。 八个工具中有六个仅作参考;只有
lsp_format与lsp_rename会变更,且按真实的write/edit变更对待。 - 走官方 seam,而非另起炉灶。 每个字节都经过
fs/write-intentwaterfall(观测 → 守卫写 → 观测)与每次调用的沙箱策略;升级路径与官方write/edit工具一致。 - 响亮、快速、结构化地失败。
servers为空且无ctx.lspseam →LSP_ACTION_UNAVAILABLE;只读会话在任何服务器往返前 →LSP_ACTION_READ_ONLY;命令形态只报告、绝不执行。 - 冲突绝不覆盖。 文件读后已变则以
LSP_ACTION_CONFLICT失败;lsp_rename在第一笔写入前预检每个待改文件。 - 有界工作。 结果上限、字节上限与平台的 timeout 策略约束每一次调用;诊断缓存是有界 LRU。
- 模型路径不缓存任何东西。 工具结果只存在于会话日志;诊断缓存绝不跨重启持久化。
- 坏服务器响亮失败。 命令缺失在加载期即失败;启动即死的服务器以
LSP_ACTION_SERVER_FAILED+ stderr 尾部失败(启动失败先自动换新进程重试一次)。 - 提示词卫生。 本插件不向会话系统提示词注入任何 persona 或提示词段落——面向模型的接口只有八个工具 Schema。
Architecture
动作优先走官方 seam,未命中则回落插件自带的最小 stdio 客户端:
lsp_diagnostics / lsp_format / lsp_completion / lsp_code_action /
lsp_symbols / lsp_signature / lsp_inlay_hints / lsp_rename
│
▼
ctx.lsp seam(扩展后:diagnostics / formatDocument / completion)
│ 缺席 · 旧版 · 该文件无 provider
▼
内置 stdio 客户端 ← servers 表(ctx.subprocess.spawn + JSON-RPC)
seam 扩展已向上游提案(upstream/lsp-action-seam.patch,PR 描述见 upstream/PR-description.md)。合入后插件无需改动即自动迁移——内置客户端停止被使用即可。内置客户端会保留为 servers 表的独立兜底。编辑器协议复用同一 runner、同一写入路径与同一权限机制。完整调研与设计笔记:docs/seam-extension-notes.md。
Known limitations
- 瞬态文档。 每次动作都是打开文件 → 发一个请求 → 关闭文件(与官方 stdio host 一致)。依赖常驻打开文件的基于项目的服务器(tsls 在无打开文档时拒绝
workspace/symbol)可通过给lsp_symbols传file_path解决。tsls 在该生命周期下对textDocument/signatureHelp返回null;其他服务器(gopls、pyright、rust-analyzer)正常应答。 - 范围格式化要求服务器的 range provider。 只广告全文格式化的服务器对范围请求以
LSP_ACTION_UNSUPPORTED失败。 - 重命名只应用文本编辑。 服务器重命名结果中的资源操作(新建/删除/重命名文件)以
LSP_ACTION_UNSUPPORTED拒绝;越出工作区的编辑在任何写入发生前以LSP_ACTION_CONFLICT失败。
Development
pnpm install # node ^22.19 || >=24
pnpm run lint # oxlint over src/ and tests/
pnpm test # vitest: unit + fixture-server integration + editor-protocol e2e + real tsls e2e
pnpm run test:coverage # coverage gate
pnpm build # tsc --noEmitOnError → lib/
pnpm run prepare # tsc --noEmitOnError (runs on install)
pnpm run prepublishOnly # tsc --noEmitOnError (runs before publish)
Topics
dsh, dsh-plugin, deepseek-harness, lsp, language-server, diagnostics, formatting, completion, code-action, symbols, signature-help, inlay-hints, rename, refactor, ide, editor, vscode, acp, json-rpc
Contributors
- @PerryLink —— 创建者与维护者:LSP 动作客户端与服务器生命周期、全部八个工具、编辑器 action 协议、测试、CI,以及五语种文档。
PerryLink DSH Plugin Family
This project is one of the 45 DeepSeek Harness plugins maintained by PerryLink. If this one helps you, the others likely will too:
| Plugin | One-liner |
|---|---|
| dsh-auto-review | Second-model auto-review on the approval chain, fail-closed by default |
| dsh-autotier | Automatic strong/cheap model-tier routing with deterministic risk guards and a /tier command |
| dsh-background-agents | Durable background child agents with a Web UI sidebar, messaging and interrupt |
| dsh-budget | Cost governance for DeepSeek Harness: budgets, carbon, and latency in one panel. |
| dsh-catalog | DSH Desktop Market standard catalog source for the PerryLink family |
| dsh-cert-mcp | Read-only MCP server exposing the certification registry: grades, snapshots and five-dimension evidence |
| dsh-checkpoint-rewind | Claude Code /rewind-equivalent: snapshots, session forks, one-shot restore |
| dsh-claude-move | Migrate Claude Code sessions, memory, skills and CLAUDE.md into DSH |
| dsh-click | Cross-platform native desktop control for DeepSeek Harness — Windows first. |
| dsh-composer-history | Terminal-style input history for the web composer: arrows, Ctrl+R search |
| dsh-data-quality | Dataset quality checks and citation cross-checks (the optional numeric bridge consumed here) |
| dsh-defend | Prompt-injection, jailbreak, and secret-leak defense for DeepSeek Harness. |
| dsh-doublecheck | Engineering-discipline guard: requirements grill, test gates, adversary review |
| dsh-draw | Unified static-image generation routing for DeepSeek Harness. |
| dsh-fast | Read-only performance diagnostics for DeepSeek Harness. |
| dsh-fund-research | Deterministic research reports for Chinese public mutual funds |
| dsh-github | GitHub PR/issues integration for DSH, every write gated by approval |
| dsh-industry-research | Industry research orchestration that seals its deliverables through this plugin's ctx.researchReport.assemble |
| dsh-laya | Laya typed decisions (noul/choice/score) as a first-class Cordis service and model-visible tools |
| dsh-library | Local document knowledge base for DeepSeek Harness. |
| dsh-local-ai | Local-model (Ollama) integration for DeepSeek Harness. |
| dsh-lsp-actions | LSP diagnostics, formatting, completion, code actions and rename over language servers |
| dsh-mask | PII masking middleware: anonymize at the model boundary, restore at the display layer |
| dsh-mcp-panel | Read-only MCP runtime panel: /mcp command + Settings tab with status, tools and errors |
| dsh-memento | Approval-gated cross-session memory: ctx.memory seam + SQLite + memory tool |
| dsh-observe | OpenTelemetry and Langfuse observability exporter for DeepSeek Harness. |
| dsh-output-styles | Claude Code outputStyles-equivalent runtime style switching |
| dsh-permission-rules | Claude Code-style declarative allow/deny/ask permission rules with audit |
| dsh-plugin-certification | Community certification registry with repro-checkable grades and badges |
| dsh-plugin-doctor | Zero-dependency static + sandbox smoke detector for DSH plugins |
| dsh-plugin-guide | Plugin-development knowledge base as an on-demand agent skill |
| dsh-plugin-kit | Shared zero-runtime-dependency toolkit for the PerryLink DSH plugins |
| dsh-plugin-upgrade | One-package, one-corridor-index plugin upgrade skill: routes a repository to the matching closed corridor card |
| dsh-plugin-upgrade-015 | Merged 0.1.3-alpha.1 → 0.1.5-rc.1 upgrade corridor card plus a zero-dependency seam scanner |
| dsh-reach | Multi-channel approval/question bridge: WeChat/Telegram/Feishu, session console |
| dsh-research-report | Verifiable research-report engine: content-addressed evidence ledger and sealed versions |
| dsh-score | Multi-dimensional quality scoring for DeepSeek Harness plugins. |
| dsh-session-pin | Pin sessions in the Web sidebar with durable ordering |
| dsh-session-sync | Cross-device session sync for DeepSeek Harness — a dedicated git mirror of your session store. |
| dsh-skill-pack-security | Security-audit skill pack: secret scan, dependency and supply-chain review |
| dsh-talk | Voice-first session loop for DeepSeek Harness: talk to it, hear it answer. |
| dsh-team-rooms | Cross-session team rooms: shared message bus, task board and timeline |
| dsh-test-drive | Isolated install-and-smoke test drives for DeepSeek Harness plugins. |
| dsh-ticktick | TickTick/Dida365 task bridge: session-header panel + 11 tools |
| dsh-translate | Vendor parameter translation and deterministic JSON repair for DeepSeek Harness. |
License
Apache License 2.0 © 2026 dsh-lsp-actions contributors
从 DSH Desktop 市场安装
所有 PerryLink 插件均可在 DSH Desktop 内置市场中浏览:市场 → 来源 → 添加来源 → 粘贴 https://perrylink-dsh-catalog.perrylink.workers.dev/catalog-source.json → 选中。安装仍需通过市场的 npm 身份校验与你的确认。
链接
同类插件
Tencent/WeKnora#dsh-weknora★ 31002
把 WeKnora 知识库接入 dsh 的四个只读工具:列出知识库、混合检索原文片段、按顺序还原单篇文档,以及直接取用 WeKnora 自己带引用的 RAG 或 ReAct agent 回答(含可续聊的 session id)。
superdesigndev/treg★ 3752
给 Agent 的工具目录:按「要做的事」检索约 2,600 个外部接口(SEO 与 SERP、外链、社交、人物与公司信息补全、广告库、抓取),查看参数与单次调用价格后直接调用,凭据由服务端注入。附带技能,MCP 行在未设置 TREG_TOKEN 前保持禁用。
TencentCloudBase/CloudBase-AI-Toolkit#dsh-plugin★ 1127
把腾讯云 CloudBase 后端接入 DeepSeek Harness——在对话里搭好并部署全栈应用,查询结果渲染为表格卡片(分页、排序、导出 CSV),部署后可预览真实域名,并提供 CloudBase MCP 工具集(`mcp__cloudbase__*`),登录走 device-code 流程。
gitroomhq/postiz-agent#dsh-postiz★ 498
通过 MCP 将 DeepSeek Harness 连接到 Postiz:列出已连接的社交媒体渠道、获取各平台发帖规则,并向 X、LinkedIn、Instagram、Facebook、Threads、TikTok、YouTube、Reddit、Bluesky、Mastodon、Discord、Slack、Telegram 等平台排期、存草稿或发布帖子;附带 postiz 工作流技能。
EthanYoQ/Invoice-Downloader#dsh-invoice-downloader★ 465
面向 DeepSeek Harness 的本地 IMAP 发票下载、OCR 识别、归档与 Excel 报销汇总。
anysearch-team/anysearch-dsh★ 432
基于 AnySearch 的实时网页与垂直搜索插件,为 DeepSeek Harness 提供搜索工具。
社区评论
评论公开保存在 GitHub Discussions。加载评论会连接 GitHub 和 Giscus;发表内容需要 GitHub 账号。