From 8f6114be790016bd954fcfccbe80a88bd0cb758e Mon Sep 17 00:00:00 2001 From: Adam Malczewski Date: Wed, 24 Jun 2026 16:48:46 +0900 Subject: feat(lsp+tool-edit-file): multi-server diagnostics + per-edit auto-append MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit LSP extension: - Multi-server aggregation: query ALL connected servers matching the file's extension (not just the first), merge diagnostics tagged by source - Incremental sync: capture each server's textDocumentSync.change during initialize; compute prefix/suffix diff ranges for change:2 servers; full content for change:1 (generic, works for any LSP) - New diff.ts: pure computeChangeRange + offsetToPosition (O(n), tested) - Buffer sync: change(filePath, newText) sends didChange with post-edit in-memory content; openWithText for first open; tracks open doc text - languageId mapping: extended with .rb/.rbs/.c/.cpp/etc. (was 'unknown') - waitForDiagnostics: accepts text override + timeoutMs; returns { formatted, slow, timedOut }; polls for publishDiagnostics push - DiagnosticsStore: hasReceivedPush/clearReceived tracking; formatFiltered with minSeverity (1=Error, 2=Warning) for edit_file integration - LspService.getDiagnostics: service method for cross-extension use tool-edit-file: - After successful edit, calls LSP getDiagnostics with post-edit buffer - Only appends diagnostics with severity ≤ 2 (errors+warnings, no noise) - Appends slow warning (>10s): 'LSP is taking unusually long...' - 60s timeout; graceful degradation when no LSP available - Optional dep on @dispatch/lsp (getService pattern, not manifest depOn) 1468 vitest pass (was 1453, +15 new diff tests). --- bun.lock | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'bun.lock') diff --git a/bun.lock b/bun.lock index 816651a..44e7bcd 100644 --- a/bun.lock +++ b/bun.lock @@ -220,6 +220,7 @@ "version": "0.0.0", "dependencies": { "@dispatch/kernel": "workspace:*", + "@dispatch/lsp": "workspace:*", }, }, "packages/tool-read-file": { @@ -270,7 +271,7 @@ }, "packages/transport-contract": { "name": "@dispatch/transport-contract", - "version": "0.18.0", + "version": "0.21.0", "dependencies": { "@dispatch/ui-contract": "workspace:*", "@dispatch/wire": "workspace:*", -- cgit v1.2.3