diff --git a/src/vs/platform/files/node/watcher/parcel/parcelWatcherService.ts b/src/vs/platform/files/node/watcher/parcel/parcelWatcherService.ts index 07d4ecdf88b..72f47318de2 100644 --- a/src/vs/platform/files/node/watcher/parcel/parcelWatcherService.ts +++ b/src/vs/platform/files/node/watcher/parcel/parcelWatcherService.ts @@ -73,6 +73,8 @@ export class ParcelWatcherService extends Disposable implements IWatcherService private static readonly GLOB_MARKERS = { Star: '*', GlobStar: '**', + GlobStarPosix: '**/**', + GlobStarWindows: '**\\**', GlobStarPathStartPosix: '**/', GlobStarPathEndPosix: '/**', StarPathEndPosix: '/*', @@ -166,8 +168,12 @@ export class ParcelWatcherService extends Disposable implements IWatcherService let normalizedExclude: string | undefined = undefined; if (isGlob) { - // Examples: ** - if (exclude === ParcelWatcherService.GLOB_MARKERS.GlobStar) { + // Examples: **, **/**, **\** + if ( + exclude === ParcelWatcherService.GLOB_MARKERS.GlobStar || + exclude === ParcelWatcherService.GLOB_MARKERS.GlobStarPosix || + exclude === ParcelWatcherService.GLOB_MARKERS.GlobStarWindows + ) { normalizedExclude = path; } diff --git a/src/vs/platform/files/test/node/recursiveWatcher.test.ts b/src/vs/platform/files/test/node/recursiveWatcher.test.ts index fd554c99efe..ce1d1f9f8be 100644 --- a/src/vs/platform/files/test/node/recursiveWatcher.test.ts +++ b/src/vs/platform/files/test/node/recursiveWatcher.test.ts @@ -504,6 +504,14 @@ flakySuite('Recursive Watcher (parcel)', () => { assert.strictEqual(excludes?.length, 1); assert.strictEqual(excludes[0], testDir); + excludes = service.toExcludePaths(testDir, ['**/**']); + assert.strictEqual(excludes?.length, 1); + assert.strictEqual(excludes[0], testDir); + + excludes = service.toExcludePaths(testDir, ['**\\**']); + assert.strictEqual(excludes?.length, 1); + assert.strictEqual(excludes[0], testDir); + excludes = service.toExcludePaths(testDir, ['**/node_modules/**']); assert.strictEqual(excludes?.length, 1); assert.strictEqual(excludes[0], join(testDir, 'node_modules'));