@@ -177,17 +177,28 @@ export async function indexWorkspaceFolder(wsFolder: vscode.WorkspaceFolder): Pr
177
177
// part of the workspace folder, like "git" files
178
178
return ;
179
179
}
180
+ if ( vscode . workspace . getWorkspaceFolder ( uri ) ?. uri . toString ( ) != wsFolder . uri . toString ( ) ) {
181
+ // This file is not in this workspace folder. This can occur if there
182
+ // are two workspace folders open where one is a subfolder of the other
183
+ // and the file being changed is in the subfolder. This event will fire
184
+ // for both watchers, but VS Code will correctly report that the file
185
+ // is in the subfolder workspace folder, so the parent watcher can
186
+ // safely ignore the event.
187
+ return ;
188
+ }
180
189
const uriString = uri . toString ( ) ;
181
190
if ( openCustomEditors . includes ( uriString ) ) {
182
191
// This class is open in a graphical editor, so its name will not change
183
192
// and any updates to the class will be handled by that editor
193
+ touchedByVSCode . delete ( uriString ) ;
184
194
return ;
185
195
}
186
196
if ( exportedUris . has ( uriString ) ) {
187
197
// This creation/change event was fired due to a server
188
198
// export, so don't re-sync the file with the server.
189
199
// The index has already been updated.
190
200
exportedUris . delete ( uriString ) ;
201
+ touchedByVSCode . delete ( uriString ) ;
191
202
return ;
192
203
}
193
204
const api = new AtelierAPI ( uri ) ;
@@ -225,6 +236,15 @@ export async function indexWorkspaceFolder(wsFolder: vscode.WorkspaceFolder): Pr
225
236
// part of the workspace folder, like "git" files
226
237
return ;
227
238
}
239
+ if ( vscode . workspace . getWorkspaceFolder ( uri ) ?. uri . toString ( ) != wsFolder . uri . toString ( ) ) {
240
+ // This file is not in this workspace folder. This can occur if there
241
+ // are two workspace folders open where one is a subfolder of the other
242
+ // and the file being changed is in the subfolder. This event will fire
243
+ // for both watchers, but VS Code will correctly report that the file
244
+ // is in the subfolder workspace folder, so the parent watcher can
245
+ // safely ignore the event.
246
+ return ;
247
+ }
228
248
const uriString = uri . toString ( ) ;
229
249
const api = new AtelierAPI ( uri ) ;
230
250
const syncLocalChanges : string = vscode . workspace
0 commit comments