You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Migrate file watchers from fs.watch to VS Code FileSystemWatcher API
Replace Node.js fs.watch with VS Code's FileSystemWatcher to fix Windows
test timeout caused by endless file events bug (nodejs/node#61398).
Changes:
- src/util/watch.ts: New watchFile() function using workspace.createFileSystemWatcher
with RelativePattern for reliable cross-platform file watching
- src/explorer.ts: Migrate kubeconfig watching to new API with callback pattern
- src/serverlessFunction/functionModel.ts: Replace multiple fs.watch calls with
single glob pattern watcher for func.yaml files
- src/util/workspace.ts: Enhanced devfile watching to support all valid extensions
(.yaml, .yml, .json for both devfile and .devfile variants)
- test/integration/watch.test.ts: Moved from unit tests and updated for new watchFile() API
(integration tests have full VS Code extension host environment)
- .gitignore: Add .claude/ directory
Benefits:
- Fixes Windows fs.watch endless events bug (VS Code uses parcel-watcher)
- Better performance (runs in VS Code's UtilityProcess)
- Cleaner code (callbacks instead of EventEmitters)
- More complete devfile detection (all valid extensions)
See:
- nodejs/node#61398 (fs.watch endless file events on Windows)
- microsoft/vscode#287800 (100% CPU on Windows with fs.watch)
- https://github.com/microsoft/vscode/wiki/File-Watcher-Internals (VS Code file watcher implementation)
Signed-off-by: Victor Rubezhny <vrubezhny@redhat.com>
Assisted-By: Claude Sonnet 4.5 <noreply@anthropic.com>
this.onDidChangeContextEmitter.fire(newCtx?.name);// newCtx can be 'null'
143
+
}
144
+
this.kubeContext=newCtx;
145
+
this.kubeConfigInfo=kci2;
146
+
})
147
+
);
133
148
if(this.kubeConfigWatchers.length===0){
134
149
voidwindow.showWarningMessage('Kubernetes configuration file(s) not found. Make sure that "${HOME}/.kube/config" file exists or "KUBECONFIG" environment variable is properly configured');
135
150
}
136
151
}catch{
137
152
voidwindow.showWarningMessage('Couldn\'t install watcher for Kubernetes configuration file. OpenShift Application Explorer view won\'t be updated automatically.');
voidwindow.showErrorMessage(`Can't keep track of if '${path.basename(workspaceFolder.uri.fsPath)}' contains a serverless function, since it's been deleted.`);
0 commit comments