From 0a01fcbd6ae254bba3562d2cfe60d22d6798479e Mon Sep 17 00:00:00 2001 From: Sheetal Nandi Date: Tue, 22 Nov 2022 11:37:56 -0800 Subject: [PATCH 1/4] When fsEvent for change is repeated --- src/harness/virtualFileSystemWithWatch.ts | 2 +- .../unittests/tscWatch/watchEnvironment.ts | 22 +++ .../fsEvent-for-change-is-repeated.js | 166 ++++++++++++++++++ 3 files changed, 189 insertions(+), 1 deletion(-) create mode 100644 tests/baselines/reference/tscWatch/watchEnvironment/fsEvent-for-change-is-repeated.js diff --git a/src/harness/virtualFileSystemWithWatch.ts b/src/harness/virtualFileSystemWithWatch.ts index f5979f9c3876d..caa5681d74f73 100644 --- a/src/harness/virtualFileSystemWithWatch.ts +++ b/src/harness/virtualFileSystemWithWatch.ts @@ -730,7 +730,7 @@ interface Array { length: number; [n: number]: T; }` } } - private invokeFsWatches(fullPath: string, eventName: "rename" | "change", modifiedTime: Date | undefined, useTildeSuffix: boolean | undefined) { + invokeFsWatches(fullPath: string, eventName: "rename" | "change", modifiedTime: Date | undefined, useTildeSuffix: boolean | undefined) { this.invokeFsWatchesCallbacks(fullPath, eventName, modifiedTime, fullPath, useTildeSuffix); this.invokeFsWatchesCallbacks(getDirectoryPath(fullPath), eventName, modifiedTime, fullPath, useTildeSuffix); this.invokeRecursiveFsWatches(fullPath, eventName, modifiedTime, /*entryFullPath*/ undefined, useTildeSuffix); diff --git a/src/testRunner/unittests/tscWatch/watchEnvironment.ts b/src/testRunner/unittests/tscWatch/watchEnvironment.ts index 45dd1ff714391..a63c91efca936 100644 --- a/src/testRunner/unittests/tscWatch/watchEnvironment.ts +++ b/src/testRunner/unittests/tscWatch/watchEnvironment.ts @@ -687,5 +687,27 @@ namespace ts.tscWatch { ] }); }); + + verifyTscWatch({ + scenario, + subScenario: "fsEvent for change is repeated", + commandLineArgs: ["-w", "main.ts", "--extendedDiagnostics"], + sys: () => createWatchedSystem({ + "/user/username/projects/project/main.ts": `let a: string = "Hello"`, + [libFile.path]: libFile.content, + }, { currentDirectory: "/user/username/projects/project" }), + changes: [ + { + caption: "change main.ts", + change: sys => replaceFileText(sys, "/user/username/projects/project/main.ts", "Hello", "Hello World"), + timeouts: sys => sys.runQueuedTimeoutCallbacks(), + }, + { + caption: "receive another change event without modifying the file", + change: sys => sys.invokeFsWatches("/user/username/projects/project/main.ts", "change", /*modifiedTime*/ undefined, /*useTildeSuffix*/ undefined), + timeouts: sys => sys.runQueuedTimeoutCallbacks(), + } + ] + }); }); } diff --git a/tests/baselines/reference/tscWatch/watchEnvironment/fsEvent-for-change-is-repeated.js b/tests/baselines/reference/tscWatch/watchEnvironment/fsEvent-for-change-is-repeated.js new file mode 100644 index 0000000000000..101b21581bed3 --- /dev/null +++ b/tests/baselines/reference/tscWatch/watchEnvironment/fsEvent-for-change-is-repeated.js @@ -0,0 +1,166 @@ +Input:: +//// [/user/username/projects/project/main.ts] +let a: string = "Hello" + +//// [/a/lib/lib.d.ts] +/// +interface Boolean {} +interface Function {} +interface CallableFunction {} +interface NewableFunction {} +interface IArguments {} +interface Number { toExponential: any; } +interface Object {} +interface RegExp {} +interface String { charAt: any; } +interface Array { length: number; [n: number]: T; } + + +/a/lib/tsc.js -w main.ts --extendedDiagnostics +Output:: +[12:00:19 AM] Starting compilation in watch mode... + +Current directory: /user/username/projects/project CaseSensitiveFileNames: false +Synchronizing program +CreatingProgramWith:: + roots: ["main.ts"] + options: {"watch":true,"extendedDiagnostics":true} +FileWatcher:: Added:: WatchInfo: main.ts 250 undefined Source file +FileWatcher:: Added:: WatchInfo: /a/lib/lib.d.ts 250 undefined Source file +DirectoryWatcher:: Added:: WatchInfo: /user/username/projects/project/node_modules/@types 1 undefined Type roots +Elapsed:: *ms DirectoryWatcher:: Added:: WatchInfo: /user/username/projects/project/node_modules/@types 1 undefined Type roots +[12:00:22 AM] Found 0 errors. Watching for file changes. + + + +Program root files: ["main.ts"] +Program options: {"watch":true,"extendedDiagnostics":true} +Program structureReused: Not +Program files:: +/a/lib/lib.d.ts +main.ts + +Semantic diagnostics in builder refreshed for:: +/a/lib/lib.d.ts +main.ts + +Shape signatures in builder refreshed for:: +/a/lib/lib.d.ts (used version) +/user/username/projects/project/main.ts (used version) + +PolledWatches:: +/user/username/projects/project/node_modules/@types: + {"pollingInterval":500} + +FsWatches:: +/user/username/projects/project/main.ts: + {} +/a/lib/lib.d.ts: + {} + +FsWatchesRecursive:: + +exitCode:: ExitStatus.undefined + +//// [/user/username/projects/project/main.js] +var a = "Hello"; + + + +Change:: change main.ts + +Input:: +//// [/user/username/projects/project/main.ts] +let a: string = "Hello World" + + +Output:: +FileWatcher:: Triggered with main.ts 1:: WatchInfo: main.ts 250 undefined Source file +Scheduling update +Elapsed:: *ms FileWatcher:: Triggered with main.ts 1:: WatchInfo: main.ts 250 undefined Source file +Synchronizing program +[12:00:26 AM] File change detected. Starting incremental compilation... + +CreatingProgramWith:: + roots: ["main.ts"] + options: {"watch":true,"extendedDiagnostics":true} +[12:00:30 AM] Found 0 errors. Watching for file changes. + + + +Program root files: ["main.ts"] +Program options: {"watch":true,"extendedDiagnostics":true} +Program structureReused: Completely +Program files:: +/a/lib/lib.d.ts +main.ts + +Semantic diagnostics in builder refreshed for:: +/a/lib/lib.d.ts +main.ts + +Shape signatures in builder refreshed for:: +/user/username/projects/project/main.ts (computed .d.ts) + +PolledWatches:: +/user/username/projects/project/node_modules/@types: + {"pollingInterval":500} + +FsWatches:: +/user/username/projects/project/main.ts: + {} +/a/lib/lib.d.ts: + {} + +FsWatchesRecursive:: + +exitCode:: ExitStatus.undefined + +//// [/user/username/projects/project/main.js] +var a = "Hello World"; + + + +Change:: receive another change event without modifying the file + +Input:: + +Output:: +FileWatcher:: Triggered with main.ts 1:: WatchInfo: main.ts 250 undefined Source file +Scheduling update +Elapsed:: *ms FileWatcher:: Triggered with main.ts 1:: WatchInfo: main.ts 250 undefined Source file +Synchronizing program +[12:00:31 AM] File change detected. Starting incremental compilation... + +CreatingProgramWith:: + roots: ["main.ts"] + options: {"watch":true,"extendedDiagnostics":true} +[12:00:32 AM] Found 0 errors. Watching for file changes. + + + +Program root files: ["main.ts"] +Program options: {"watch":true,"extendedDiagnostics":true} +Program structureReused: Completely +Program files:: +/a/lib/lib.d.ts +main.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + +PolledWatches:: +/user/username/projects/project/node_modules/@types: + {"pollingInterval":500} + +FsWatches:: +/user/username/projects/project/main.ts: + {} +/a/lib/lib.d.ts: + {} + +FsWatchesRecursive:: + +exitCode:: ExitStatus.undefined + From 2de171b73c8758186cf220df8ebe9675d4ae0656 Mon Sep 17 00:00:00 2001 From: Sheetal Nandi Date: Tue, 22 Nov 2022 12:06:56 -0800 Subject: [PATCH 2/4] When trying to check if program is uptodate, read the files from disk to determine the version instead of delaying so that new program is not created if file contents have not changed --- src/compiler/tsbuildPublic.ts | 2 +- src/compiler/watch.ts | 10 ++- src/compiler/watchPublic.ts | 16 ++-- .../with-noEmitOnError-with-incremental.js | 79 ++----------------- .../with-noEmitOnError.js | 79 ++----------------- .../with-noEmitOnError-with-incremental.js | 79 ++----------------- .../with-noEmitOnError.js | 79 ++----------------- .../with-noEmitOnError-with-incremental.js | 79 ++----------------- .../default/with-noEmitOnError.js | 79 ++----------------- .../with-noEmitOnError-with-incremental.js | 79 ++----------------- .../defaultAndD/with-noEmitOnError.js | 79 ++----------------- .../with-noEmitOnError-with-incremental.js | 79 ++----------------- .../isolatedModules/with-noEmitOnError.js | 79 ++----------------- .../with-noEmitOnError-with-incremental.js | 79 ++----------------- .../isolatedModulesAndD/with-noEmitOnError.js | 79 ++----------------- ...st-implements-hasInvalidatedResolutions.js | 27 +------ .../fsEvent-for-change-is-repeated.js | 18 ----- 17 files changed, 93 insertions(+), 928 deletions(-) diff --git a/src/compiler/tsbuildPublic.ts b/src/compiler/tsbuildPublic.ts index 1251fca05a9e3..e54fb1e04f979 100644 --- a/src/compiler/tsbuildPublic.ts +++ b/src/compiler/tsbuildPublic.ts @@ -292,7 +292,7 @@ namespace ts { // State of the solution const baseCompilerOptions = getCompilerOptionsOfBuildOptions(options); const compilerHost = createCompilerHostFromProgramHost(host, () => state.projectCompilerOptions) as CompilerHost & ReadBuildProgramHost; - setGetSourceFileAsHashVersioned(compilerHost, host); + setGetSourceFileAsHashVersioned(compilerHost); compilerHost.getParsedCommandLine = fileName => parseConfigFile(state, fileName as ResolvedConfigFileName, toResolvedConfigFilePath(state, fileName as ResolvedConfigFileName)); compilerHost.resolveModuleNames = maybeBind(host, host.resolveModuleNames); compilerHost.resolveTypeReferenceDirectives = maybeBind(host, host.resolveTypeReferenceDirectives); diff --git a/src/compiler/watch.ts b/src/compiler/watch.ts index d1851cd02cd08..b06ce9626f08b 100644 --- a/src/compiler/watch.ts +++ b/src/compiler/watch.ts @@ -595,12 +595,13 @@ namespace ts { export function createCompilerHostFromProgramHost(host: ProgramHost, getCompilerOptions: () => CompilerOptions, directoryStructureHost: DirectoryStructureHost = host): CompilerHost { const useCaseSensitiveFileNames = host.useCaseSensitiveFileNames(); const hostGetNewLine = memoize(() => host.getNewLine()); - return { + const compilerHost: CompilerHost = { getSourceFile: (fileName, languageVersionOrOptions, onError) => { let text: string | undefined; try { performance.mark("beforeIORead"); - text = host.readFile(fileName, getCompilerOptions().charset); + const encoding = getCompilerOptions().charset; + text = !encoding ? compilerHost.readFile(fileName) : host.readFile(fileName, encoding); performance.mark("afterIORead"); performance.measure("I/O Read", "beforeIORead", "afterIORead"); } @@ -632,6 +633,7 @@ namespace ts { disableUseFileVersionAsSignature: host.disableUseFileVersionAsSignature, storeFilesChangingSignatureDuringEmit: host.storeFilesChangingSignatureDuringEmit, }; + return compilerHost; function writeFile(fileName: string, text: string, writeByteOrderMark: boolean, onError: (message: string) => void) { try { @@ -659,9 +661,9 @@ namespace ts { } } - export function setGetSourceFileAsHashVersioned(compilerHost: CompilerHost, host: { createHash?(data: string): string; }) { + export function setGetSourceFileAsHashVersioned(compilerHost: CompilerHost) { const originalGetSourceFile = compilerHost.getSourceFile; - const computeHash = maybeBind(host, host.createHash) || generateDjb2Hash; + const computeHash = maybeBind(compilerHost, compilerHost.createHash) || generateDjb2Hash; compilerHost.getSourceFile = (...args) => { const result = originalGetSourceFile.call(compilerHost, ...args); if (result) { diff --git a/src/compiler/watchPublic.ts b/src/compiler/watchPublic.ts index 011a24f5b7129..8f0544756b4de 100644 --- a/src/compiler/watchPublic.ts +++ b/src/compiler/watchPublic.ts @@ -28,7 +28,7 @@ namespace ts { host.createHash = maybeBind(system, system.createHash); host.disableUseFileVersionAsSignature = system.disableUseFileVersionAsSignature; host.storeFilesChangingSignatureDuringEmit = system.storeFilesChangingSignatureDuringEmit; - setGetSourceFileAsHashVersioned(host, system); + setGetSourceFileAsHashVersioned(host); changeCompilerHostLikeToUseCache(host, fileName => toPath(fileName, host.getCurrentDirectory(), host.getCanonicalFileName)); return host; } @@ -330,7 +330,7 @@ namespace ts { } const compilerHost = createCompilerHostFromProgramHost(host, () => compilerOptions, directoryStructureHost) as CompilerHost & ResolutionCacheHost; - setGetSourceFileAsHashVersioned(compilerHost, host); + setGetSourceFileAsHashVersioned(compilerHost); // Members for CompilerHost const getNewSourceFile = compilerHost.getSourceFile; compilerHost.getSourceFile = (fileName, ...args) => getVersionedSourceFileByPath(fileName, toPath(fileName), ...args); @@ -452,9 +452,9 @@ namespace ts { const hasInvalidatedResolutions = resolutionCache.createHasInvalidatedResolutions(customHasInvalidatedResolutions); const { originalReadFile, originalFileExists, originalDirectoryExists, - originalCreateDirectory, originalWriteFile, + originalCreateDirectory, originalWriteFile, readFileWithCache, } = changeCompilerHostLikeToUseCache(compilerHost, toPath); - if (isProgramUptoDate(getCurrentProgram(), rootFileNames, compilerOptions, getSourceVersion, fileName => compilerHost.fileExists(fileName), hasInvalidatedResolutions, hasChangedAutomaticTypeDirectiveNames, getParsedCommandLine, projectReferences)) { + if (isProgramUptoDate(getCurrentProgram(), rootFileNames, compilerOptions, path => getSourceVersion(path, readFileWithCache), fileName => compilerHost.fileExists(fileName), hasInvalidatedResolutions, hasChangedAutomaticTypeDirectiveNames, getParsedCommandLine, projectReferences)) { if (hasChangedConfigFileParsingErrors) { if (reportFileChangeDetectedOnCreateProgram) { reportWatchDiagnostic(Diagnostics.File_change_detected_Starting_incremental_compilation); @@ -609,9 +609,13 @@ namespace ts { } } - function getSourceVersion(path: Path): string | undefined { + function getSourceVersion(path: Path, readFileWithCache: (fileName: string) => string | undefined): string | undefined { const hostSourceFile = sourceFilesCache.get(path); - return !hostSourceFile || !hostSourceFile.version ? undefined : hostSourceFile.version; + if (!hostSourceFile) return undefined; + if (hostSourceFile.version) return hostSourceFile.version; + // Read file and get new version + const text = readFileWithCache(path); + return text ? (compilerHost.createHash || generateDjb2Hash)(text) : undefined; } function onReleaseOldSourceFile(oldSourceFile: SourceFile, _oldOptions: CompilerOptions, hasSourceFileByPath: boolean) { diff --git a/tests/baselines/reference/tscWatch/emitAndErrorUpdates/assumeChangesOnlyAffectDirectDependencies/with-noEmitOnError-with-incremental.js b/tests/baselines/reference/tscWatch/emitAndErrorUpdates/assumeChangesOnlyAffectDirectDependencies/with-noEmitOnError-with-incremental.js index d6d7f1281c501..338d7bdcd3347 100644 --- a/tests/baselines/reference/tscWatch/emitAndErrorUpdates/assumeChangesOnlyAffectDirectDependencies/with-noEmitOnError-with-incremental.js +++ b/tests/baselines/reference/tscWatch/emitAndErrorUpdates/assumeChangesOnlyAffectDirectDependencies/with-noEmitOnError-with-incremental.js @@ -179,30 +179,6 @@ Input:: //// [/user/username/projects/noEmitOnError/src/main.ts] file written with same contents Output:: ->> Screen clear -[12:00:43 AM] File change detected. Starting incremental compilation... - -src/main.ts:4:1 - error TS1005: ',' expected. - -4 ; -  ~ - -[12:00:44 AM] Found 1 error. Watching for file changes. - - - -Program root files: ["/user/username/projects/noEmitOnError/shared/types/db.ts","/user/username/projects/noEmitOnError/src/main.ts","/user/username/projects/noEmitOnError/src/other.ts"] -Program options: {"outDir":"/user/username/projects/noEmitOnError/dev-build","noEmitOnError":true,"watch":true,"assumeChangesOnlyAffectDirectDependencies":true,"incremental":true,"configFilePath":"/user/username/projects/noEmitOnError/tsconfig.json"} -Program structureReused: Completely -Program files:: -/a/lib/lib.d.ts -/user/username/projects/noEmitOnError/shared/types/db.ts -/user/username/projects/noEmitOnError/src/main.ts -/user/username/projects/noEmitOnError/src/other.ts - -Semantic diagnostics in builder refreshed for:: - -No shapes updated in the builder:: PolledWatches:: /user/username/projects/noemitonerror/node_modules/@types: @@ -239,9 +215,9 @@ const a = { Output:: >> Screen clear -[12:00:48 AM] File change detected. Starting incremental compilation... +[12:00:46 AM] File change detected. Starting incremental compilation... -[12:01:06 AM] Found 0 errors. Watching for file changes. +[12:01:04 AM] Found 0 errors. Watching for file changes. @@ -370,14 +346,14 @@ const a: string = 10; Output:: >> Screen clear -[12:01:13 AM] File change detected. Starting incremental compilation... +[12:01:11 AM] File change detected. Starting incremental compilation... src/main.ts:2:7 - error TS2322: Type 'number' is not assignable to type 'string'. 2 const a: string = 10;    ~ -[12:01:17 AM] Found 1 error. Watching for file changes. +[12:01:15 AM] Found 1 error. Watching for file changes. @@ -501,30 +477,6 @@ Input:: //// [/user/username/projects/noEmitOnError/src/main.ts] file written with same contents Output:: ->> Screen clear -[12:01:25 AM] File change detected. Starting incremental compilation... - -src/main.ts:2:7 - error TS2322: Type 'number' is not assignable to type 'string'. - -2 const a: string = 10; -   ~ - -[12:01:26 AM] Found 1 error. Watching for file changes. - - - -Program root files: ["/user/username/projects/noEmitOnError/shared/types/db.ts","/user/username/projects/noEmitOnError/src/main.ts","/user/username/projects/noEmitOnError/src/other.ts"] -Program options: {"outDir":"/user/username/projects/noEmitOnError/dev-build","noEmitOnError":true,"watch":true,"assumeChangesOnlyAffectDirectDependencies":true,"incremental":true,"configFilePath":"/user/username/projects/noEmitOnError/tsconfig.json"} -Program structureReused: Completely -Program files:: -/a/lib/lib.d.ts -/user/username/projects/noEmitOnError/shared/types/db.ts -/user/username/projects/noEmitOnError/src/main.ts -/user/username/projects/noEmitOnError/src/other.ts - -Semantic diagnostics in builder refreshed for:: - -No shapes updated in the builder:: PolledWatches:: /user/username/projects/noemitonerror/node_modules/@types: @@ -559,9 +511,9 @@ const a: string = "hello"; Output:: >> Screen clear -[12:01:30 AM] File change detected. Starting incremental compilation... +[12:01:26 AM] File change detected. Starting incremental compilation... -[12:01:37 AM] Found 0 errors. Watching for file changes. +[12:01:33 AM] Found 0 errors. Watching for file changes. @@ -673,25 +625,6 @@ Input:: //// [/user/username/projects/noEmitOnError/src/main.ts] file written with same contents Output:: ->> Screen clear -[12:01:44 AM] File change detected. Starting incremental compilation... - -[12:01:45 AM] Found 0 errors. Watching for file changes. - - - -Program root files: ["/user/username/projects/noEmitOnError/shared/types/db.ts","/user/username/projects/noEmitOnError/src/main.ts","/user/username/projects/noEmitOnError/src/other.ts"] -Program options: {"outDir":"/user/username/projects/noEmitOnError/dev-build","noEmitOnError":true,"watch":true,"assumeChangesOnlyAffectDirectDependencies":true,"incremental":true,"configFilePath":"/user/username/projects/noEmitOnError/tsconfig.json"} -Program structureReused: Completely -Program files:: -/a/lib/lib.d.ts -/user/username/projects/noEmitOnError/shared/types/db.ts -/user/username/projects/noEmitOnError/src/main.ts -/user/username/projects/noEmitOnError/src/other.ts - -Semantic diagnostics in builder refreshed for:: - -No shapes updated in the builder:: PolledWatches:: /user/username/projects/noemitonerror/node_modules/@types: diff --git a/tests/baselines/reference/tscWatch/emitAndErrorUpdates/assumeChangesOnlyAffectDirectDependencies/with-noEmitOnError.js b/tests/baselines/reference/tscWatch/emitAndErrorUpdates/assumeChangesOnlyAffectDirectDependencies/with-noEmitOnError.js index d66bc1a013f87..95e8ae34b951a 100644 --- a/tests/baselines/reference/tscWatch/emitAndErrorUpdates/assumeChangesOnlyAffectDirectDependencies/with-noEmitOnError.js +++ b/tests/baselines/reference/tscWatch/emitAndErrorUpdates/assumeChangesOnlyAffectDirectDependencies/with-noEmitOnError.js @@ -103,30 +103,6 @@ Input:: //// [/user/username/projects/noEmitOnError/src/main.ts] file written with same contents Output:: ->> Screen clear -[12:00:36 AM] File change detected. Starting incremental compilation... - -src/main.ts:4:1 - error TS1005: ',' expected. - -4 ; -  ~ - -[12:00:37 AM] Found 1 error. Watching for file changes. - - - -Program root files: ["/user/username/projects/noEmitOnError/shared/types/db.ts","/user/username/projects/noEmitOnError/src/main.ts","/user/username/projects/noEmitOnError/src/other.ts"] -Program options: {"outDir":"/user/username/projects/noEmitOnError/dev-build","noEmitOnError":true,"watch":true,"assumeChangesOnlyAffectDirectDependencies":true,"configFilePath":"/user/username/projects/noEmitOnError/tsconfig.json"} -Program structureReused: Completely -Program files:: -/a/lib/lib.d.ts -/user/username/projects/noEmitOnError/shared/types/db.ts -/user/username/projects/noEmitOnError/src/main.ts -/user/username/projects/noEmitOnError/src/other.ts - -Semantic diagnostics in builder refreshed for:: - -No shapes updated in the builder:: PolledWatches:: /user/username/projects/noemitonerror/node_modules/@types: @@ -163,9 +139,9 @@ const a = { Output:: >> Screen clear -[12:00:41 AM] File change detected. Starting incremental compilation... +[12:00:39 AM] File change detected. Starting incremental compilation... -[12:00:58 AM] Found 0 errors. Watching for file changes. +[12:00:56 AM] Found 0 errors. Watching for file changes. @@ -236,14 +212,14 @@ const a: string = 10; Output:: >> Screen clear -[12:01:02 AM] File change detected. Starting incremental compilation... +[12:01:00 AM] File change detected. Starting incremental compilation... src/main.ts:2:7 - error TS2322: Type 'number' is not assignable to type 'string'. 2 const a: string = 10;    ~ -[12:01:03 AM] Found 1 error. Watching for file changes. +[12:01:01 AM] Found 1 error. Watching for file changes. @@ -291,30 +267,6 @@ Input:: //// [/user/username/projects/noEmitOnError/src/main.ts] file written with same contents Output:: ->> Screen clear -[12:01:08 AM] File change detected. Starting incremental compilation... - -src/main.ts:2:7 - error TS2322: Type 'number' is not assignable to type 'string'. - -2 const a: string = 10; -   ~ - -[12:01:09 AM] Found 1 error. Watching for file changes. - - - -Program root files: ["/user/username/projects/noEmitOnError/shared/types/db.ts","/user/username/projects/noEmitOnError/src/main.ts","/user/username/projects/noEmitOnError/src/other.ts"] -Program options: {"outDir":"/user/username/projects/noEmitOnError/dev-build","noEmitOnError":true,"watch":true,"assumeChangesOnlyAffectDirectDependencies":true,"configFilePath":"/user/username/projects/noEmitOnError/tsconfig.json"} -Program structureReused: Completely -Program files:: -/a/lib/lib.d.ts -/user/username/projects/noEmitOnError/shared/types/db.ts -/user/username/projects/noEmitOnError/src/main.ts -/user/username/projects/noEmitOnError/src/other.ts - -Semantic diagnostics in builder refreshed for:: - -No shapes updated in the builder:: PolledWatches:: /user/username/projects/noemitonerror/node_modules/@types: @@ -349,9 +301,9 @@ const a: string = "hello"; Output:: >> Screen clear -[12:01:13 AM] File change detected. Starting incremental compilation... +[12:01:09 AM] File change detected. Starting incremental compilation... -[12:01:17 AM] Found 0 errors. Watching for file changes. +[12:01:13 AM] Found 0 errors. Watching for file changes. @@ -405,25 +357,6 @@ Input:: //// [/user/username/projects/noEmitOnError/src/main.ts] file written with same contents Output:: ->> Screen clear -[12:01:21 AM] File change detected. Starting incremental compilation... - -[12:01:22 AM] Found 0 errors. Watching for file changes. - - - -Program root files: ["/user/username/projects/noEmitOnError/shared/types/db.ts","/user/username/projects/noEmitOnError/src/main.ts","/user/username/projects/noEmitOnError/src/other.ts"] -Program options: {"outDir":"/user/username/projects/noEmitOnError/dev-build","noEmitOnError":true,"watch":true,"assumeChangesOnlyAffectDirectDependencies":true,"configFilePath":"/user/username/projects/noEmitOnError/tsconfig.json"} -Program structureReused: Completely -Program files:: -/a/lib/lib.d.ts -/user/username/projects/noEmitOnError/shared/types/db.ts -/user/username/projects/noEmitOnError/src/main.ts -/user/username/projects/noEmitOnError/src/other.ts - -Semantic diagnostics in builder refreshed for:: - -No shapes updated in the builder:: PolledWatches:: /user/username/projects/noemitonerror/node_modules/@types: diff --git a/tests/baselines/reference/tscWatch/emitAndErrorUpdates/assumeChangesOnlyAffectDirectDependenciesAndD/with-noEmitOnError-with-incremental.js b/tests/baselines/reference/tscWatch/emitAndErrorUpdates/assumeChangesOnlyAffectDirectDependenciesAndD/with-noEmitOnError-with-incremental.js index 2bdcb7d486e40..6dffbf57945c8 100644 --- a/tests/baselines/reference/tscWatch/emitAndErrorUpdates/assumeChangesOnlyAffectDirectDependenciesAndD/with-noEmitOnError-with-incremental.js +++ b/tests/baselines/reference/tscWatch/emitAndErrorUpdates/assumeChangesOnlyAffectDirectDependenciesAndD/with-noEmitOnError-with-incremental.js @@ -180,30 +180,6 @@ Input:: //// [/user/username/projects/noEmitOnError/src/main.ts] file written with same contents Output:: ->> Screen clear -[12:00:43 AM] File change detected. Starting incremental compilation... - -src/main.ts:4:1 - error TS1005: ',' expected. - -4 ; -  ~ - -[12:00:44 AM] Found 1 error. Watching for file changes. - - - -Program root files: ["/user/username/projects/noEmitOnError/shared/types/db.ts","/user/username/projects/noEmitOnError/src/main.ts","/user/username/projects/noEmitOnError/src/other.ts"] -Program options: {"outDir":"/user/username/projects/noEmitOnError/dev-build","noEmitOnError":true,"watch":true,"assumeChangesOnlyAffectDirectDependencies":true,"declaration":true,"incremental":true,"configFilePath":"/user/username/projects/noEmitOnError/tsconfig.json"} -Program structureReused: Completely -Program files:: -/a/lib/lib.d.ts -/user/username/projects/noEmitOnError/shared/types/db.ts -/user/username/projects/noEmitOnError/src/main.ts -/user/username/projects/noEmitOnError/src/other.ts - -Semantic diagnostics in builder refreshed for:: - -No shapes updated in the builder:: PolledWatches:: /user/username/projects/noemitonerror/node_modules/@types: @@ -240,9 +216,9 @@ const a = { Output:: >> Screen clear -[12:00:48 AM] File change detected. Starting incremental compilation... +[12:00:46 AM] File change detected. Starting incremental compilation... -[12:01:12 AM] Found 0 errors. Watching for file changes. +[12:01:10 AM] Found 0 errors. Watching for file changes. @@ -386,14 +362,14 @@ const a: string = 10; Output:: >> Screen clear -[12:01:19 AM] File change detected. Starting incremental compilation... +[12:01:17 AM] File change detected. Starting incremental compilation... src/main.ts:2:7 - error TS2322: Type 'number' is not assignable to type 'string'. 2 const a: string = 10;    ~ -[12:01:23 AM] Found 1 error. Watching for file changes. +[12:01:21 AM] Found 1 error. Watching for file changes. @@ -518,30 +494,6 @@ Input:: //// [/user/username/projects/noEmitOnError/src/main.ts] file written with same contents Output:: ->> Screen clear -[12:01:31 AM] File change detected. Starting incremental compilation... - -src/main.ts:2:7 - error TS2322: Type 'number' is not assignable to type 'string'. - -2 const a: string = 10; -   ~ - -[12:01:32 AM] Found 1 error. Watching for file changes. - - - -Program root files: ["/user/username/projects/noEmitOnError/shared/types/db.ts","/user/username/projects/noEmitOnError/src/main.ts","/user/username/projects/noEmitOnError/src/other.ts"] -Program options: {"outDir":"/user/username/projects/noEmitOnError/dev-build","noEmitOnError":true,"watch":true,"assumeChangesOnlyAffectDirectDependencies":true,"declaration":true,"incremental":true,"configFilePath":"/user/username/projects/noEmitOnError/tsconfig.json"} -Program structureReused: Completely -Program files:: -/a/lib/lib.d.ts -/user/username/projects/noEmitOnError/shared/types/db.ts -/user/username/projects/noEmitOnError/src/main.ts -/user/username/projects/noEmitOnError/src/other.ts - -Semantic diagnostics in builder refreshed for:: - -No shapes updated in the builder:: PolledWatches:: /user/username/projects/noemitonerror/node_modules/@types: @@ -576,9 +528,9 @@ const a: string = "hello"; Output:: >> Screen clear -[12:01:36 AM] File change detected. Starting incremental compilation... +[12:01:32 AM] File change detected. Starting incremental compilation... -[12:01:46 AM] Found 0 errors. Watching for file changes. +[12:01:42 AM] Found 0 errors. Watching for file changes. @@ -692,25 +644,6 @@ Input:: //// [/user/username/projects/noEmitOnError/src/main.ts] file written with same contents Output:: ->> Screen clear -[12:01:53 AM] File change detected. Starting incremental compilation... - -[12:01:54 AM] Found 0 errors. Watching for file changes. - - - -Program root files: ["/user/username/projects/noEmitOnError/shared/types/db.ts","/user/username/projects/noEmitOnError/src/main.ts","/user/username/projects/noEmitOnError/src/other.ts"] -Program options: {"outDir":"/user/username/projects/noEmitOnError/dev-build","noEmitOnError":true,"watch":true,"assumeChangesOnlyAffectDirectDependencies":true,"declaration":true,"incremental":true,"configFilePath":"/user/username/projects/noEmitOnError/tsconfig.json"} -Program structureReused: Completely -Program files:: -/a/lib/lib.d.ts -/user/username/projects/noEmitOnError/shared/types/db.ts -/user/username/projects/noEmitOnError/src/main.ts -/user/username/projects/noEmitOnError/src/other.ts - -Semantic diagnostics in builder refreshed for:: - -No shapes updated in the builder:: PolledWatches:: /user/username/projects/noemitonerror/node_modules/@types: diff --git a/tests/baselines/reference/tscWatch/emitAndErrorUpdates/assumeChangesOnlyAffectDirectDependenciesAndD/with-noEmitOnError.js b/tests/baselines/reference/tscWatch/emitAndErrorUpdates/assumeChangesOnlyAffectDirectDependenciesAndD/with-noEmitOnError.js index 2bda15b03c628..082ae16309b37 100644 --- a/tests/baselines/reference/tscWatch/emitAndErrorUpdates/assumeChangesOnlyAffectDirectDependenciesAndD/with-noEmitOnError.js +++ b/tests/baselines/reference/tscWatch/emitAndErrorUpdates/assumeChangesOnlyAffectDirectDependenciesAndD/with-noEmitOnError.js @@ -103,30 +103,6 @@ Input:: //// [/user/username/projects/noEmitOnError/src/main.ts] file written with same contents Output:: ->> Screen clear -[12:00:36 AM] File change detected. Starting incremental compilation... - -src/main.ts:4:1 - error TS1005: ',' expected. - -4 ; -  ~ - -[12:00:37 AM] Found 1 error. Watching for file changes. - - - -Program root files: ["/user/username/projects/noEmitOnError/shared/types/db.ts","/user/username/projects/noEmitOnError/src/main.ts","/user/username/projects/noEmitOnError/src/other.ts"] -Program options: {"outDir":"/user/username/projects/noEmitOnError/dev-build","noEmitOnError":true,"watch":true,"assumeChangesOnlyAffectDirectDependencies":true,"declaration":true,"configFilePath":"/user/username/projects/noEmitOnError/tsconfig.json"} -Program structureReused: Completely -Program files:: -/a/lib/lib.d.ts -/user/username/projects/noEmitOnError/shared/types/db.ts -/user/username/projects/noEmitOnError/src/main.ts -/user/username/projects/noEmitOnError/src/other.ts - -Semantic diagnostics in builder refreshed for:: - -No shapes updated in the builder:: PolledWatches:: /user/username/projects/noemitonerror/node_modules/@types: @@ -163,9 +139,9 @@ const a = { Output:: >> Screen clear -[12:00:41 AM] File change detected. Starting incremental compilation... +[12:00:39 AM] File change detected. Starting incremental compilation... -[12:01:04 AM] Found 0 errors. Watching for file changes. +[12:01:02 AM] Found 0 errors. Watching for file changes. @@ -250,14 +226,14 @@ const a: string = 10; Output:: >> Screen clear -[12:01:08 AM] File change detected. Starting incremental compilation... +[12:01:06 AM] File change detected. Starting incremental compilation... src/main.ts:2:7 - error TS2322: Type 'number' is not assignable to type 'string'. 2 const a: string = 10;    ~ -[12:01:09 AM] Found 1 error. Watching for file changes. +[12:01:07 AM] Found 1 error. Watching for file changes. @@ -305,30 +281,6 @@ Input:: //// [/user/username/projects/noEmitOnError/src/main.ts] file written with same contents Output:: ->> Screen clear -[12:01:14 AM] File change detected. Starting incremental compilation... - -src/main.ts:2:7 - error TS2322: Type 'number' is not assignable to type 'string'. - -2 const a: string = 10; -   ~ - -[12:01:15 AM] Found 1 error. Watching for file changes. - - - -Program root files: ["/user/username/projects/noEmitOnError/shared/types/db.ts","/user/username/projects/noEmitOnError/src/main.ts","/user/username/projects/noEmitOnError/src/other.ts"] -Program options: {"outDir":"/user/username/projects/noEmitOnError/dev-build","noEmitOnError":true,"watch":true,"assumeChangesOnlyAffectDirectDependencies":true,"declaration":true,"configFilePath":"/user/username/projects/noEmitOnError/tsconfig.json"} -Program structureReused: Completely -Program files:: -/a/lib/lib.d.ts -/user/username/projects/noEmitOnError/shared/types/db.ts -/user/username/projects/noEmitOnError/src/main.ts -/user/username/projects/noEmitOnError/src/other.ts - -Semantic diagnostics in builder refreshed for:: - -No shapes updated in the builder:: PolledWatches:: /user/username/projects/noemitonerror/node_modules/@types: @@ -363,9 +315,9 @@ const a: string = "hello"; Output:: >> Screen clear -[12:01:19 AM] File change detected. Starting incremental compilation... +[12:01:15 AM] File change detected. Starting incremental compilation... -[12:01:26 AM] Found 0 errors. Watching for file changes. +[12:01:22 AM] Found 0 errors. Watching for file changes. @@ -420,25 +372,6 @@ Input:: //// [/user/username/projects/noEmitOnError/src/main.ts] file written with same contents Output:: ->> Screen clear -[12:01:30 AM] File change detected. Starting incremental compilation... - -[12:01:31 AM] Found 0 errors. Watching for file changes. - - - -Program root files: ["/user/username/projects/noEmitOnError/shared/types/db.ts","/user/username/projects/noEmitOnError/src/main.ts","/user/username/projects/noEmitOnError/src/other.ts"] -Program options: {"outDir":"/user/username/projects/noEmitOnError/dev-build","noEmitOnError":true,"watch":true,"assumeChangesOnlyAffectDirectDependencies":true,"declaration":true,"configFilePath":"/user/username/projects/noEmitOnError/tsconfig.json"} -Program structureReused: Completely -Program files:: -/a/lib/lib.d.ts -/user/username/projects/noEmitOnError/shared/types/db.ts -/user/username/projects/noEmitOnError/src/main.ts -/user/username/projects/noEmitOnError/src/other.ts - -Semantic diagnostics in builder refreshed for:: - -No shapes updated in the builder:: PolledWatches:: /user/username/projects/noemitonerror/node_modules/@types: diff --git a/tests/baselines/reference/tscWatch/emitAndErrorUpdates/default/with-noEmitOnError-with-incremental.js b/tests/baselines/reference/tscWatch/emitAndErrorUpdates/default/with-noEmitOnError-with-incremental.js index b26fe57c145e6..f94f56fdda486 100644 --- a/tests/baselines/reference/tscWatch/emitAndErrorUpdates/default/with-noEmitOnError-with-incremental.js +++ b/tests/baselines/reference/tscWatch/emitAndErrorUpdates/default/with-noEmitOnError-with-incremental.js @@ -178,30 +178,6 @@ Input:: //// [/user/username/projects/noEmitOnError/src/main.ts] file written with same contents Output:: ->> Screen clear -[12:00:43 AM] File change detected. Starting incremental compilation... - -src/main.ts:4:1 - error TS1005: ',' expected. - -4 ; -  ~ - -[12:00:44 AM] Found 1 error. Watching for file changes. - - - -Program root files: ["/user/username/projects/noEmitOnError/shared/types/db.ts","/user/username/projects/noEmitOnError/src/main.ts","/user/username/projects/noEmitOnError/src/other.ts"] -Program options: {"outDir":"/user/username/projects/noEmitOnError/dev-build","noEmitOnError":true,"watch":true,"incremental":true,"configFilePath":"/user/username/projects/noEmitOnError/tsconfig.json"} -Program structureReused: Completely -Program files:: -/a/lib/lib.d.ts -/user/username/projects/noEmitOnError/shared/types/db.ts -/user/username/projects/noEmitOnError/src/main.ts -/user/username/projects/noEmitOnError/src/other.ts - -Semantic diagnostics in builder refreshed for:: - -No shapes updated in the builder:: PolledWatches:: /user/username/projects/noemitonerror/node_modules/@types: @@ -238,9 +214,9 @@ const a = { Output:: >> Screen clear -[12:00:48 AM] File change detected. Starting incremental compilation... +[12:00:46 AM] File change detected. Starting incremental compilation... -[12:01:06 AM] Found 0 errors. Watching for file changes. +[12:01:04 AM] Found 0 errors. Watching for file changes. @@ -368,14 +344,14 @@ const a: string = 10; Output:: >> Screen clear -[12:01:13 AM] File change detected. Starting incremental compilation... +[12:01:11 AM] File change detected. Starting incremental compilation... src/main.ts:2:7 - error TS2322: Type 'number' is not assignable to type 'string'. 2 const a: string = 10;    ~ -[12:01:17 AM] Found 1 error. Watching for file changes. +[12:01:15 AM] Found 1 error. Watching for file changes. @@ -498,30 +474,6 @@ Input:: //// [/user/username/projects/noEmitOnError/src/main.ts] file written with same contents Output:: ->> Screen clear -[12:01:25 AM] File change detected. Starting incremental compilation... - -src/main.ts:2:7 - error TS2322: Type 'number' is not assignable to type 'string'. - -2 const a: string = 10; -   ~ - -[12:01:26 AM] Found 1 error. Watching for file changes. - - - -Program root files: ["/user/username/projects/noEmitOnError/shared/types/db.ts","/user/username/projects/noEmitOnError/src/main.ts","/user/username/projects/noEmitOnError/src/other.ts"] -Program options: {"outDir":"/user/username/projects/noEmitOnError/dev-build","noEmitOnError":true,"watch":true,"incremental":true,"configFilePath":"/user/username/projects/noEmitOnError/tsconfig.json"} -Program structureReused: Completely -Program files:: -/a/lib/lib.d.ts -/user/username/projects/noEmitOnError/shared/types/db.ts -/user/username/projects/noEmitOnError/src/main.ts -/user/username/projects/noEmitOnError/src/other.ts - -Semantic diagnostics in builder refreshed for:: - -No shapes updated in the builder:: PolledWatches:: /user/username/projects/noemitonerror/node_modules/@types: @@ -556,9 +508,9 @@ const a: string = "hello"; Output:: >> Screen clear -[12:01:30 AM] File change detected. Starting incremental compilation... +[12:01:26 AM] File change detected. Starting incremental compilation... -[12:01:37 AM] Found 0 errors. Watching for file changes. +[12:01:33 AM] Found 0 errors. Watching for file changes. @@ -669,25 +621,6 @@ Input:: //// [/user/username/projects/noEmitOnError/src/main.ts] file written with same contents Output:: ->> Screen clear -[12:01:44 AM] File change detected. Starting incremental compilation... - -[12:01:45 AM] Found 0 errors. Watching for file changes. - - - -Program root files: ["/user/username/projects/noEmitOnError/shared/types/db.ts","/user/username/projects/noEmitOnError/src/main.ts","/user/username/projects/noEmitOnError/src/other.ts"] -Program options: {"outDir":"/user/username/projects/noEmitOnError/dev-build","noEmitOnError":true,"watch":true,"incremental":true,"configFilePath":"/user/username/projects/noEmitOnError/tsconfig.json"} -Program structureReused: Completely -Program files:: -/a/lib/lib.d.ts -/user/username/projects/noEmitOnError/shared/types/db.ts -/user/username/projects/noEmitOnError/src/main.ts -/user/username/projects/noEmitOnError/src/other.ts - -Semantic diagnostics in builder refreshed for:: - -No shapes updated in the builder:: PolledWatches:: /user/username/projects/noemitonerror/node_modules/@types: diff --git a/tests/baselines/reference/tscWatch/emitAndErrorUpdates/default/with-noEmitOnError.js b/tests/baselines/reference/tscWatch/emitAndErrorUpdates/default/with-noEmitOnError.js index 483578915d3a3..fc110fc3d1045 100644 --- a/tests/baselines/reference/tscWatch/emitAndErrorUpdates/default/with-noEmitOnError.js +++ b/tests/baselines/reference/tscWatch/emitAndErrorUpdates/default/with-noEmitOnError.js @@ -103,30 +103,6 @@ Input:: //// [/user/username/projects/noEmitOnError/src/main.ts] file written with same contents Output:: ->> Screen clear -[12:00:36 AM] File change detected. Starting incremental compilation... - -src/main.ts:4:1 - error TS1005: ',' expected. - -4 ; -  ~ - -[12:00:37 AM] Found 1 error. Watching for file changes. - - - -Program root files: ["/user/username/projects/noEmitOnError/shared/types/db.ts","/user/username/projects/noEmitOnError/src/main.ts","/user/username/projects/noEmitOnError/src/other.ts"] -Program options: {"outDir":"/user/username/projects/noEmitOnError/dev-build","noEmitOnError":true,"watch":true,"configFilePath":"/user/username/projects/noEmitOnError/tsconfig.json"} -Program structureReused: Completely -Program files:: -/a/lib/lib.d.ts -/user/username/projects/noEmitOnError/shared/types/db.ts -/user/username/projects/noEmitOnError/src/main.ts -/user/username/projects/noEmitOnError/src/other.ts - -Semantic diagnostics in builder refreshed for:: - -No shapes updated in the builder:: PolledWatches:: /user/username/projects/noemitonerror/node_modules/@types: @@ -163,9 +139,9 @@ const a = { Output:: >> Screen clear -[12:00:41 AM] File change detected. Starting incremental compilation... +[12:00:39 AM] File change detected. Starting incremental compilation... -[12:00:58 AM] Found 0 errors. Watching for file changes. +[12:00:56 AM] Found 0 errors. Watching for file changes. @@ -236,14 +212,14 @@ const a: string = 10; Output:: >> Screen clear -[12:01:02 AM] File change detected. Starting incremental compilation... +[12:01:00 AM] File change detected. Starting incremental compilation... src/main.ts:2:7 - error TS2322: Type 'number' is not assignable to type 'string'. 2 const a: string = 10;    ~ -[12:01:03 AM] Found 1 error. Watching for file changes. +[12:01:01 AM] Found 1 error. Watching for file changes. @@ -291,30 +267,6 @@ Input:: //// [/user/username/projects/noEmitOnError/src/main.ts] file written with same contents Output:: ->> Screen clear -[12:01:08 AM] File change detected. Starting incremental compilation... - -src/main.ts:2:7 - error TS2322: Type 'number' is not assignable to type 'string'. - -2 const a: string = 10; -   ~ - -[12:01:09 AM] Found 1 error. Watching for file changes. - - - -Program root files: ["/user/username/projects/noEmitOnError/shared/types/db.ts","/user/username/projects/noEmitOnError/src/main.ts","/user/username/projects/noEmitOnError/src/other.ts"] -Program options: {"outDir":"/user/username/projects/noEmitOnError/dev-build","noEmitOnError":true,"watch":true,"configFilePath":"/user/username/projects/noEmitOnError/tsconfig.json"} -Program structureReused: Completely -Program files:: -/a/lib/lib.d.ts -/user/username/projects/noEmitOnError/shared/types/db.ts -/user/username/projects/noEmitOnError/src/main.ts -/user/username/projects/noEmitOnError/src/other.ts - -Semantic diagnostics in builder refreshed for:: - -No shapes updated in the builder:: PolledWatches:: /user/username/projects/noemitonerror/node_modules/@types: @@ -349,9 +301,9 @@ const a: string = "hello"; Output:: >> Screen clear -[12:01:13 AM] File change detected. Starting incremental compilation... +[12:01:09 AM] File change detected. Starting incremental compilation... -[12:01:17 AM] Found 0 errors. Watching for file changes. +[12:01:13 AM] Found 0 errors. Watching for file changes. @@ -405,25 +357,6 @@ Input:: //// [/user/username/projects/noEmitOnError/src/main.ts] file written with same contents Output:: ->> Screen clear -[12:01:21 AM] File change detected. Starting incremental compilation... - -[12:01:22 AM] Found 0 errors. Watching for file changes. - - - -Program root files: ["/user/username/projects/noEmitOnError/shared/types/db.ts","/user/username/projects/noEmitOnError/src/main.ts","/user/username/projects/noEmitOnError/src/other.ts"] -Program options: {"outDir":"/user/username/projects/noEmitOnError/dev-build","noEmitOnError":true,"watch":true,"configFilePath":"/user/username/projects/noEmitOnError/tsconfig.json"} -Program structureReused: Completely -Program files:: -/a/lib/lib.d.ts -/user/username/projects/noEmitOnError/shared/types/db.ts -/user/username/projects/noEmitOnError/src/main.ts -/user/username/projects/noEmitOnError/src/other.ts - -Semantic diagnostics in builder refreshed for:: - -No shapes updated in the builder:: PolledWatches:: /user/username/projects/noemitonerror/node_modules/@types: diff --git a/tests/baselines/reference/tscWatch/emitAndErrorUpdates/defaultAndD/with-noEmitOnError-with-incremental.js b/tests/baselines/reference/tscWatch/emitAndErrorUpdates/defaultAndD/with-noEmitOnError-with-incremental.js index f3f271e408e65..21626d15930f6 100644 --- a/tests/baselines/reference/tscWatch/emitAndErrorUpdates/defaultAndD/with-noEmitOnError-with-incremental.js +++ b/tests/baselines/reference/tscWatch/emitAndErrorUpdates/defaultAndD/with-noEmitOnError-with-incremental.js @@ -179,30 +179,6 @@ Input:: //// [/user/username/projects/noEmitOnError/src/main.ts] file written with same contents Output:: ->> Screen clear -[12:00:43 AM] File change detected. Starting incremental compilation... - -src/main.ts:4:1 - error TS1005: ',' expected. - -4 ; -  ~ - -[12:00:44 AM] Found 1 error. Watching for file changes. - - - -Program root files: ["/user/username/projects/noEmitOnError/shared/types/db.ts","/user/username/projects/noEmitOnError/src/main.ts","/user/username/projects/noEmitOnError/src/other.ts"] -Program options: {"outDir":"/user/username/projects/noEmitOnError/dev-build","noEmitOnError":true,"watch":true,"declaration":true,"incremental":true,"configFilePath":"/user/username/projects/noEmitOnError/tsconfig.json"} -Program structureReused: Completely -Program files:: -/a/lib/lib.d.ts -/user/username/projects/noEmitOnError/shared/types/db.ts -/user/username/projects/noEmitOnError/src/main.ts -/user/username/projects/noEmitOnError/src/other.ts - -Semantic diagnostics in builder refreshed for:: - -No shapes updated in the builder:: PolledWatches:: /user/username/projects/noemitonerror/node_modules/@types: @@ -239,9 +215,9 @@ const a = { Output:: >> Screen clear -[12:00:48 AM] File change detected. Starting incremental compilation... +[12:00:46 AM] File change detected. Starting incremental compilation... -[12:01:12 AM] Found 0 errors. Watching for file changes. +[12:01:10 AM] Found 0 errors. Watching for file changes. @@ -384,14 +360,14 @@ const a: string = 10; Output:: >> Screen clear -[12:01:19 AM] File change detected. Starting incremental compilation... +[12:01:17 AM] File change detected. Starting incremental compilation... src/main.ts:2:7 - error TS2322: Type 'number' is not assignable to type 'string'. 2 const a: string = 10;    ~ -[12:01:23 AM] Found 1 error. Watching for file changes. +[12:01:21 AM] Found 1 error. Watching for file changes. @@ -515,30 +491,6 @@ Input:: //// [/user/username/projects/noEmitOnError/src/main.ts] file written with same contents Output:: ->> Screen clear -[12:01:31 AM] File change detected. Starting incremental compilation... - -src/main.ts:2:7 - error TS2322: Type 'number' is not assignable to type 'string'. - -2 const a: string = 10; -   ~ - -[12:01:32 AM] Found 1 error. Watching for file changes. - - - -Program root files: ["/user/username/projects/noEmitOnError/shared/types/db.ts","/user/username/projects/noEmitOnError/src/main.ts","/user/username/projects/noEmitOnError/src/other.ts"] -Program options: {"outDir":"/user/username/projects/noEmitOnError/dev-build","noEmitOnError":true,"watch":true,"declaration":true,"incremental":true,"configFilePath":"/user/username/projects/noEmitOnError/tsconfig.json"} -Program structureReused: Completely -Program files:: -/a/lib/lib.d.ts -/user/username/projects/noEmitOnError/shared/types/db.ts -/user/username/projects/noEmitOnError/src/main.ts -/user/username/projects/noEmitOnError/src/other.ts - -Semantic diagnostics in builder refreshed for:: - -No shapes updated in the builder:: PolledWatches:: /user/username/projects/noemitonerror/node_modules/@types: @@ -573,9 +525,9 @@ const a: string = "hello"; Output:: >> Screen clear -[12:01:36 AM] File change detected. Starting incremental compilation... +[12:01:32 AM] File change detected. Starting incremental compilation... -[12:01:46 AM] Found 0 errors. Watching for file changes. +[12:01:42 AM] Found 0 errors. Watching for file changes. @@ -688,25 +640,6 @@ Input:: //// [/user/username/projects/noEmitOnError/src/main.ts] file written with same contents Output:: ->> Screen clear -[12:01:53 AM] File change detected. Starting incremental compilation... - -[12:01:54 AM] Found 0 errors. Watching for file changes. - - - -Program root files: ["/user/username/projects/noEmitOnError/shared/types/db.ts","/user/username/projects/noEmitOnError/src/main.ts","/user/username/projects/noEmitOnError/src/other.ts"] -Program options: {"outDir":"/user/username/projects/noEmitOnError/dev-build","noEmitOnError":true,"watch":true,"declaration":true,"incremental":true,"configFilePath":"/user/username/projects/noEmitOnError/tsconfig.json"} -Program structureReused: Completely -Program files:: -/a/lib/lib.d.ts -/user/username/projects/noEmitOnError/shared/types/db.ts -/user/username/projects/noEmitOnError/src/main.ts -/user/username/projects/noEmitOnError/src/other.ts - -Semantic diagnostics in builder refreshed for:: - -No shapes updated in the builder:: PolledWatches:: /user/username/projects/noemitonerror/node_modules/@types: diff --git a/tests/baselines/reference/tscWatch/emitAndErrorUpdates/defaultAndD/with-noEmitOnError.js b/tests/baselines/reference/tscWatch/emitAndErrorUpdates/defaultAndD/with-noEmitOnError.js index b33198034eaf9..ca4884cd960dd 100644 --- a/tests/baselines/reference/tscWatch/emitAndErrorUpdates/defaultAndD/with-noEmitOnError.js +++ b/tests/baselines/reference/tscWatch/emitAndErrorUpdates/defaultAndD/with-noEmitOnError.js @@ -103,30 +103,6 @@ Input:: //// [/user/username/projects/noEmitOnError/src/main.ts] file written with same contents Output:: ->> Screen clear -[12:00:36 AM] File change detected. Starting incremental compilation... - -src/main.ts:4:1 - error TS1005: ',' expected. - -4 ; -  ~ - -[12:00:37 AM] Found 1 error. Watching for file changes. - - - -Program root files: ["/user/username/projects/noEmitOnError/shared/types/db.ts","/user/username/projects/noEmitOnError/src/main.ts","/user/username/projects/noEmitOnError/src/other.ts"] -Program options: {"outDir":"/user/username/projects/noEmitOnError/dev-build","noEmitOnError":true,"watch":true,"declaration":true,"configFilePath":"/user/username/projects/noEmitOnError/tsconfig.json"} -Program structureReused: Completely -Program files:: -/a/lib/lib.d.ts -/user/username/projects/noEmitOnError/shared/types/db.ts -/user/username/projects/noEmitOnError/src/main.ts -/user/username/projects/noEmitOnError/src/other.ts - -Semantic diagnostics in builder refreshed for:: - -No shapes updated in the builder:: PolledWatches:: /user/username/projects/noemitonerror/node_modules/@types: @@ -163,9 +139,9 @@ const a = { Output:: >> Screen clear -[12:00:41 AM] File change detected. Starting incremental compilation... +[12:00:39 AM] File change detected. Starting incremental compilation... -[12:01:04 AM] Found 0 errors. Watching for file changes. +[12:01:02 AM] Found 0 errors. Watching for file changes. @@ -250,14 +226,14 @@ const a: string = 10; Output:: >> Screen clear -[12:01:08 AM] File change detected. Starting incremental compilation... +[12:01:06 AM] File change detected. Starting incremental compilation... src/main.ts:2:7 - error TS2322: Type 'number' is not assignable to type 'string'. 2 const a: string = 10;    ~ -[12:01:09 AM] Found 1 error. Watching for file changes. +[12:01:07 AM] Found 1 error. Watching for file changes. @@ -305,30 +281,6 @@ Input:: //// [/user/username/projects/noEmitOnError/src/main.ts] file written with same contents Output:: ->> Screen clear -[12:01:14 AM] File change detected. Starting incremental compilation... - -src/main.ts:2:7 - error TS2322: Type 'number' is not assignable to type 'string'. - -2 const a: string = 10; -   ~ - -[12:01:15 AM] Found 1 error. Watching for file changes. - - - -Program root files: ["/user/username/projects/noEmitOnError/shared/types/db.ts","/user/username/projects/noEmitOnError/src/main.ts","/user/username/projects/noEmitOnError/src/other.ts"] -Program options: {"outDir":"/user/username/projects/noEmitOnError/dev-build","noEmitOnError":true,"watch":true,"declaration":true,"configFilePath":"/user/username/projects/noEmitOnError/tsconfig.json"} -Program structureReused: Completely -Program files:: -/a/lib/lib.d.ts -/user/username/projects/noEmitOnError/shared/types/db.ts -/user/username/projects/noEmitOnError/src/main.ts -/user/username/projects/noEmitOnError/src/other.ts - -Semantic diagnostics in builder refreshed for:: - -No shapes updated in the builder:: PolledWatches:: /user/username/projects/noemitonerror/node_modules/@types: @@ -363,9 +315,9 @@ const a: string = "hello"; Output:: >> Screen clear -[12:01:19 AM] File change detected. Starting incremental compilation... +[12:01:15 AM] File change detected. Starting incremental compilation... -[12:01:26 AM] Found 0 errors. Watching for file changes. +[12:01:22 AM] Found 0 errors. Watching for file changes. @@ -420,25 +372,6 @@ Input:: //// [/user/username/projects/noEmitOnError/src/main.ts] file written with same contents Output:: ->> Screen clear -[12:01:30 AM] File change detected. Starting incremental compilation... - -[12:01:31 AM] Found 0 errors. Watching for file changes. - - - -Program root files: ["/user/username/projects/noEmitOnError/shared/types/db.ts","/user/username/projects/noEmitOnError/src/main.ts","/user/username/projects/noEmitOnError/src/other.ts"] -Program options: {"outDir":"/user/username/projects/noEmitOnError/dev-build","noEmitOnError":true,"watch":true,"declaration":true,"configFilePath":"/user/username/projects/noEmitOnError/tsconfig.json"} -Program structureReused: Completely -Program files:: -/a/lib/lib.d.ts -/user/username/projects/noEmitOnError/shared/types/db.ts -/user/username/projects/noEmitOnError/src/main.ts -/user/username/projects/noEmitOnError/src/other.ts - -Semantic diagnostics in builder refreshed for:: - -No shapes updated in the builder:: PolledWatches:: /user/username/projects/noemitonerror/node_modules/@types: diff --git a/tests/baselines/reference/tscWatch/emitAndErrorUpdates/isolatedModules/with-noEmitOnError-with-incremental.js b/tests/baselines/reference/tscWatch/emitAndErrorUpdates/isolatedModules/with-noEmitOnError-with-incremental.js index 173cad06584a6..270276068d948 100644 --- a/tests/baselines/reference/tscWatch/emitAndErrorUpdates/isolatedModules/with-noEmitOnError-with-incremental.js +++ b/tests/baselines/reference/tscWatch/emitAndErrorUpdates/isolatedModules/with-noEmitOnError-with-incremental.js @@ -178,30 +178,6 @@ Input:: //// [/user/username/projects/noEmitOnError/src/main.ts] file written with same contents Output:: ->> Screen clear -[12:00:43 AM] File change detected. Starting incremental compilation... - -src/main.ts:4:1 - error TS1005: ',' expected. - -4 ; -  ~ - -[12:00:44 AM] Found 1 error. Watching for file changes. - - - -Program root files: ["/user/username/projects/noEmitOnError/shared/types/db.ts","/user/username/projects/noEmitOnError/src/main.ts","/user/username/projects/noEmitOnError/src/other.ts"] -Program options: {"outDir":"/user/username/projects/noEmitOnError/dev-build","noEmitOnError":true,"watch":true,"isolatedModules":true,"incremental":true,"configFilePath":"/user/username/projects/noEmitOnError/tsconfig.json"} -Program structureReused: Completely -Program files:: -/a/lib/lib.d.ts -/user/username/projects/noEmitOnError/shared/types/db.ts -/user/username/projects/noEmitOnError/src/main.ts -/user/username/projects/noEmitOnError/src/other.ts - -Semantic diagnostics in builder refreshed for:: - -No shapes updated in the builder:: PolledWatches:: /user/username/projects/noemitonerror/node_modules/@types: @@ -238,9 +214,9 @@ const a = { Output:: >> Screen clear -[12:00:48 AM] File change detected. Starting incremental compilation... +[12:00:46 AM] File change detected. Starting incremental compilation... -[12:01:06 AM] Found 0 errors. Watching for file changes. +[12:01:04 AM] Found 0 errors. Watching for file changes. @@ -368,14 +344,14 @@ const a: string = 10; Output:: >> Screen clear -[12:01:13 AM] File change detected. Starting incremental compilation... +[12:01:11 AM] File change detected. Starting incremental compilation... src/main.ts:2:7 - error TS2322: Type 'number' is not assignable to type 'string'. 2 const a: string = 10;    ~ -[12:01:17 AM] Found 1 error. Watching for file changes. +[12:01:15 AM] Found 1 error. Watching for file changes. @@ -498,30 +474,6 @@ Input:: //// [/user/username/projects/noEmitOnError/src/main.ts] file written with same contents Output:: ->> Screen clear -[12:01:25 AM] File change detected. Starting incremental compilation... - -src/main.ts:2:7 - error TS2322: Type 'number' is not assignable to type 'string'. - -2 const a: string = 10; -   ~ - -[12:01:26 AM] Found 1 error. Watching for file changes. - - - -Program root files: ["/user/username/projects/noEmitOnError/shared/types/db.ts","/user/username/projects/noEmitOnError/src/main.ts","/user/username/projects/noEmitOnError/src/other.ts"] -Program options: {"outDir":"/user/username/projects/noEmitOnError/dev-build","noEmitOnError":true,"watch":true,"isolatedModules":true,"incremental":true,"configFilePath":"/user/username/projects/noEmitOnError/tsconfig.json"} -Program structureReused: Completely -Program files:: -/a/lib/lib.d.ts -/user/username/projects/noEmitOnError/shared/types/db.ts -/user/username/projects/noEmitOnError/src/main.ts -/user/username/projects/noEmitOnError/src/other.ts - -Semantic diagnostics in builder refreshed for:: - -No shapes updated in the builder:: PolledWatches:: /user/username/projects/noemitonerror/node_modules/@types: @@ -556,9 +508,9 @@ const a: string = "hello"; Output:: >> Screen clear -[12:01:30 AM] File change detected. Starting incremental compilation... +[12:01:26 AM] File change detected. Starting incremental compilation... -[12:01:37 AM] Found 0 errors. Watching for file changes. +[12:01:33 AM] Found 0 errors. Watching for file changes. @@ -669,25 +621,6 @@ Input:: //// [/user/username/projects/noEmitOnError/src/main.ts] file written with same contents Output:: ->> Screen clear -[12:01:44 AM] File change detected. Starting incremental compilation... - -[12:01:45 AM] Found 0 errors. Watching for file changes. - - - -Program root files: ["/user/username/projects/noEmitOnError/shared/types/db.ts","/user/username/projects/noEmitOnError/src/main.ts","/user/username/projects/noEmitOnError/src/other.ts"] -Program options: {"outDir":"/user/username/projects/noEmitOnError/dev-build","noEmitOnError":true,"watch":true,"isolatedModules":true,"incremental":true,"configFilePath":"/user/username/projects/noEmitOnError/tsconfig.json"} -Program structureReused: Completely -Program files:: -/a/lib/lib.d.ts -/user/username/projects/noEmitOnError/shared/types/db.ts -/user/username/projects/noEmitOnError/src/main.ts -/user/username/projects/noEmitOnError/src/other.ts - -Semantic diagnostics in builder refreshed for:: - -No shapes updated in the builder:: PolledWatches:: /user/username/projects/noemitonerror/node_modules/@types: diff --git a/tests/baselines/reference/tscWatch/emitAndErrorUpdates/isolatedModules/with-noEmitOnError.js b/tests/baselines/reference/tscWatch/emitAndErrorUpdates/isolatedModules/with-noEmitOnError.js index 0b5a5d297e865..cad0db6e3253c 100644 --- a/tests/baselines/reference/tscWatch/emitAndErrorUpdates/isolatedModules/with-noEmitOnError.js +++ b/tests/baselines/reference/tscWatch/emitAndErrorUpdates/isolatedModules/with-noEmitOnError.js @@ -103,30 +103,6 @@ Input:: //// [/user/username/projects/noEmitOnError/src/main.ts] file written with same contents Output:: ->> Screen clear -[12:00:36 AM] File change detected. Starting incremental compilation... - -src/main.ts:4:1 - error TS1005: ',' expected. - -4 ; -  ~ - -[12:00:37 AM] Found 1 error. Watching for file changes. - - - -Program root files: ["/user/username/projects/noEmitOnError/shared/types/db.ts","/user/username/projects/noEmitOnError/src/main.ts","/user/username/projects/noEmitOnError/src/other.ts"] -Program options: {"outDir":"/user/username/projects/noEmitOnError/dev-build","noEmitOnError":true,"watch":true,"isolatedModules":true,"configFilePath":"/user/username/projects/noEmitOnError/tsconfig.json"} -Program structureReused: Completely -Program files:: -/a/lib/lib.d.ts -/user/username/projects/noEmitOnError/shared/types/db.ts -/user/username/projects/noEmitOnError/src/main.ts -/user/username/projects/noEmitOnError/src/other.ts - -Semantic diagnostics in builder refreshed for:: - -No shapes updated in the builder:: PolledWatches:: /user/username/projects/noemitonerror/node_modules/@types: @@ -163,9 +139,9 @@ const a = { Output:: >> Screen clear -[12:00:41 AM] File change detected. Starting incremental compilation... +[12:00:39 AM] File change detected. Starting incremental compilation... -[12:00:58 AM] Found 0 errors. Watching for file changes. +[12:00:56 AM] Found 0 errors. Watching for file changes. @@ -236,14 +212,14 @@ const a: string = 10; Output:: >> Screen clear -[12:01:02 AM] File change detected. Starting incremental compilation... +[12:01:00 AM] File change detected. Starting incremental compilation... src/main.ts:2:7 - error TS2322: Type 'number' is not assignable to type 'string'. 2 const a: string = 10;    ~ -[12:01:03 AM] Found 1 error. Watching for file changes. +[12:01:01 AM] Found 1 error. Watching for file changes. @@ -291,30 +267,6 @@ Input:: //// [/user/username/projects/noEmitOnError/src/main.ts] file written with same contents Output:: ->> Screen clear -[12:01:08 AM] File change detected. Starting incremental compilation... - -src/main.ts:2:7 - error TS2322: Type 'number' is not assignable to type 'string'. - -2 const a: string = 10; -   ~ - -[12:01:09 AM] Found 1 error. Watching for file changes. - - - -Program root files: ["/user/username/projects/noEmitOnError/shared/types/db.ts","/user/username/projects/noEmitOnError/src/main.ts","/user/username/projects/noEmitOnError/src/other.ts"] -Program options: {"outDir":"/user/username/projects/noEmitOnError/dev-build","noEmitOnError":true,"watch":true,"isolatedModules":true,"configFilePath":"/user/username/projects/noEmitOnError/tsconfig.json"} -Program structureReused: Completely -Program files:: -/a/lib/lib.d.ts -/user/username/projects/noEmitOnError/shared/types/db.ts -/user/username/projects/noEmitOnError/src/main.ts -/user/username/projects/noEmitOnError/src/other.ts - -Semantic diagnostics in builder refreshed for:: - -No shapes updated in the builder:: PolledWatches:: /user/username/projects/noemitonerror/node_modules/@types: @@ -349,9 +301,9 @@ const a: string = "hello"; Output:: >> Screen clear -[12:01:13 AM] File change detected. Starting incremental compilation... +[12:01:09 AM] File change detected. Starting incremental compilation... -[12:01:17 AM] Found 0 errors. Watching for file changes. +[12:01:13 AM] Found 0 errors. Watching for file changes. @@ -405,25 +357,6 @@ Input:: //// [/user/username/projects/noEmitOnError/src/main.ts] file written with same contents Output:: ->> Screen clear -[12:01:21 AM] File change detected. Starting incremental compilation... - -[12:01:22 AM] Found 0 errors. Watching for file changes. - - - -Program root files: ["/user/username/projects/noEmitOnError/shared/types/db.ts","/user/username/projects/noEmitOnError/src/main.ts","/user/username/projects/noEmitOnError/src/other.ts"] -Program options: {"outDir":"/user/username/projects/noEmitOnError/dev-build","noEmitOnError":true,"watch":true,"isolatedModules":true,"configFilePath":"/user/username/projects/noEmitOnError/tsconfig.json"} -Program structureReused: Completely -Program files:: -/a/lib/lib.d.ts -/user/username/projects/noEmitOnError/shared/types/db.ts -/user/username/projects/noEmitOnError/src/main.ts -/user/username/projects/noEmitOnError/src/other.ts - -Semantic diagnostics in builder refreshed for:: - -No shapes updated in the builder:: PolledWatches:: /user/username/projects/noemitonerror/node_modules/@types: diff --git a/tests/baselines/reference/tscWatch/emitAndErrorUpdates/isolatedModulesAndD/with-noEmitOnError-with-incremental.js b/tests/baselines/reference/tscWatch/emitAndErrorUpdates/isolatedModulesAndD/with-noEmitOnError-with-incremental.js index fb739948fa60d..e124204a8f575 100644 --- a/tests/baselines/reference/tscWatch/emitAndErrorUpdates/isolatedModulesAndD/with-noEmitOnError-with-incremental.js +++ b/tests/baselines/reference/tscWatch/emitAndErrorUpdates/isolatedModulesAndD/with-noEmitOnError-with-incremental.js @@ -179,30 +179,6 @@ Input:: //// [/user/username/projects/noEmitOnError/src/main.ts] file written with same contents Output:: ->> Screen clear -[12:00:43 AM] File change detected. Starting incremental compilation... - -src/main.ts:4:1 - error TS1005: ',' expected. - -4 ; -  ~ - -[12:00:44 AM] Found 1 error. Watching for file changes. - - - -Program root files: ["/user/username/projects/noEmitOnError/shared/types/db.ts","/user/username/projects/noEmitOnError/src/main.ts","/user/username/projects/noEmitOnError/src/other.ts"] -Program options: {"outDir":"/user/username/projects/noEmitOnError/dev-build","noEmitOnError":true,"watch":true,"isolatedModules":true,"declaration":true,"incremental":true,"configFilePath":"/user/username/projects/noEmitOnError/tsconfig.json"} -Program structureReused: Completely -Program files:: -/a/lib/lib.d.ts -/user/username/projects/noEmitOnError/shared/types/db.ts -/user/username/projects/noEmitOnError/src/main.ts -/user/username/projects/noEmitOnError/src/other.ts - -Semantic diagnostics in builder refreshed for:: - -No shapes updated in the builder:: PolledWatches:: /user/username/projects/noemitonerror/node_modules/@types: @@ -239,9 +215,9 @@ const a = { Output:: >> Screen clear -[12:00:48 AM] File change detected. Starting incremental compilation... +[12:00:46 AM] File change detected. Starting incremental compilation... -[12:01:12 AM] Found 0 errors. Watching for file changes. +[12:01:10 AM] Found 0 errors. Watching for file changes. @@ -384,14 +360,14 @@ const a: string = 10; Output:: >> Screen clear -[12:01:19 AM] File change detected. Starting incremental compilation... +[12:01:17 AM] File change detected. Starting incremental compilation... src/main.ts:2:7 - error TS2322: Type 'number' is not assignable to type 'string'. 2 const a: string = 10;    ~ -[12:01:23 AM] Found 1 error. Watching for file changes. +[12:01:21 AM] Found 1 error. Watching for file changes. @@ -515,30 +491,6 @@ Input:: //// [/user/username/projects/noEmitOnError/src/main.ts] file written with same contents Output:: ->> Screen clear -[12:01:31 AM] File change detected. Starting incremental compilation... - -src/main.ts:2:7 - error TS2322: Type 'number' is not assignable to type 'string'. - -2 const a: string = 10; -   ~ - -[12:01:32 AM] Found 1 error. Watching for file changes. - - - -Program root files: ["/user/username/projects/noEmitOnError/shared/types/db.ts","/user/username/projects/noEmitOnError/src/main.ts","/user/username/projects/noEmitOnError/src/other.ts"] -Program options: {"outDir":"/user/username/projects/noEmitOnError/dev-build","noEmitOnError":true,"watch":true,"isolatedModules":true,"declaration":true,"incremental":true,"configFilePath":"/user/username/projects/noEmitOnError/tsconfig.json"} -Program structureReused: Completely -Program files:: -/a/lib/lib.d.ts -/user/username/projects/noEmitOnError/shared/types/db.ts -/user/username/projects/noEmitOnError/src/main.ts -/user/username/projects/noEmitOnError/src/other.ts - -Semantic diagnostics in builder refreshed for:: - -No shapes updated in the builder:: PolledWatches:: /user/username/projects/noemitonerror/node_modules/@types: @@ -573,9 +525,9 @@ const a: string = "hello"; Output:: >> Screen clear -[12:01:36 AM] File change detected. Starting incremental compilation... +[12:01:32 AM] File change detected. Starting incremental compilation... -[12:01:46 AM] Found 0 errors. Watching for file changes. +[12:01:42 AM] Found 0 errors. Watching for file changes. @@ -688,25 +640,6 @@ Input:: //// [/user/username/projects/noEmitOnError/src/main.ts] file written with same contents Output:: ->> Screen clear -[12:01:53 AM] File change detected. Starting incremental compilation... - -[12:01:54 AM] Found 0 errors. Watching for file changes. - - - -Program root files: ["/user/username/projects/noEmitOnError/shared/types/db.ts","/user/username/projects/noEmitOnError/src/main.ts","/user/username/projects/noEmitOnError/src/other.ts"] -Program options: {"outDir":"/user/username/projects/noEmitOnError/dev-build","noEmitOnError":true,"watch":true,"isolatedModules":true,"declaration":true,"incremental":true,"configFilePath":"/user/username/projects/noEmitOnError/tsconfig.json"} -Program structureReused: Completely -Program files:: -/a/lib/lib.d.ts -/user/username/projects/noEmitOnError/shared/types/db.ts -/user/username/projects/noEmitOnError/src/main.ts -/user/username/projects/noEmitOnError/src/other.ts - -Semantic diagnostics in builder refreshed for:: - -No shapes updated in the builder:: PolledWatches:: /user/username/projects/noemitonerror/node_modules/@types: diff --git a/tests/baselines/reference/tscWatch/emitAndErrorUpdates/isolatedModulesAndD/with-noEmitOnError.js b/tests/baselines/reference/tscWatch/emitAndErrorUpdates/isolatedModulesAndD/with-noEmitOnError.js index d030833345579..705d8b2e000f3 100644 --- a/tests/baselines/reference/tscWatch/emitAndErrorUpdates/isolatedModulesAndD/with-noEmitOnError.js +++ b/tests/baselines/reference/tscWatch/emitAndErrorUpdates/isolatedModulesAndD/with-noEmitOnError.js @@ -103,30 +103,6 @@ Input:: //// [/user/username/projects/noEmitOnError/src/main.ts] file written with same contents Output:: ->> Screen clear -[12:00:36 AM] File change detected. Starting incremental compilation... - -src/main.ts:4:1 - error TS1005: ',' expected. - -4 ; -  ~ - -[12:00:37 AM] Found 1 error. Watching for file changes. - - - -Program root files: ["/user/username/projects/noEmitOnError/shared/types/db.ts","/user/username/projects/noEmitOnError/src/main.ts","/user/username/projects/noEmitOnError/src/other.ts"] -Program options: {"outDir":"/user/username/projects/noEmitOnError/dev-build","noEmitOnError":true,"watch":true,"isolatedModules":true,"declaration":true,"configFilePath":"/user/username/projects/noEmitOnError/tsconfig.json"} -Program structureReused: Completely -Program files:: -/a/lib/lib.d.ts -/user/username/projects/noEmitOnError/shared/types/db.ts -/user/username/projects/noEmitOnError/src/main.ts -/user/username/projects/noEmitOnError/src/other.ts - -Semantic diagnostics in builder refreshed for:: - -No shapes updated in the builder:: PolledWatches:: /user/username/projects/noemitonerror/node_modules/@types: @@ -163,9 +139,9 @@ const a = { Output:: >> Screen clear -[12:00:41 AM] File change detected. Starting incremental compilation... +[12:00:39 AM] File change detected. Starting incremental compilation... -[12:01:04 AM] Found 0 errors. Watching for file changes. +[12:01:02 AM] Found 0 errors. Watching for file changes. @@ -250,14 +226,14 @@ const a: string = 10; Output:: >> Screen clear -[12:01:08 AM] File change detected. Starting incremental compilation... +[12:01:06 AM] File change detected. Starting incremental compilation... src/main.ts:2:7 - error TS2322: Type 'number' is not assignable to type 'string'. 2 const a: string = 10;    ~ -[12:01:09 AM] Found 1 error. Watching for file changes. +[12:01:07 AM] Found 1 error. Watching for file changes. @@ -305,30 +281,6 @@ Input:: //// [/user/username/projects/noEmitOnError/src/main.ts] file written with same contents Output:: ->> Screen clear -[12:01:14 AM] File change detected. Starting incremental compilation... - -src/main.ts:2:7 - error TS2322: Type 'number' is not assignable to type 'string'. - -2 const a: string = 10; -   ~ - -[12:01:15 AM] Found 1 error. Watching for file changes. - - - -Program root files: ["/user/username/projects/noEmitOnError/shared/types/db.ts","/user/username/projects/noEmitOnError/src/main.ts","/user/username/projects/noEmitOnError/src/other.ts"] -Program options: {"outDir":"/user/username/projects/noEmitOnError/dev-build","noEmitOnError":true,"watch":true,"isolatedModules":true,"declaration":true,"configFilePath":"/user/username/projects/noEmitOnError/tsconfig.json"} -Program structureReused: Completely -Program files:: -/a/lib/lib.d.ts -/user/username/projects/noEmitOnError/shared/types/db.ts -/user/username/projects/noEmitOnError/src/main.ts -/user/username/projects/noEmitOnError/src/other.ts - -Semantic diagnostics in builder refreshed for:: - -No shapes updated in the builder:: PolledWatches:: /user/username/projects/noemitonerror/node_modules/@types: @@ -363,9 +315,9 @@ const a: string = "hello"; Output:: >> Screen clear -[12:01:19 AM] File change detected. Starting incremental compilation... +[12:01:15 AM] File change detected. Starting incremental compilation... -[12:01:26 AM] Found 0 errors. Watching for file changes. +[12:01:22 AM] Found 0 errors. Watching for file changes. @@ -420,25 +372,6 @@ Input:: //// [/user/username/projects/noEmitOnError/src/main.ts] file written with same contents Output:: ->> Screen clear -[12:01:30 AM] File change detected. Starting incremental compilation... - -[12:01:31 AM] Found 0 errors. Watching for file changes. - - - -Program root files: ["/user/username/projects/noEmitOnError/shared/types/db.ts","/user/username/projects/noEmitOnError/src/main.ts","/user/username/projects/noEmitOnError/src/other.ts"] -Program options: {"outDir":"/user/username/projects/noEmitOnError/dev-build","noEmitOnError":true,"watch":true,"isolatedModules":true,"declaration":true,"configFilePath":"/user/username/projects/noEmitOnError/tsconfig.json"} -Program structureReused: Completely -Program files:: -/a/lib/lib.d.ts -/user/username/projects/noEmitOnError/shared/types/db.ts -/user/username/projects/noEmitOnError/src/main.ts -/user/username/projects/noEmitOnError/src/other.ts - -Semantic diagnostics in builder refreshed for:: - -No shapes updated in the builder:: PolledWatches:: /user/username/projects/noemitonerror/node_modules/@types: diff --git a/tests/baselines/reference/tscWatch/watchApi/host-implements-hasInvalidatedResolutions.js b/tests/baselines/reference/tscWatch/watchApi/host-implements-hasInvalidatedResolutions.js index 71dac5e657e1b..01ce85a26b5b7 100644 --- a/tests/baselines/reference/tscWatch/watchApi/host-implements-hasInvalidatedResolutions.js +++ b/tests/baselines/reference/tscWatch/watchApi/host-implements-hasInvalidatedResolutions.js @@ -101,26 +101,7 @@ FileWatcher:: Triggered with /user/username/projects/myproject/other.d.ts 1:: Wa Scheduling update Elapsed:: *ms FileWatcher:: Triggered with /user/username/projects/myproject/other.d.ts 1:: WatchInfo: /user/username/projects/myproject/other.d.ts 250 undefined Source file Synchronizing program -[12:00:29 AM] File change detected. Starting incremental compilation... - -CreatingProgramWith:: - roots: ["/user/username/projects/myproject/main.ts"] - options: {"traceResolution":true,"extendedDiagnostics":true,"configFilePath":"/user/username/projects/myproject/tsconfig.json"} -[12:00:30 AM] Found 0 errors. Watching for file changes. - - - -Program root files: ["/user/username/projects/myproject/main.ts"] -Program options: {"traceResolution":true,"extendedDiagnostics":true,"configFilePath":"/user/username/projects/myproject/tsconfig.json"} -Program structureReused: Completely -Program files:: -/a/lib/lib.d.ts -/user/username/projects/myproject/other.d.ts -/user/username/projects/myproject/main.ts - -Semantic diagnostics in builder refreshed for:: -No shapes updated in the builder:: PolledWatches:: /user/username/projects/myproject/node_modules/@types: @@ -153,12 +134,12 @@ FileWatcher:: Triggered with /user/username/projects/myproject/other.d.ts 1:: Wa Scheduling update Elapsed:: *ms FileWatcher:: Triggered with /user/username/projects/myproject/other.d.ts 1:: WatchInfo: /user/username/projects/myproject/other.d.ts 250 undefined Source file Synchronizing program -[12:00:33 AM] File change detected. Starting incremental compilation... +[12:00:31 AM] File change detected. Starting incremental compilation... CreatingProgramWith:: roots: ["/user/username/projects/myproject/main.ts"] options: {"traceResolution":true,"extendedDiagnostics":true,"configFilePath":"/user/username/projects/myproject/tsconfig.json"} -[12:00:37 AM] Found 0 errors. Watching for file changes. +[12:00:35 AM] Found 0 errors. Watching for file changes. @@ -211,7 +192,7 @@ FileWatcher:: Triggered with /user/username/projects/myproject/other.d.ts 1:: Wa Scheduling update Elapsed:: *ms FileWatcher:: Triggered with /user/username/projects/myproject/other.d.ts 1:: WatchInfo: /user/username/projects/myproject/other.d.ts 250 undefined Source file Synchronizing program -[12:00:42 AM] File change detected. Starting incremental compilation... +[12:00:40 AM] File change detected. Starting incremental compilation... CreatingProgramWith:: roots: ["/user/username/projects/myproject/main.ts"] @@ -222,7 +203,7 @@ Loading module as file / folder, candidate module location '/user/username/proje File '/user/username/projects/myproject/other.ts' exist - use it as a name resolution result. ======== Module name './other' was successfully resolved to '/user/username/projects/myproject/other.ts'. ======== FileWatcher:: Added:: WatchInfo: /user/username/projects/myproject/other.ts 250 undefined Source file -[12:00:48 AM] Found 0 errors. Watching for file changes. +[12:00:46 AM] Found 0 errors. Watching for file changes. diff --git a/tests/baselines/reference/tscWatch/watchEnvironment/fsEvent-for-change-is-repeated.js b/tests/baselines/reference/tscWatch/watchEnvironment/fsEvent-for-change-is-repeated.js index 101b21581bed3..30542faf47a4a 100644 --- a/tests/baselines/reference/tscWatch/watchEnvironment/fsEvent-for-change-is-repeated.js +++ b/tests/baselines/reference/tscWatch/watchEnvironment/fsEvent-for-change-is-repeated.js @@ -130,25 +130,7 @@ FileWatcher:: Triggered with main.ts 1:: WatchInfo: main.ts 250 undefined Source Scheduling update Elapsed:: *ms FileWatcher:: Triggered with main.ts 1:: WatchInfo: main.ts 250 undefined Source file Synchronizing program -[12:00:31 AM] File change detected. Starting incremental compilation... - -CreatingProgramWith:: - roots: ["main.ts"] - options: {"watch":true,"extendedDiagnostics":true} -[12:00:32 AM] Found 0 errors. Watching for file changes. - - - -Program root files: ["main.ts"] -Program options: {"watch":true,"extendedDiagnostics":true} -Program structureReused: Completely -Program files:: -/a/lib/lib.d.ts -main.ts - -Semantic diagnostics in builder refreshed for:: -No shapes updated in the builder:: PolledWatches:: /user/username/projects/project/node_modules/@types: From adde712e35d8429968f0ee26748e2297f1eb67e3 Mon Sep 17 00:00:00 2001 From: Sheetal Nandi Date: Tue, 29 Nov 2022 15:25:25 -0800 Subject: [PATCH 3/4] Test for empty string change --- .../unittests/tscWatch/watchEnvironment.ts | 10 ++ .../fsEvent-for-change-is-repeated.js | 96 +++++++++++++++++++ 2 files changed, 106 insertions(+) diff --git a/src/testRunner/unittests/tscWatch/watchEnvironment.ts b/src/testRunner/unittests/tscWatch/watchEnvironment.ts index a63c91efca936..3472b0ab92312 100644 --- a/src/testRunner/unittests/tscWatch/watchEnvironment.ts +++ b/src/testRunner/unittests/tscWatch/watchEnvironment.ts @@ -702,6 +702,16 @@ namespace ts.tscWatch { change: sys => replaceFileText(sys, "/user/username/projects/project/main.ts", "Hello", "Hello World"), timeouts: sys => sys.runQueuedTimeoutCallbacks(), }, + { + caption: "receive another change event without modifying the file", + change: sys => sys.invokeFsWatches("/user/username/projects/project/main.ts", "change", /*modifiedTime*/ undefined, /*useTildeSuffix*/ undefined), + timeouts: sys => sys.runQueuedTimeoutCallbacks(), + }, + { + caption: "change main.ts to empty text", + change: sys => sys.writeFile("/user/username/projects/project/main.ts", ""), + timeouts: sys => sys.runQueuedTimeoutCallbacks(), + }, { caption: "receive another change event without modifying the file", change: sys => sys.invokeFsWatches("/user/username/projects/project/main.ts", "change", /*modifiedTime*/ undefined, /*useTildeSuffix*/ undefined), diff --git a/tests/baselines/reference/tscWatch/watchEnvironment/fsEvent-for-change-is-repeated.js b/tests/baselines/reference/tscWatch/watchEnvironment/fsEvent-for-change-is-repeated.js index 30542faf47a4a..798d0de2ff300 100644 --- a/tests/baselines/reference/tscWatch/watchEnvironment/fsEvent-for-change-is-repeated.js +++ b/tests/baselines/reference/tscWatch/watchEnvironment/fsEvent-for-change-is-repeated.js @@ -146,3 +146,99 @@ FsWatchesRecursive:: exitCode:: ExitStatus.undefined + +Change:: change main.ts to empty text + +Input:: +//// [/user/username/projects/project/main.ts] + + + +Output:: +FileWatcher:: Triggered with main.ts 1:: WatchInfo: main.ts 250 undefined Source file +Scheduling update +Elapsed:: *ms FileWatcher:: Triggered with main.ts 1:: WatchInfo: main.ts 250 undefined Source file +Synchronizing program +[12:00:34 AM] File change detected. Starting incremental compilation... + +CreatingProgramWith:: + roots: ["main.ts"] + options: {"watch":true,"extendedDiagnostics":true} +[12:00:38 AM] Found 0 errors. Watching for file changes. + + + +Program root files: ["main.ts"] +Program options: {"watch":true,"extendedDiagnostics":true} +Program structureReused: Completely +Program files:: +/a/lib/lib.d.ts +main.ts + +Semantic diagnostics in builder refreshed for:: +main.ts + +Shape signatures in builder refreshed for:: +/user/username/projects/project/main.ts (used version) + +PolledWatches:: +/user/username/projects/project/node_modules/@types: + {"pollingInterval":500} + +FsWatches:: +/user/username/projects/project/main.ts: + {} +/a/lib/lib.d.ts: + {} + +FsWatchesRecursive:: + +exitCode:: ExitStatus.undefined + +//// [/user/username/projects/project/main.js] + + + +Change:: receive another change event without modifying the file + +Input:: + +Output:: +FileWatcher:: Triggered with main.ts 1:: WatchInfo: main.ts 250 undefined Source file +Scheduling update +Elapsed:: *ms FileWatcher:: Triggered with main.ts 1:: WatchInfo: main.ts 250 undefined Source file +Synchronizing program +[12:00:40 AM] File change detected. Starting incremental compilation... + +CreatingProgramWith:: + roots: ["main.ts"] + options: {"watch":true,"extendedDiagnostics":true} +[12:00:41 AM] Found 0 errors. Watching for file changes. + + + +Program root files: ["main.ts"] +Program options: {"watch":true,"extendedDiagnostics":true} +Program structureReused: Completely +Program files:: +/a/lib/lib.d.ts +main.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + +PolledWatches:: +/user/username/projects/project/node_modules/@types: + {"pollingInterval":500} + +FsWatches:: +/user/username/projects/project/main.ts: + {} +/a/lib/lib.d.ts: + {} + +FsWatchesRecursive:: + +exitCode:: ExitStatus.undefined + From 7953b7c0638ff1b4e42b0064ed079863713e5afb Mon Sep 17 00:00:00 2001 From: Sheetal Nandi Date: Tue, 29 Nov 2022 15:30:16 -0800 Subject: [PATCH 4/4] Fix empty string for file versioning --- src/compiler/tsbuildPublic.ts | 2 +- src/compiler/watchPublic.ts | 2 +- ...n-no-files-are-emitted-with-incremental.js | 26 +++++-------------- .../fsEvent-for-change-is-repeated.js | 18 ------------- 4 files changed, 8 insertions(+), 40 deletions(-) diff --git a/src/compiler/tsbuildPublic.ts b/src/compiler/tsbuildPublic.ts index e54fb1e04f979..643315046280b 100644 --- a/src/compiler/tsbuildPublic.ts +++ b/src/compiler/tsbuildPublic.ts @@ -1655,7 +1655,7 @@ namespace ts { if (!buildInfoVersionMap) buildInfoVersionMap = getBuildInfoFileVersionMap(buildInfoProgram, buildInfoPath!, host); version = buildInfoVersionMap.get(toPath(state, inputFile)); const text = version ? state.readFileWithCache(inputFile) : undefined; - currentVersion = text && (host.createHash || generateDjb2Hash)(text); + currentVersion = text !== undefined ? (host.createHash || generateDjb2Hash)(text) : undefined; if (version && version === currentVersion) pseudoInputUpToDate = true; } diff --git a/src/compiler/watchPublic.ts b/src/compiler/watchPublic.ts index 8f0544756b4de..5de1a7ea5a007 100644 --- a/src/compiler/watchPublic.ts +++ b/src/compiler/watchPublic.ts @@ -615,7 +615,7 @@ namespace ts { if (hostSourceFile.version) return hostSourceFile.version; // Read file and get new version const text = readFileWithCache(path); - return text ? (compilerHost.createHash || generateDjb2Hash)(text) : undefined; + return text !== undefined ? (compilerHost.createHash || generateDjb2Hash)(text) : undefined; } function onReleaseOldSourceFile(oldSourceFile: SourceFile, _oldOptions: CompilerOptions, hasSourceFileByPath: boolean) { diff --git a/tests/baselines/reference/tsbuildWatch/noEmit/does-not-go-in-loop-when-watching-when-no-files-are-emitted-with-incremental.js b/tests/baselines/reference/tsbuildWatch/noEmit/does-not-go-in-loop-when-watching-when-no-files-are-emitted-with-incremental.js index 2974c0e85109a..38bb7b98bba18 100644 --- a/tests/baselines/reference/tsbuildWatch/noEmit/does-not-go-in-loop-when-watching-when-no-files-are-emitted-with-incremental.js +++ b/tests/baselines/reference/tsbuildWatch/noEmit/does-not-go-in-loop-when-watching-when-no-files-are-emitted-with-incremental.js @@ -132,25 +132,11 @@ Output:: >> Screen clear [12:00:36 AM] File change detected. Starting incremental compilation... -[12:00:37 AM] Project 'tsconfig.json' is out of date because output 'tsconfig.tsbuildinfo' is older than input 'a.js' +[12:00:37 AM] Project 'tsconfig.json' is up to date but needs to update timestamps of output files that are older than input files -[12:00:38 AM] Building project '/user/username/projects/myproject/tsconfig.json'... +[12:00:38 AM] Found 0 errors. Watching for file changes. -[12:00:39 AM] Found 0 errors. Watching for file changes. - - - -Program root files: ["/user/username/projects/myproject/a.js","/user/username/projects/myproject/b.ts"] -Program options: {"allowJs":true,"noEmit":true,"watch":true,"incremental":true,"configFilePath":"/user/username/projects/myproject/tsconfig.json"} -Program structureReused: Not -Program files:: -/a/lib/lib.d.ts -/user/username/projects/myproject/a.js -/user/username/projects/myproject/b.ts - -Semantic diagnostics in builder refreshed for:: -No shapes updated in the builder:: PolledWatches:: @@ -178,13 +164,13 @@ const x = 10; Output:: >> Screen clear -[12:00:43 AM] File change detected. Starting incremental compilation... +[12:00:42 AM] File change detected. Starting incremental compilation... -[12:00:44 AM] Project 'tsconfig.json' is out of date because output 'tsconfig.tsbuildinfo' is older than input 'a.js' +[12:00:43 AM] Project 'tsconfig.json' is out of date because output 'tsconfig.tsbuildinfo' is older than input 'a.js' -[12:00:45 AM] Building project '/user/username/projects/myproject/tsconfig.json'... +[12:00:44 AM] Building project '/user/username/projects/myproject/tsconfig.json'... -[12:00:53 AM] Found 0 errors. Watching for file changes. +[12:00:52 AM] Found 0 errors. Watching for file changes. diff --git a/tests/baselines/reference/tscWatch/watchEnvironment/fsEvent-for-change-is-repeated.js b/tests/baselines/reference/tscWatch/watchEnvironment/fsEvent-for-change-is-repeated.js index 798d0de2ff300..777e659658064 100644 --- a/tests/baselines/reference/tscWatch/watchEnvironment/fsEvent-for-change-is-repeated.js +++ b/tests/baselines/reference/tscWatch/watchEnvironment/fsEvent-for-change-is-repeated.js @@ -208,25 +208,7 @@ FileWatcher:: Triggered with main.ts 1:: WatchInfo: main.ts 250 undefined Source Scheduling update Elapsed:: *ms FileWatcher:: Triggered with main.ts 1:: WatchInfo: main.ts 250 undefined Source file Synchronizing program -[12:00:40 AM] File change detected. Starting incremental compilation... - -CreatingProgramWith:: - roots: ["main.ts"] - options: {"watch":true,"extendedDiagnostics":true} -[12:00:41 AM] Found 0 errors. Watching for file changes. - - - -Program root files: ["main.ts"] -Program options: {"watch":true,"extendedDiagnostics":true} -Program structureReused: Completely -Program files:: -/a/lib/lib.d.ts -main.ts - -Semantic diagnostics in builder refreshed for:: -No shapes updated in the builder:: PolledWatches:: /user/username/projects/project/node_modules/@types: