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
// Convert a recursive watcher to a flat watcher if the path
176
+
// turns out to not be a folder. Recursive watching is only
177
+
// possible on folders, so we help all file watchers by checking
178
+
// early.
179
+
if(opts.recursive){
180
+
try{
181
+
conststat=awaitthis._fileService.stat(uri);
182
+
if(!stat.isDirectory){
183
+
opts.recursive=false;
184
+
}
185
+
}catch(error){
186
+
this._logService.error(`MainThreadFileSystem#$watch(): failed to stat a resource for file watching (extension: ${extensionId}, path: ${uri.toString(true)}, recursive: ${opts.recursive}, session: ${session}): ${error}`);
187
+
}
188
+
}
169
189
170
190
// Refuse to watch anything that is already watched via
171
191
// our workspace watchers in case the request is a
172
192
// recursive file watcher.
173
193
// Still allow for non-recursive watch requests as a way
174
194
// to bypass configured exlcude rules though
175
195
// (see https://github.com/microsoft/vscode/issues/146066)
176
-
if(isInsideWorkspace&&opts.recursive){
196
+
if(workspaceFolder&&opts.recursive){
177
197
this._logService.trace(`MainThreadFileSystem#$watch(): ignoring request to start watching because path is inside workspace (extension: ${extensionId}, path: ${uri.toString(true)}, recursive: ${opts.recursive}, session: ${session})`);
178
198
return;
179
199
}
@@ -200,7 +220,12 @@ export class MainThreadFileSystem implements MainThreadFileSystemShape {
200
220
// excluded via `files.watcherExclude`. As such, we configure
201
221
// to include each configured exclude pattern so that only those
202
222
// events are reported that are otherwise excluded.
203
-
elseif(isInsideWorkspace){
223
+
// However, we cannot just use the pattern as is, because a pattern
224
+
// such as `bar` for a exclude, will work to exclude any of
225
+
// `<workspace path>/bar` but will not work as include for files within
0 commit comments