mirror of
https://github.com/microsoft/vscode.git
synced 2026-08-19 14:22:19 +01:00
watcher - understand more patterns as full excludes
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
@@ -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'));
|
||||
|
||||
Reference in New Issue
Block a user