summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorMarcel de Vries <[email protected]>2025-12-31 18:35:09 +0100
committerGitHub <[email protected]>2025-12-31 11:35:09 -0600
commitf3db96631704f5d7cf2ee6c2a31812d161305356 (patch)
tree198e903605307c6faa25a9ed1bea5d26edd6785d
parentdecc616c800827e1e28c96fe2253ee229095dc23 (diff)
downloadopencode-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.ts23
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", {