@@ -290,6 +290,8 @@ export interface WatchInvokeOptions {
290
290
invokeFileDeleteCreateAsPartInsteadOfChange : boolean ;
291
291
/** Dont invoke delete watches */
292
292
ignoreDelete : boolean ;
293
+ /** ignore all watches */
294
+ ignoreWatches ?: boolean ;
293
295
/** Skip inode check on file or folder create*/
294
296
skipInodeCheckOnCreate : boolean ;
295
297
/** When invoking rename event on fs watch, send event with file name suffixed with tilde */
@@ -501,6 +503,7 @@ export class TestServerHost implements server.ServerHost, FormatDiagnosticsHost,
501
503
else {
502
504
currentEntry . content = content ;
503
505
currentEntry . modifiedTime = this . now ( ) ;
506
+ if ( options ?. ignoreWatches ) return ;
504
507
if ( options && options . invokeDirectoryWatcherInsteadOfFileChanged ) {
505
508
const directoryFullPath = getDirectoryPath ( currentEntry . fullPath ) ;
506
509
this . fs . get ( getDirectoryPath ( currentEntry . path ) ) ! . modifiedTime = this . now ( ) ;
@@ -628,7 +631,7 @@ export class TestServerHost implements server.ServerHost, FormatDiagnosticsHost,
628
631
this . fs . set ( fileOrDirectory . path , fileOrDirectory ) ;
629
632
this . setInode ( fileOrDirectory . path ) ;
630
633
631
- if ( ignoreWatch ) {
634
+ if ( ignoreWatch || options ?. ignoreWatches ) {
632
635
return ;
633
636
}
634
637
const inodeWatching = this . inodeWatching ;
@@ -651,9 +654,9 @@ export class TestServerHost implements server.ServerHost, FormatDiagnosticsHost,
651
654
if ( isFsFolder ( fileOrDirectory ) ) {
652
655
Debug . assert ( fileOrDirectory . entries . length === 0 || isRenaming ) ;
653
656
}
654
- if ( ! options ?. ignoreDelete ) this . invokeFileAndFsWatches ( fileOrDirectory . fullPath , FileWatcherEventKind . Deleted , /*modifiedTime*/ undefined , options ?. useTildeAsSuffixInRenameEventFileName ) ;
657
+ if ( ! options ?. ignoreDelete && ! options ?. ignoreWatches ) this . invokeFileAndFsWatches ( fileOrDirectory . fullPath , FileWatcherEventKind . Deleted , /*modifiedTime*/ undefined , options ?. useTildeAsSuffixInRenameEventFileName ) ;
655
658
this . inodes ?. delete ( fileOrDirectory . path ) ;
656
- if ( ! options ?. ignoreDelete ) this . invokeFileAndFsWatches ( baseFolder . fullPath , FileWatcherEventKind . Changed , baseFolder . modifiedTime , options ?. useTildeAsSuffixInRenameEventFileName ) ;
659
+ if ( ! options ?. ignoreDelete && ! options ?. ignoreWatches ) this . invokeFileAndFsWatches ( baseFolder . fullPath , FileWatcherEventKind . Changed , baseFolder . modifiedTime , options ?. useTildeAsSuffixInRenameEventFileName ) ;
657
660
}
658
661
659
662
deleteFile ( filePath : string ) {
0 commit comments