@@ -12,7 +12,7 @@ import { isLinux, isMacintosh, isWindows } from 'vs/base/common/platform';
12
12
import { Promises , RimRafMode } from 'vs/base/node/pfs' ;
13
13
import { flakySuite , getPathFromAmdModule , getRandomTestPath } from 'vs/base/test/node/testUtils' ;
14
14
import { FileChangeType } from 'vs/platform/files/common/files' ;
15
- import { IParcelWatcherInstance , ParcelWatcher } from 'vs/platform/files/node/watcher/parcel/parcelWatcher' ;
15
+ import { ParcelWatcher } from 'vs/platform/files/node/watcher/parcel/parcelWatcher' ;
16
16
import { IRecursiveWatchRequest } from 'vs/platform/files/common/watcher' ;
17
17
import { getDriveLetter } from 'vs/base/common/extpath' ;
18
18
import { ltrim } from 'vs/base/common/strings' ;
@@ -47,13 +47,9 @@ import { ltrim } from 'vs/base/common/strings';
47
47
}
48
48
}
49
49
50
- override toExcludePaths ( path : string , excludes : string [ ] | undefined ) : string [ ] | undefined {
50
+ testToExcludePaths ( path : string , excludes : string [ ] | undefined ) : string [ ] | undefined {
51
51
return super . toExcludePaths ( path , excludes ) ;
52
52
}
53
-
54
- override restartWatching ( watcher : IParcelWatcherInstance , delay = 10 ) : void {
55
- return super . restartWatching ( watcher , delay ) ;
56
- }
57
53
}
58
54
59
55
let testDir : string ;
@@ -573,39 +569,39 @@ import { ltrim } from 'vs/base/common/strings';
573
569
574
570
// undefined / empty
575
571
576
- assert . strictEqual ( watcher . toExcludePaths ( testDir , undefined ) , undefined ) ;
577
- assert . strictEqual ( watcher . toExcludePaths ( testDir , [ ] ) , undefined ) ;
572
+ assert . strictEqual ( watcher . testToExcludePaths ( testDir , undefined ) , undefined ) ;
573
+ assert . strictEqual ( watcher . testToExcludePaths ( testDir , [ ] ) , undefined ) ;
578
574
579
575
// absolute paths
580
576
581
- let excludes = watcher . toExcludePaths ( testDir , [ testDir ] ) ;
577
+ let excludes = watcher . testToExcludePaths ( testDir , [ testDir ] ) ;
582
578
assert . strictEqual ( excludes ?. length , 1 ) ;
583
579
assert . strictEqual ( excludes [ 0 ] , testDir ) ;
584
580
585
- excludes = watcher . toExcludePaths ( testDir , [ `${ testDir } ${ sep } ` , join ( testDir , 'foo' , 'bar' ) , `${ join ( testDir , 'other' , 'deep' ) } ${ sep } ` ] ) ;
581
+ excludes = watcher . testToExcludePaths ( testDir , [ `${ testDir } ${ sep } ` , join ( testDir , 'foo' , 'bar' ) , `${ join ( testDir , 'other' , 'deep' ) } ${ sep } ` ] ) ;
586
582
assert . strictEqual ( excludes ?. length , 3 ) ;
587
583
assert . strictEqual ( excludes [ 0 ] , testDir ) ;
588
584
assert . strictEqual ( excludes [ 1 ] , join ( testDir , 'foo' , 'bar' ) ) ;
589
585
assert . strictEqual ( excludes [ 2 ] , join ( testDir , 'other' , 'deep' ) ) ;
590
586
591
587
// wrong casing is normalized for root
592
588
if ( ! isLinux ) {
593
- excludes = watcher . toExcludePaths ( testDir , [ join ( testDir . toUpperCase ( ) , 'node_modules' , '**' ) ] ) ;
589
+ excludes = watcher . testToExcludePaths ( testDir , [ join ( testDir . toUpperCase ( ) , 'node_modules' , '**' ) ] ) ;
594
590
assert . strictEqual ( excludes ?. length , 1 ) ;
595
591
assert . strictEqual ( excludes [ 0 ] , join ( testDir , 'node_modules' ) ) ;
596
592
}
597
593
598
594
// exclude ignored if not parent of watched dir
599
- excludes = watcher . toExcludePaths ( testDir , [ join ( dirname ( testDir ) , 'node_modules' , '**' ) ] ) ;
595
+ excludes = watcher . testToExcludePaths ( testDir , [ join ( dirname ( testDir ) , 'node_modules' , '**' ) ] ) ;
600
596
assert . strictEqual ( excludes , undefined ) ;
601
597
602
598
// relative paths
603
599
604
- excludes = watcher . toExcludePaths ( testDir , [ '.' ] ) ;
600
+ excludes = watcher . testToExcludePaths ( testDir , [ '.' ] ) ;
605
601
assert . strictEqual ( excludes ?. length , 1 ) ;
606
602
assert . strictEqual ( excludes [ 0 ] , testDir ) ;
607
603
608
- excludes = watcher . toExcludePaths ( testDir , [ 'foo' , `bar${ sep } ` , join ( 'foo' , 'bar' ) , `${ join ( 'other' , 'deep' ) } ${ sep } ` ] ) ;
604
+ excludes = watcher . testToExcludePaths ( testDir , [ 'foo' , `bar${ sep } ` , join ( 'foo' , 'bar' ) , `${ join ( 'other' , 'deep' ) } ${ sep } ` ] ) ;
609
605
assert . strictEqual ( excludes ?. length , 4 ) ;
610
606
assert . strictEqual ( excludes [ 0 ] , join ( testDir , 'foo' ) ) ;
611
607
assert . strictEqual ( excludes [ 1 ] , join ( testDir , 'bar' ) ) ;
@@ -614,69 +610,69 @@ import { ltrim } from 'vs/base/common/strings';
614
610
615
611
// simple globs (relative)
616
612
617
- excludes = watcher . toExcludePaths ( testDir , [ '**' ] ) ;
613
+ excludes = watcher . testToExcludePaths ( testDir , [ '**' ] ) ;
618
614
assert . strictEqual ( excludes ?. length , 1 ) ;
619
615
assert . strictEqual ( excludes [ 0 ] , testDir ) ;
620
616
621
- excludes = watcher . toExcludePaths ( testDir , [ '**/**' ] ) ;
617
+ excludes = watcher . testToExcludePaths ( testDir , [ '**/**' ] ) ;
622
618
assert . strictEqual ( excludes ?. length , 1 ) ;
623
619
assert . strictEqual ( excludes [ 0 ] , testDir ) ;
624
620
625
- excludes = watcher . toExcludePaths ( testDir , [ '**\\**' ] ) ;
621
+ excludes = watcher . testToExcludePaths ( testDir , [ '**\\**' ] ) ;
626
622
assert . strictEqual ( excludes ?. length , 1 ) ;
627
623
assert . strictEqual ( excludes [ 0 ] , testDir ) ;
628
624
629
- excludes = watcher . toExcludePaths ( testDir , [ '**/node_modules/**' ] ) ;
625
+ excludes = watcher . testToExcludePaths ( testDir , [ '**/node_modules/**' ] ) ;
630
626
assert . strictEqual ( excludes ?. length , 1 ) ;
631
627
assert . strictEqual ( excludes [ 0 ] , join ( testDir , 'node_modules' ) ) ;
632
628
633
- excludes = watcher . toExcludePaths ( testDir , [ '**/.git/objects/**' ] ) ;
629
+ excludes = watcher . testToExcludePaths ( testDir , [ '**/.git/objects/**' ] ) ;
634
630
assert . strictEqual ( excludes ?. length , 1 ) ;
635
631
assert . strictEqual ( excludes [ 0 ] , join ( testDir , '.git' , 'objects' ) ) ;
636
632
637
- excludes = watcher . toExcludePaths ( testDir , [ '**/node_modules' ] ) ;
633
+ excludes = watcher . testToExcludePaths ( testDir , [ '**/node_modules' ] ) ;
638
634
assert . strictEqual ( excludes ?. length , 1 ) ;
639
635
assert . strictEqual ( excludes [ 0 ] , join ( testDir , 'node_modules' ) ) ;
640
636
641
- excludes = watcher . toExcludePaths ( testDir , [ '**/.git/objects' ] ) ;
637
+ excludes = watcher . testToExcludePaths ( testDir , [ '**/.git/objects' ] ) ;
642
638
assert . strictEqual ( excludes ?. length , 1 ) ;
643
639
assert . strictEqual ( excludes [ 0 ] , join ( testDir , '.git' , 'objects' ) ) ;
644
640
645
- excludes = watcher . toExcludePaths ( testDir , [ 'node_modules/**' ] ) ;
641
+ excludes = watcher . testToExcludePaths ( testDir , [ 'node_modules/**' ] ) ;
646
642
assert . strictEqual ( excludes ?. length , 1 ) ;
647
643
assert . strictEqual ( excludes [ 0 ] , join ( testDir , 'node_modules' ) ) ;
648
644
649
- excludes = watcher . toExcludePaths ( testDir , [ '.git/objects/**' ] ) ;
645
+ excludes = watcher . testToExcludePaths ( testDir , [ '.git/objects/**' ] ) ;
650
646
assert . strictEqual ( excludes ?. length , 1 ) ;
651
647
assert . strictEqual ( excludes [ 0 ] , join ( testDir , '.git' , 'objects' ) ) ;
652
648
653
649
// simple globs (absolute)
654
650
655
- excludes = watcher . toExcludePaths ( testDir , [ join ( testDir , 'node_modules' , '**' ) ] ) ;
651
+ excludes = watcher . testToExcludePaths ( testDir , [ join ( testDir , 'node_modules' , '**' ) ] ) ;
656
652
assert . strictEqual ( excludes ?. length , 1 ) ;
657
653
assert . strictEqual ( excludes [ 0 ] , join ( testDir , 'node_modules' ) ) ;
658
654
659
655
// Linux: more restrictive glob treatment
660
656
if ( isLinux ) {
661
- excludes = watcher . toExcludePaths ( testDir , [ '**/node_modules/*/**' ] ) ;
657
+ excludes = watcher . testToExcludePaths ( testDir , [ '**/node_modules/*/**' ] ) ;
662
658
assert . strictEqual ( excludes ?. length , 1 ) ;
663
659
assert . strictEqual ( excludes [ 0 ] , join ( testDir , 'node_modules' ) ) ;
664
660
}
665
661
666
662
// unsupported globs
667
663
668
664
else {
669
- excludes = watcher . toExcludePaths ( testDir , [ '**/node_modules/*/**' ] ) ;
665
+ excludes = watcher . testToExcludePaths ( testDir , [ '**/node_modules/*/**' ] ) ;
670
666
assert . strictEqual ( excludes , undefined ) ;
671
667
}
672
668
673
- excludes = watcher . toExcludePaths ( testDir , [ '**/*.js' ] ) ;
669
+ excludes = watcher . testToExcludePaths ( testDir , [ '**/*.js' ] ) ;
674
670
assert . strictEqual ( excludes , undefined ) ;
675
671
676
- excludes = watcher . toExcludePaths ( testDir , [ '*.js' ] ) ;
672
+ excludes = watcher . testToExcludePaths ( testDir , [ '*.js' ] ) ;
677
673
assert . strictEqual ( excludes , undefined ) ;
678
674
679
- excludes = watcher . toExcludePaths ( testDir , [ '*' ] ) ;
675
+ excludes = watcher . testToExcludePaths ( testDir , [ '*' ] ) ;
680
676
assert . strictEqual ( excludes , undefined ) ;
681
677
} ) ;
682
678
} ) ;
0 commit comments