Skip to content

Commit 5b0700c

Browse files
authored
fix: address review feedback - add file watcher handlers in standalone mode
1 parent ef479b7 commit 5b0700c

2 files changed

Lines changed: 9 additions & 2 deletions

File tree

package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -312,7 +312,6 @@
312312
"@semantic-release/github"
313313
]
314314
},
315-
"dependencies": {},
316315
"optionalDependencies": {
317316
"vscode-languageclient": "^7.0.0",
318317
"vscode-languageserver": "^7.0.0"

src/extension.js

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2100,9 +2100,17 @@ function activate(context) {
21002100
);
21012101

21022102
if (!_lspAvailable) {
2103-
// Standalone mode: still watch for file changes to trigger tree refreshes
2103+
// Standalone mode: watch for file changes to trigger keyword index refreshes
21042104
const workspaceWatcher = vscode.workspace.createFileSystemWatcher('**/*.{k,key,dyna}');
21052105
context.subscriptions.push(workspaceWatcher);
2106+
context.subscriptions.push(workspaceWatcher.onDidChange(() => {
2107+
const uri = getActiveUri();
2108+
if (uri) keywordIndexProvider.refreshFromUriOrDocument(uri);
2109+
}));
2110+
context.subscriptions.push(workspaceWatcher.onDidCreate(() => {
2111+
const uri = getActiveUri();
2112+
if (uri) keywordIndexProvider.refreshFromUriOrDocument(uri);
2113+
}));
21062114
}
21072115

21082116
const initialUri = getActiveUri();

0 commit comments

Comments
 (0)