@@ -290,6 +290,8 @@ export interface WatchInvokeOptions {
290290 invokeFileDeleteCreateAsPartInsteadOfChange : boolean ;
291291 /** Dont invoke delete watches */
292292 ignoreDelete : boolean ;
293+ /** ignore all watches */
294+ ignoreWatches ?: boolean ;
293295 /** Skip inode check on file or folder create*/
294296 skipInodeCheckOnCreate : boolean ;
295297 /** 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,
501503 else {
502504 currentEntry . content = content ;
503505 currentEntry . modifiedTime = this . now ( ) ;
506+ if ( options ?. ignoreWatches ) return ;
504507 if ( options && options . invokeDirectoryWatcherInsteadOfFileChanged ) {
505508 const directoryFullPath = getDirectoryPath ( currentEntry . fullPath ) ;
506509 this . fs . get ( getDirectoryPath ( currentEntry . path ) ) ! . modifiedTime = this . now ( ) ;
@@ -628,7 +631,7 @@ export class TestServerHost implements server.ServerHost, FormatDiagnosticsHost,
628631 this . fs . set ( fileOrDirectory . path , fileOrDirectory ) ;
629632 this . setInode ( fileOrDirectory . path ) ;
630633
631- if ( ignoreWatch ) {
634+ if ( ignoreWatch || options ?. ignoreWatches ) {
632635 return ;
633636 }
634637 const inodeWatching = this . inodeWatching ;
@@ -651,9 +654,9 @@ export class TestServerHost implements server.ServerHost, FormatDiagnosticsHost,
651654 if ( isFsFolder ( fileOrDirectory ) ) {
652655 Debug . assert ( fileOrDirectory . entries . length === 0 || isRenaming ) ;
653656 }
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 ) ;
655658 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 ) ;
657660 }
658661
659662 deleteFile ( filePath : string ) {
0 commit comments