diff options
| author | Marcel de Vries <[email protected]> | 2025-12-31 18:35:09 +0100 |
|---|---|---|
| committer | GitHub <[email protected]> | 2025-12-31 11:35:09 -0600 |
| commit | f3db96631704f5d7cf2ee6c2a31812d161305356 (patch) | |
| tree | 198e903605307c6faa25a9ed1bea5d26edd6785d | |
| parent | decc616c800827e1e28c96fe2253ee229095dc23 (diff) | |
| download | opencode-f3db96631704f5d7cf2ee6c2a31812d161305356.tar.gz opencode-f3db96631704f5d7cf2ee6c2a31812d161305356.zip | |
Add support for LSP workspace/didChangeWatchedFiles (#6524)
Co-authored-by: Aiden Cline <[email protected]>
| -rw-r--r-- | packages/opencode/src/lsp/client.ts | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/packages/opencode/src/lsp/client.ts b/packages/opencode/src/lsp/client.ts index b66bb9933..8704b65ac 100644 --- a/packages/opencode/src/lsp/client.ts +++ b/packages/opencode/src/lsp/client.ts @@ -98,6 +98,9 @@ export namespace LSPClient { }, workspace: { configuration: true, + didChangeWatchedFiles: { + dynamicRegistration: true, + }, }, textDocument: { synchronization: { @@ -151,6 +154,16 @@ export namespace LSPClient { const version = files[input.path] if (version !== undefined) { + log.info("workspace/didChangeWatchedFiles", input) + await connection.sendNotification("workspace/didChangeWatchedFiles", { + changes: [ + { + uri: pathToFileURL(input.path).href, + type: 2, // Changed + }, + ], + }) + const next = version + 1 files[input.path] = next log.info("textDocument/didChange", { @@ -167,6 +180,16 @@ export namespace LSPClient { return } + log.info("workspace/didChangeWatchedFiles", input) + await connection.sendNotification("workspace/didChangeWatchedFiles", { + changes: [ + { + uri: pathToFileURL(input.path).href, + type: 1, // Created + }, + ], + }) + log.info("textDocument/didOpen", input) diagnostics.delete(input.path) await connection.sendNotification("textDocument/didOpen", { |
