We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 394ab94 commit 1f3d1daCopy full SHA for 1f3d1da
src/serverlessFunction/functionModel.ts
@@ -123,13 +123,18 @@ export class ServerlessFunctionModel implements Disposable {
123
private addWatchers() {
124
if (workspace.workspaceFolders) {
125
for (const workspaceFolder of workspace.workspaceFolders) {
126
- this.watchers.push(
127
- fs.watch(workspaceFolder.uri.fsPath, (_event, filename) => {
128
- if (filename === 'func.yaml') {
129
- this.view.refresh();
130
- }
131
- }),
132
- );
+ try {
+ fs.accessSync(workspaceFolder.uri.fsPath);
+ this.watchers.push(
+ fs.watch(workspaceFolder.uri.fsPath, (_event, filename) => {
+ if (filename === 'func.yaml') {
+ this.view.refresh();
+ }
133
+ }),
134
+ );
135
+ } catch (e) {
136
+ // do not watch non-existent folder
137
138
}
139
140
0 commit comments