Replies: 2 comments
|
This seam extension is well thought out - a patch + consumer plugin that works today is exactly the right shape for this repo (PRs disabled, so a discussion with ready-to-apply patch is the pragmatic path). From a handbook-maintainer perspective: the 4-op seam (read/write/diagnose?) is one of the cleanest extension points for agent tooling, and adding diagnostics/formatDocument/completion would make dsh a credible LSP-driven editor backend. I document the tool/context system (incl. how extension seams like ctx.lsp fit) in chapter 8: If this lands, it'd be a great community case for the handbook - happy to document it with your fork as source. |
|
Thanks — glad the patch + consumer shape reads well. Happy to adjust anything once maintainers weigh in; dsh-lsp-actions keeps serving as the live consumer that keeps this seam honest. |
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
This is a seam-extension proposal. Pull requests are disabled on this repository, so it is posted here as a discussion instead. Everything is ready to become a PR the moment they are enabled.
feat(lsp): add diagnostics/formatDocument/completion to the ctx.lsp seam
Summary
Extends the
ctx.lspcapability seam from four navigation operations to seven by addingdiagnostics,formatDocument, andcompletion. The seam vocabulary (LspOperation,LspQueryRequest,LspQueryResult) becomes richer without changing the model-facinglsptool, which still exposes only the four navigation operations and the samelocations/hoveroutput schema.Design decisions
LspOperationgrows to seven members so every new operation is a compile-enforced change across the Service Definition, providers, and consumers — no JSON-RPC escape hatch.LspPositionRequest,LspDiagnosticsRequest,LspFormatRequest— replace the single flat request, sooperationnarrows to exactly the fields each operation carries (no hidden defaulting).locations,hover,diagnostics,edits, andcompletion;diagnostics/editscarry the canonicalresolvedWorkspaceUri.diagnosticProvideris pulled; a push-only server is served through the transient-open path with a boundeddiagnosticsSettleMswindow forpublishDiagnostics.LspTextEdit[]throughctx.fswrite-intent.tool-lspkeeps its four operations and output schema; the seam/provider additions surface only through the external consumer plugin.Files changed
packages/lsp/lsp/src/{types.ts,index.ts}— seven-operation union, request/result vocabulary, re-exports.packages/lsp/lsp-stdio/src/{protocol.ts,translate.ts,connection.ts,instance.ts,index.ts}— wire types and capabilities, request-aware method/capability mapping, new normalizers,onNotification, push-diagnostics collection, config/schema/validation.packages/lsp/lsp-stdio/tests/{translate.spec.ts,fixture-server.ts,instance.spec.ts,provider.spec.ts}— new-operation coverage.packages/lsp/tool-lsp/src/index.ts—executeswitch arms for the three new result kinds (throwing; the tool never requests them).docs/subsystems/lsp.{md,zh.md},docs/subsystems/README.md,docs/capability-seams.md,scripts/gen-doc-graphs.ts,scripts/type-equiv.manifest.json, and the three package README pairs..agents/notes/implemented/architecture/2026-08-14-lsp-action-operations.md— Agent Note.Testing performed
pnpm run typecheck,pnpm run lintpnpm --filter @deepseek-ai/dsh-lsp test,pnpm --filter @deepseek-ai/dsh-lsp-stdio test,pnpm --filter @deepseek-ai/dsh-tool-lsp testpnpm --filter @deepseek-ai/dsh-lsp --filter @deepseek-ai/dsh-lsp-stdio --filter @deepseek-ai/dsh-tool-lsp test:coveragepnpm run verify-type-equiv,pnpm run gen-cordis-catalog+pnpm run verify-cordis-catalogpnpm run verify-export-jsdoc,pnpm run verify-agent-note-format,pnpm run verify-cordis-apiConsumer
A consumer plugin (
dsh-lsp-actions) implementslsp_diagnostics,lsp_format, andlsp_completionover this seam, each owning its own model-facing schema and applying formatting edits throughctx.fswrite-intent.All reactions