From 7a12909ae3f03b1feed19df2082aa84e5c7a5081 Mon Sep 17 00:00:00 2001 From: Ryan Bargholz Date: Tue, 7 Dec 2021 19:50:44 +0900 Subject: [PATCH] fix(45713) Improve error report summaries (#45742) * Improve error report summaries (#45713) * fixup! Improve error report summaries (#45713) * fixup! fixup! Improve error report summaries (#45713) * Adds support for handling localization renaming the 'files' header due to localization * fixup! Adds support for handling localization renaming the 'files' header due to localization - Fixed baseline error - Fixed linter error Co-authored-by: Orta Co-authored-by: Orta Therox --- src/compiler/diagnosticMessages.json | 18 +++ src/compiler/tsbuildPublic.ts | 12 +- src/compiler/watch.ts | 83 +++++++++- src/executeCommandLine/executeCommandLine.ts | 2 +- src/harness/harnessIO.ts | 2 +- src/testRunner/unittests/tsbuild/publicApi.ts | 2 +- src/testRunner/unittests/tscWatch/helpers.ts | 9 +- .../reference/api/tsserverlibrary.d.ts | 6 +- tests/baselines/reference/api/typescript.d.ts | 6 +- .../deeplyNestedAssignabilityIssue.errors.txt | 4 +- ...uplicateIdentifierRelatedSpans1.errors.txt | 6 +- ...uplicateIdentifierRelatedSpans2.errors.txt | 5 +- ...uplicateIdentifierRelatedSpans3.errors.txt | 5 +- ...uplicateIdentifierRelatedSpans4.errors.txt | 5 +- ...uplicateIdentifierRelatedSpans5.errors.txt | 5 +- ...uplicateIdentifierRelatedSpans6.errors.txt | 5 +- ...uplicateIdentifierRelatedSpans7.errors.txt | 5 +- ...opPrettyErrorRelatedInformation.errors.txt | 2 +- ...manyCompilerErrorsInTheTwoFiles.errors.txt | 144 ++++++++++++++++++ .../manyCompilerErrorsInTheTwoFiles.js | 30 ++++ .../manyCompilerErrorsInTheTwoFiles.symbols | 16 ++ .../manyCompilerErrorsInTheTwoFiles.types | 46 ++++++ ...LineContextDiagnosticWithPretty.errors.txt | 2 +- .../prettyContextNotDebugAssertion.errors.txt | 2 +- .../prettyFileWithErrorsAndTabs.errors.txt | 4 +- ...and-line-but-has-tsbuild-info-in-config.js | 2 +- ...rough-indirect-symlink-moduleCaseChange.js | 2 +- ...ibling-package-through-indirect-symlink.js | 2 +- .../initial-build/noEmit-changes-composite.js | 45 ++++-- .../noEmit-changes-incremental-declaration.js | 45 ++++-- .../noEmit-changes-incremental.js | 45 ++++-- ...t-changes-with-initial-noEmit-composite.js | 10 +- ...-initial-noEmit-incremental-declaration.js | 10 +- ...changes-with-initial-noEmit-incremental.js | 10 +- ...le-is-added,-the-signatures-are-updated.js | 25 ++- .../with-noEmitOnError-semantic-errors.js | 4 +- .../with-noEmitOnError-syntax-errors.js | 4 +- ...ject-contains-invalid-project-reference.js | 2 +- ...eferences-composite-project-with-noEmit.js | 2 +- ...ypes-found-doesn't-crash-under---strict.js | 2 +- ...editing-module-augmentation-incremental.js | 2 +- ...lpers-backing-types-removed-incremental.js | 2 +- ...tSource-backing-types-added-incremental.js | 2 +- ...ource-backing-types-removed-incremental.js | 2 +- ...ImportSource-option-changed-incremental.js | 2 +- .../own-file-emit-with-errors-incremental.js | 4 +- .../own-file-emit-with-errors-incremental.js | 4 +- ...declaration-file-is-deleted-incremental.js | 2 +- .../reference/typedefCrossModule5.errors.txt | 5 +- .../manyCompilerErrorsInTheTwoFiles.ts | 12 ++ 50 files changed, 575 insertions(+), 98 deletions(-) create mode 100644 tests/baselines/reference/manyCompilerErrorsInTheTwoFiles.errors.txt create mode 100644 tests/baselines/reference/manyCompilerErrorsInTheTwoFiles.js create mode 100644 tests/baselines/reference/manyCompilerErrorsInTheTwoFiles.symbols create mode 100644 tests/baselines/reference/manyCompilerErrorsInTheTwoFiles.types create mode 100644 tests/cases/compiler/manyCompilerErrorsInTheTwoFiles.ts diff --git a/src/compiler/diagnosticMessages.json b/src/compiler/diagnosticMessages.json index d8f1a1b5312d3..778a9304aa75e 100644 --- a/src/compiler/diagnosticMessages.json +++ b/src/compiler/diagnosticMessages.json @@ -4156,6 +4156,12 @@ "category": "Message", "code": 6040 }, + "Errors Files": { + "_locale_notes": "There is a double space, and the order cannot be changed (they're table headings) ^", + "category": "Message", + "code": 6041 + }, + "Generates corresponding '.map' file.": { "category": "Message", "code": 6043 @@ -4935,6 +4941,18 @@ "category": "Error", "code": 6258 }, + "Found 1 error in {1}": { + "category": "Message", + "code": 6259 + }, + "Found {0} errors in 1 file.": { + "category": "Message", + "code": 6260 + }, + "Found {0} errors in {1} files.": { + "category": "Message", + "code": 6261 + }, "Directory '{0}' has no containing package.json scope. Imports will not resolve.": { "category": "Message", diff --git a/src/compiler/tsbuildPublic.ts b/src/compiler/tsbuildPublic.ts index ae3fd3be20d2a..fa42aad3246a7 100644 --- a/src/compiler/tsbuildPublic.ts +++ b/src/compiler/tsbuildPublic.ts @@ -76,7 +76,12 @@ namespace ts { return fileExtensionIs(fileName, Extension.Dts); } - export type ReportEmitErrorSummary = (errorCount: number) => void; + export type ReportEmitErrorSummary = (errorCount: number, filesInError: (ReportFileInError | undefined)[]) => void; + + export interface ReportFileInError { + fileName: string; + line: number; + } export interface SolutionBuilderHostBase extends ProgramHost { createDirectory?(path: string): void; @@ -2003,10 +2008,12 @@ namespace ts { const canReportSummary = state.watch || !!state.host.reportErrorSummary; const { diagnostics } = state; let totalErrors = 0; + let filesInError: (ReportFileInError | undefined)[] = []; if (isCircularBuildOrder(buildOrder)) { reportBuildQueue(state, buildOrder.buildOrder); reportErrors(state, buildOrder.circularDiagnostics); if (canReportSummary) totalErrors += getErrorCountForSummary(buildOrder.circularDiagnostics); + if (canReportSummary) filesInError = [...filesInError, ...getFilesInErrorForSummary(buildOrder.circularDiagnostics)]; } else { // Report errors from the other projects @@ -2017,13 +2024,14 @@ namespace ts { } }); if (canReportSummary) diagnostics.forEach(singleProjectErrors => totalErrors += getErrorCountForSummary(singleProjectErrors)); + if (canReportSummary) diagnostics.forEach(singleProjectErrors => [...filesInError, ...getFilesInErrorForSummary(singleProjectErrors)]); } if (state.watch) { reportWatchStatus(state, getWatchErrorSummaryDiagnosticMessage(totalErrors), totalErrors); } else if (state.host.reportErrorSummary) { - state.host.reportErrorSummary(totalErrors); + state.host.reportErrorSummary(totalErrors, filesInError); } } diff --git a/src/compiler/watch.ts b/src/compiler/watch.ts index 71853f4f34b52..9fe053a7ff841 100644 --- a/src/compiler/watch.ts +++ b/src/compiler/watch.ts @@ -7,7 +7,7 @@ namespace ts { } : undefined; /** - * Create a function that reports error by writing to the system and handles the formating of the diagnostic + * Create a function that reports error by writing to the system and handles the formatting of the diagnostic */ export function createDiagnosticReporter(system: System, pretty?: boolean): DiagnosticReporter { const host: FormatDiagnosticsHost = system === sys && sysFormatDiagnosticsHost ? sysFormatDiagnosticsHost : { @@ -101,16 +101,87 @@ namespace ts { return countWhere(diagnostics, diagnostic => diagnostic.category === DiagnosticCategory.Error); } + export function getFilesInErrorForSummary(diagnostics: readonly Diagnostic[]): (ReportFileInError | undefined)[] { + const filesInError = + filter(diagnostics, diagnostic => diagnostic.category === DiagnosticCategory.Error) + .map( + errorDiagnostic => { + if(errorDiagnostic.file === undefined) return; + return `${errorDiagnostic.file.fileName}`; + }); + return filesInError.map((fileName: string) => { + const diagnosticForFileName = find(diagnostics, diagnostic => + diagnostic.file !== undefined && diagnostic.file.fileName === fileName + ); + + if(diagnosticForFileName !== undefined) { + const { line } = getLineAndCharacterOfPosition(diagnosticForFileName.file!, diagnosticForFileName.start!); + return { + fileName, + line: line + 1, + }; + } + }); + } + export function getWatchErrorSummaryDiagnosticMessage(errorCount: number) { return errorCount === 1 ? Diagnostics.Found_1_error_Watching_for_file_changes : Diagnostics.Found_0_errors_Watching_for_file_changes; } - export function getErrorSummaryText(errorCount: number, newLine: string) { + export function getErrorSummaryText( + errorCount: number, + filesInError: readonly (ReportFileInError | undefined)[], + newLine: string + ) { if (errorCount === 0) return ""; - const d = createCompilerDiagnostic(errorCount === 1 ? Diagnostics.Found_1_error : Diagnostics.Found_0_errors, errorCount); - return `${newLine}${flattenDiagnosticMessageText(d.messageText, newLine)}${newLine}${newLine}`; + const nonNilFiles = filesInError.filter(fileInError => fileInError !== undefined); + const distinctFileNamesWithLines = nonNilFiles.map(fileInError => `${fileInError!.fileName}:${fileInError!.line}`) + .filter((value, index, self) => self.indexOf(value) === index); + const d = errorCount === 1 ? + createCompilerDiagnostic( + filesInError[0] !== undefined ? + Diagnostics.Found_1_error_in_1 : + Diagnostics.Found_1_error, + errorCount, + distinctFileNamesWithLines[0]) : + createCompilerDiagnostic( + distinctFileNamesWithLines.length === 0 ? + Diagnostics.Found_0_errors : + distinctFileNamesWithLines.length === 1 ? + Diagnostics.Found_0_errors_in_1_file : + Diagnostics.Found_0_errors_in_1_files, + errorCount, + distinctFileNamesWithLines.length); + return `${newLine}${flattenDiagnosticMessageText(d.messageText, newLine)}${newLine}${newLine}${errorCount > 1 ? createTabularErrorsDisplay(nonNilFiles) : ""}`; + } + + function createTabularErrorsDisplay(filesInError: (ReportFileInError | undefined)[]) { + const distinctFiles = filesInError.filter((value, index, self) => index === self.findIndex(file => file?.fileName === value?.fileName)); + if (distinctFiles.length === 0) return ""; + + const numberLength = (num: number) => Math.log(num) * Math.LOG10E + 1; + const fileToErrorCount = distinctFiles.map(file => ([file, countWhere(filesInError, fileInError => fileInError!.fileName === file!.fileName)] as const)); + const maxErrors = fileToErrorCount.reduce((acc, value) => Math.max(acc, value[1] || 0), 0); + + const headerRow = Diagnostics.Errors_Files.message; + const leftColumnHeadingLength = headerRow.split(" ")[0].length; + const leftPaddingGoal = Math.max(leftColumnHeadingLength, numberLength(maxErrors)); + const headerPadding = Math.max(numberLength(maxErrors) - leftColumnHeadingLength, 0); + + let tabularData = ""; + tabularData += " ".repeat(headerPadding) + headerRow + "\n"; + fileToErrorCount.forEach((row) => { + const [file, errorCount] = row; + const errorCountDigitsLength = Math.log(errorCount) * Math.LOG10E + 1 | 0; + const leftPadding = errorCountDigitsLength < leftPaddingGoal ? + " ".repeat(leftPaddingGoal - errorCountDigitsLength) + : ""; + tabularData += `${leftPadding}${errorCount} ${file!.fileName}:${file!.line}\n`; + }); + + return tabularData; } export function isBuilderProgram(program: Program | BuilderProgram): program is BuilderProgram { @@ -350,7 +421,7 @@ namespace ts { } if (reportSummary) { - reportSummary(getErrorCountForSummary(diagnostics)); + reportSummary(getErrorCountForSummary(diagnostics), getFilesInErrorForSummary(diagnostics)); } return { @@ -656,7 +727,7 @@ namespace ts { builderProgram, input.reportDiagnostic || createDiagnosticReporter(system), s => host.trace && host.trace(s), - input.reportErrorSummary || input.options.pretty ? errorCount => system.write(getErrorSummaryText(errorCount, system.newLine)) : undefined + input.reportErrorSummary || input.options.pretty ? (errorCount, filesInError) => system.write(getErrorSummaryText(errorCount, filesInError, system.newLine)) : undefined ); if (input.afterProgramEmitAndDiagnostics) input.afterProgramEmitAndDiagnostics(builderProgram); return exitStatus; diff --git a/src/executeCommandLine/executeCommandLine.ts b/src/executeCommandLine/executeCommandLine.ts index 2c0d7ba64e7fd..b4b206daa0cf6 100644 --- a/src/executeCommandLine/executeCommandLine.ts +++ b/src/executeCommandLine/executeCommandLine.ts @@ -773,7 +773,7 @@ namespace ts { function createReportErrorSummary(sys: System, options: CompilerOptions | BuildOptions): ReportEmitErrorSummary | undefined { return shouldBePretty(sys, options) ? - errorCount => sys.write(getErrorSummaryText(errorCount, sys.newLine)) : + (errorCount, filesInError) => sys.write(getErrorSummaryText(errorCount, filesInError, sys.newLine)) : undefined; } diff --git a/src/harness/harnessIO.ts b/src/harness/harnessIO.ts index 50c14ea0f6f80..c7588bfecc375 100644 --- a/src/harness/harnessIO.ts +++ b/src/harness/harnessIO.ts @@ -537,7 +537,7 @@ namespace Harness { outputLines += content; } if (pretty) { - outputLines += ts.getErrorSummaryText(ts.getErrorCountForSummary(diagnostics), IO.newLine()); + outputLines += ts.getErrorSummaryText(ts.getErrorCountForSummary(diagnostics), ts.getFilesInErrorForSummary(diagnostics), IO.newLine()); } return outputLines; } diff --git a/src/testRunner/unittests/tsbuild/publicApi.ts b/src/testRunner/unittests/tsbuild/publicApi.ts index d3c39188b421a..4c2758329f206 100644 --- a/src/testRunner/unittests/tsbuild/publicApi.ts +++ b/src/testRunner/unittests/tsbuild/publicApi.ts @@ -54,7 +54,7 @@ export function f22() { } // trailing`, /*createProgram*/ undefined, createDiagnosticReporter(sys, /*pretty*/ true), createBuilderStatusReporter(sys, /*pretty*/ true), - errorCount => sys.write(getErrorSummaryText(errorCount, sys.newLine)) + (errorCount, filesInError) => sys.write(getErrorSummaryText(errorCount, filesInError, sys.newLine)) ); buildHost.afterProgramEmitAndDiagnostics = cb; buildHost.afterEmitBundle = cb; diff --git a/src/testRunner/unittests/tscWatch/helpers.ts b/src/testRunner/unittests/tscWatch/helpers.ts index 813615fb869a2..1263b59af7b0d 100644 --- a/src/testRunner/unittests/tscWatch/helpers.ts +++ b/src/testRunner/unittests/tscWatch/helpers.ts @@ -204,13 +204,18 @@ namespace ts.tscWatch { assert.equal(host.exitCode, expectedExitCode); } - export function checkNormalBuildErrors(host: WatchedSystem, errors: readonly Diagnostic[] | readonly string[], reportErrorSummary?: boolean) { + export function checkNormalBuildErrors( + host: WatchedSystem, + errors: readonly Diagnostic[] | readonly string[], + files: readonly ReportFileInError[], + reportErrorSummary?: boolean + ) { checkOutputErrors( host, [ ...map(errors, hostOutputDiagnostic), ...reportErrorSummary ? - [hostOutputWatchDiagnostic(getErrorSummaryText(errors.length, host.newLine))] : + [hostOutputWatchDiagnostic(getErrorSummaryText(errors.length, files, host.newLine))] : emptyArray ] ); diff --git a/tests/baselines/reference/api/tsserverlibrary.d.ts b/tests/baselines/reference/api/tsserverlibrary.d.ts index c332bd508ebd3..4df9e6328ecbd 100644 --- a/tests/baselines/reference/api/tsserverlibrary.d.ts +++ b/tests/baselines/reference/api/tsserverlibrary.d.ts @@ -5352,7 +5352,11 @@ declare namespace ts { traceResolution?: boolean; [option: string]: CompilerOptionsValue | undefined; } - type ReportEmitErrorSummary = (errorCount: number) => void; + type ReportEmitErrorSummary = (errorCount: number, filesInError: (ReportFileInError | undefined)[]) => void; + interface ReportFileInError { + fileName: string; + line: number; + } interface SolutionBuilderHostBase extends ProgramHost { createDirectory?(path: string): void; /** diff --git a/tests/baselines/reference/api/typescript.d.ts b/tests/baselines/reference/api/typescript.d.ts index f17b673f25047..fdd55dab1f2d9 100644 --- a/tests/baselines/reference/api/typescript.d.ts +++ b/tests/baselines/reference/api/typescript.d.ts @@ -5352,7 +5352,11 @@ declare namespace ts { traceResolution?: boolean; [option: string]: CompilerOptionsValue | undefined; } - type ReportEmitErrorSummary = (errorCount: number) => void; + type ReportEmitErrorSummary = (errorCount: number, filesInError: (ReportFileInError | undefined)[]) => void; + interface ReportFileInError { + fileName: string; + line: number; + } interface SolutionBuilderHostBase extends ProgramHost { createDirectory?(path: string): void; /** diff --git a/tests/baselines/reference/deeplyNestedAssignabilityIssue.errors.txt b/tests/baselines/reference/deeplyNestedAssignabilityIssue.errors.txt index 493e746bc944a..4692244cf2cd9 100644 --- a/tests/baselines/reference/deeplyNestedAssignabilityIssue.errors.txt +++ b/tests/baselines/reference/deeplyNestedAssignabilityIssue.errors.txt @@ -65,5 +65,7 @@ } } -Found 2 errors. +Found 2 errors in 1 file. +Errors Files + 2 tests/cases/compiler/deeplyNestedAssignabilityIssue.ts:22 diff --git a/tests/baselines/reference/duplicateIdentifierRelatedSpans1.errors.txt b/tests/baselines/reference/duplicateIdentifierRelatedSpans1.errors.txt index ed4a93ad1075a..1757e7a5a99f1 100644 --- a/tests/baselines/reference/duplicateIdentifierRelatedSpans1.errors.txt +++ b/tests/baselines/reference/duplicateIdentifierRelatedSpans1.errors.txt @@ -92,5 +92,9 @@ !!! error TS2451: Cannot redeclare block-scoped variable 'Bar'. !!! related TS6203 tests/cases/compiler/file1.ts:2:7: 'Bar' was also declared here. -Found 6 errors. +Found 6 errors in 3 files. +Errors Files + 2 tests/cases/compiler/file1.ts:1 + 2 tests/cases/compiler/file2.ts:1 + 2 tests/cases/compiler/file3.ts:1 diff --git a/tests/baselines/reference/duplicateIdentifierRelatedSpans2.errors.txt b/tests/baselines/reference/duplicateIdentifierRelatedSpans2.errors.txt index e149ce706f1a0..1ce6d4b49d404 100644 --- a/tests/baselines/reference/duplicateIdentifierRelatedSpans2.errors.txt +++ b/tests/baselines/reference/duplicateIdentifierRelatedSpans2.errors.txt @@ -45,5 +45,8 @@ class H { } class I { } -Found 2 errors. +Found 2 errors in 2 files. +Errors Files + 1 tests/cases/compiler/file1.ts:1 + 1 tests/cases/compiler/file2.ts:1 diff --git a/tests/baselines/reference/duplicateIdentifierRelatedSpans3.errors.txt b/tests/baselines/reference/duplicateIdentifierRelatedSpans3.errors.txt index 81c8f5c0c00c7..9f25f53ffe5ed 100644 --- a/tests/baselines/reference/duplicateIdentifierRelatedSpans3.errors.txt +++ b/tests/baselines/reference/duplicateIdentifierRelatedSpans3.errors.txt @@ -85,5 +85,8 @@ !!! related TS6203 tests/cases/compiler/file1.ts:4:5: 'duplicate3' was also declared here. } -Found 6 errors. +Found 6 errors in 2 files. +Errors Files + 3 tests/cases/compiler/file1.ts:2 + 3 tests/cases/compiler/file2.ts:2 diff --git a/tests/baselines/reference/duplicateIdentifierRelatedSpans4.errors.txt b/tests/baselines/reference/duplicateIdentifierRelatedSpans4.errors.txt index b6cd9e2fe4e79..2cb070a51e17a 100644 --- a/tests/baselines/reference/duplicateIdentifierRelatedSpans4.errors.txt +++ b/tests/baselines/reference/duplicateIdentifierRelatedSpans4.errors.txt @@ -47,5 +47,8 @@ duplicate8(): number; } -Found 2 errors. +Found 2 errors in 2 files. +Errors Files + 1 tests/cases/compiler/file1.ts:1 + 1 tests/cases/compiler/file2.ts:1 diff --git a/tests/baselines/reference/duplicateIdentifierRelatedSpans5.errors.txt b/tests/baselines/reference/duplicateIdentifierRelatedSpans5.errors.txt index ae55bedd1383b..259e3a026cb54 100644 --- a/tests/baselines/reference/duplicateIdentifierRelatedSpans5.errors.txt +++ b/tests/baselines/reference/duplicateIdentifierRelatedSpans5.errors.txt @@ -92,5 +92,8 @@ } export {} -Found 6 errors. +Found 6 errors in 2 files. +Errors Files + 3 tests/cases/compiler/file1.ts:3 + 3 tests/cases/compiler/file2.ts:4 diff --git a/tests/baselines/reference/duplicateIdentifierRelatedSpans6.errors.txt b/tests/baselines/reference/duplicateIdentifierRelatedSpans6.errors.txt index c380c59c48a5b..a896c19892bae 100644 --- a/tests/baselines/reference/duplicateIdentifierRelatedSpans6.errors.txt +++ b/tests/baselines/reference/duplicateIdentifierRelatedSpans6.errors.txt @@ -92,5 +92,8 @@ !!! related TS6203 tests/cases/compiler/file2.ts:7:9: 'duplicate3' was also declared here. } } -Found 6 errors. +Found 6 errors in 2 files. +Errors Files + 3 tests/cases/compiler/file1.ts:3 + 3 tests/cases/compiler/file2.ts:5 diff --git a/tests/baselines/reference/duplicateIdentifierRelatedSpans7.errors.txt b/tests/baselines/reference/duplicateIdentifierRelatedSpans7.errors.txt index 6e5c0ab902cc9..bba90aab94563 100644 --- a/tests/baselines/reference/duplicateIdentifierRelatedSpans7.errors.txt +++ b/tests/baselines/reference/duplicateIdentifierRelatedSpans7.errors.txt @@ -56,5 +56,8 @@ duplicate9: () => string; } } -Found 2 errors. +Found 2 errors in 2 files. +Errors Files + 1 tests/cases/compiler/file1.ts:1 + 1 tests/cases/compiler/file2.ts:3 diff --git a/tests/baselines/reference/esModuleInteropPrettyErrorRelatedInformation.errors.txt b/tests/baselines/reference/esModuleInteropPrettyErrorRelatedInformation.errors.txt index 8222133a9de00..01a70a26853cb 100644 --- a/tests/baselines/reference/esModuleInteropPrettyErrorRelatedInformation.errors.txt +++ b/tests/baselines/reference/esModuleInteropPrettyErrorRelatedInformation.errors.txt @@ -23,5 +23,5 @@ !!! error TS2345: Type '{ default: () => void; }' provides no match for the signature '(): void'. !!! related TS7038 tests/cases/compiler/index.ts:1:1: Type originates at this import. A namespace-style import cannot be called or constructed, and will cause a failure at runtime. Consider using a default import or import require here instead. -Found 1 error. +Found 1 error in tests/cases/compiler/index.ts:3 diff --git a/tests/baselines/reference/manyCompilerErrorsInTheTwoFiles.errors.txt b/tests/baselines/reference/manyCompilerErrorsInTheTwoFiles.errors.txt new file mode 100644 index 0000000000000..aec653574bf20 --- /dev/null +++ b/tests/baselines/reference/manyCompilerErrorsInTheTwoFiles.errors.txt @@ -0,0 +1,144 @@ +tests/cases/compiler/a.ts:1:11 - error TS1109: Expression expected. + +1 const a =!@#!@$ +   ~ +tests/cases/compiler/a.ts:1:12 - error TS18026: '#!' can only be used at the start of a file. + +1 const a =!@#!@$ +    +tests/cases/compiler/a.ts:1:14 - error TS1109: Expression expected. + +1 const a =!@#!@$ +   ~ +tests/cases/compiler/a.ts:2:12 - error TS1109: Expression expected. + +2 const b = !@#!@#!@#! +   ~ +tests/cases/compiler/a.ts:2:13 - error TS18026: '#!' can only be used at the start of a file. + +2 const b = !@#!@#!@#! +    +tests/cases/compiler/a.ts:2:15 - error TS1109: Expression expected. + +2 const b = !@#!@#!@#! +   ~ +tests/cases/compiler/a.ts:2:16 - error TS18026: '#!' can only be used at the start of a file. + +2 const b = !@#!@#!@#! +    +tests/cases/compiler/a.ts:2:18 - error TS1109: Expression expected. + +2 const b = !@#!@#!@#! +   ~ +tests/cases/compiler/a.ts:2:19 - error TS18026: '#!' can only be used at the start of a file. + +2 const b = !@#!@#!@#! +    +tests/cases/compiler/a.ts:3:1 - error TS2304: Cannot find name 'OK'. + +3 OK! +  ~~ +tests/cases/compiler/a.ts:4:1 - error TS1434: Unexpected keyword or identifier. + +4 HERE's A shouty thing +  ~~~~ +tests/cases/compiler/a.ts:4:1 - error TS2304: Cannot find name 'HERE'. + +4 HERE's A shouty thing +  ~~~~ +tests/cases/compiler/a.ts:4:22 - error TS1002: Unterminated string literal. + +4 HERE's A shouty thing +    +tests/cases/compiler/a.ts:5:1 - error TS1434: Unexpected keyword or identifier. + +5 GOTTA GO FAST +  ~~~~~ +tests/cases/compiler/a.ts:5:1 - error TS2304: Cannot find name 'GOTTA'. + +5 GOTTA GO FAST +  ~~~~~ +tests/cases/compiler/a.ts:5:7 - error TS1434: Unexpected keyword or identifier. + +5 GOTTA GO FAST +   ~~ +tests/cases/compiler/a.ts:5:7 - error TS2304: Cannot find name 'GO'. + +5 GOTTA GO FAST +   ~~ +tests/cases/compiler/a.ts:5:10 - error TS2304: Cannot find name 'FAST'. + +5 GOTTA GO FAST +   ~~~~ +tests/cases/compiler/b.ts:1:1 - error TS2304: Cannot find name 'fhqwhgads'. + +1 fhqwhgads +  ~~~~~~~~~ +tests/cases/compiler/b.ts:2:1 - error TS2304: Cannot find name 'to'. + +2 to +  ~~ +tests/cases/compiler/b.ts:3:1 - error TS2304: Cannot find name 'limit'. + +3 limit +  ~~~~~ + + +==== tests/cases/compiler/a.ts (18 errors) ==== + const a =!@#!@$ + ~ +!!! error TS1109: Expression expected. + +!!! error TS18026: '#!' can only be used at the start of a file. + ~ +!!! error TS1109: Expression expected. + const b = !@#!@#!@#! + ~ +!!! error TS1109: Expression expected. + +!!! error TS18026: '#!' can only be used at the start of a file. + ~ +!!! error TS1109: Expression expected. + +!!! error TS18026: '#!' can only be used at the start of a file. + ~ +!!! error TS1109: Expression expected. + +!!! error TS18026: '#!' can only be used at the start of a file. + OK! + ~~ +!!! error TS2304: Cannot find name 'OK'. + HERE's A shouty thing + ~~~~ +!!! error TS1434: Unexpected keyword or identifier. + ~~~~ +!!! error TS2304: Cannot find name 'HERE'. + +!!! error TS1002: Unterminated string literal. + GOTTA GO FAST + ~~~~~ +!!! error TS1434: Unexpected keyword or identifier. + ~~~~~ +!!! error TS2304: Cannot find name 'GOTTA'. + ~~ +!!! error TS1434: Unexpected keyword or identifier. + ~~ +!!! error TS2304: Cannot find name 'GO'. + ~~~~ +!!! error TS2304: Cannot find name 'FAST'. + +==== tests/cases/compiler/b.ts (3 errors) ==== + fhqwhgads + ~~~~~~~~~ +!!! error TS2304: Cannot find name 'fhqwhgads'. + to + ~~ +!!! error TS2304: Cannot find name 'to'. + limit + ~~~~~ +!!! error TS2304: Cannot find name 'limit'. +Found 21 errors in 2 files. + +Errors Files + 18 tests/cases/compiler/a.ts:1 + 3 tests/cases/compiler/b.ts:1 diff --git a/tests/baselines/reference/manyCompilerErrorsInTheTwoFiles.js b/tests/baselines/reference/manyCompilerErrorsInTheTwoFiles.js new file mode 100644 index 0000000000000..4953a653c3da7 --- /dev/null +++ b/tests/baselines/reference/manyCompilerErrorsInTheTwoFiles.js @@ -0,0 +1,30 @@ +//// [tests/cases/compiler/manyCompilerErrorsInTheTwoFiles.ts] //// + +//// [a.ts] +const a =!@#!@$ +const b = !@#!@#!@#! +OK! +HERE's A shouty thing +GOTTA GO FAST + +//// [b.ts] +fhqwhgads +to +limit + +//// [a.js] +var a = !; +!; +var b = !; +!; +!; +!OK; +HERE; +'s A shouty thing; +GOTTA; +GO; +FAST; +//// [b.js] +fhqwhgads; +to; +limit; diff --git a/tests/baselines/reference/manyCompilerErrorsInTheTwoFiles.symbols b/tests/baselines/reference/manyCompilerErrorsInTheTwoFiles.symbols new file mode 100644 index 0000000000000..921ab9843978a --- /dev/null +++ b/tests/baselines/reference/manyCompilerErrorsInTheTwoFiles.symbols @@ -0,0 +1,16 @@ +=== tests/cases/compiler/a.ts === +const a =!@#!@$ +>a : Symbol(a, Decl(a.ts, 0, 5)) + +const b = !@#!@#!@#! +>b : Symbol(b, Decl(a.ts, 1, 5)) + +OK! +HERE's A shouty thing +GOTTA GO FAST + +=== tests/cases/compiler/b.ts === +fhqwhgads +No type information for this code.to +No type information for this code.limit +No type information for this code. \ No newline at end of file diff --git a/tests/baselines/reference/manyCompilerErrorsInTheTwoFiles.types b/tests/baselines/reference/manyCompilerErrorsInTheTwoFiles.types new file mode 100644 index 0000000000000..fc6bf68b72f0c --- /dev/null +++ b/tests/baselines/reference/manyCompilerErrorsInTheTwoFiles.types @@ -0,0 +1,46 @@ +=== tests/cases/compiler/a.ts === +const a =!@#!@$ +>a : boolean +>! : boolean +> : any +> : any +>! : boolean +> : any +>$ : any + +const b = !@#!@#!@#! +>b : boolean +>! : boolean +> : any +> : any +>! : boolean +> : any +> : any +>! : boolean +> : any +> : any +>!OK! : boolean + +OK! +>OK! : any +>OK : any + +HERE's A shouty thing +>HERE : any +>'s A shouty thing : "s A shouty thing" + +GOTTA GO FAST +>GOTTA : any +>GO : any +>FAST : any + +=== tests/cases/compiler/b.ts === +fhqwhgads +>fhqwhgads : any + +to +>to : any + +limit +>limit : any + diff --git a/tests/baselines/reference/multiLineContextDiagnosticWithPretty.errors.txt b/tests/baselines/reference/multiLineContextDiagnosticWithPretty.errors.txt index 44b13d7ea8e99..6cefca6038e90 100644 --- a/tests/baselines/reference/multiLineContextDiagnosticWithPretty.errors.txt +++ b/tests/baselines/reference/multiLineContextDiagnosticWithPretty.errors.txt @@ -21,5 +21,5 @@ !!! error TS2322: Object literal may only specify known properties, and 'a' does not exist in type '{ c: string; }'. }; -Found 1 error. +Found 1 error in tests/cases/compiler/multiLineContextDiagnosticWithPretty.ts:2 diff --git a/tests/baselines/reference/prettyContextNotDebugAssertion.errors.txt b/tests/baselines/reference/prettyContextNotDebugAssertion.errors.txt index 2bb96b27a9d32..05d9f395bd708 100644 --- a/tests/baselines/reference/prettyContextNotDebugAssertion.errors.txt +++ b/tests/baselines/reference/prettyContextNotDebugAssertion.errors.txt @@ -15,5 +15,5 @@ !!! error TS1005: '}' expected. !!! related TS1007 tests/cases/compiler/index.ts:1:11: The parser expected to find a '}' to match the '{' token here. -Found 1 error. +Found 1 error in tests/cases/compiler/index.ts:2 diff --git a/tests/baselines/reference/prettyFileWithErrorsAndTabs.errors.txt b/tests/baselines/reference/prettyFileWithErrorsAndTabs.errors.txt index e0727c9429b88..0399245a00054 100644 --- a/tests/baselines/reference/prettyFileWithErrorsAndTabs.errors.txt +++ b/tests/baselines/reference/prettyFileWithErrorsAndTabs.errors.txt @@ -26,5 +26,7 @@ !!! error TS2322: Type 'number' is not assignable to type 'string'. } } -Found 3 errors. +Found 3 errors in 1 file. +Errors Files + 3 tests/cases/compiler/prettyFileWithErrorsAndTabs.ts:3 diff --git a/tests/baselines/reference/tsc/composite/initial-build/when-setting-composite-false-on-command-line-but-has-tsbuild-info-in-config.js b/tests/baselines/reference/tsc/composite/initial-build/when-setting-composite-false-on-command-line-but-has-tsbuild-info-in-config.js index 5b9300a30db29..de03acb61d8e4 100644 --- a/tests/baselines/reference/tsc/composite/initial-build/when-setting-composite-false-on-command-line-but-has-tsbuild-info-in-config.js +++ b/tests/baselines/reference/tsc/composite/initial-build/when-setting-composite-false-on-command-line-but-has-tsbuild-info-in-config.js @@ -40,7 +40,7 @@ Output::    ~~~~~~~~~~~~~~~~~ -Found 1 error. +Found 1 error in src/project/tsconfig.json:6 exitCode:: ExitStatus.DiagnosticsPresent_OutputsGenerated diff --git a/tests/baselines/reference/tsc/declarationEmit/when-pkg-references-sibling-package-through-indirect-symlink-moduleCaseChange.js b/tests/baselines/reference/tsc/declarationEmit/when-pkg-references-sibling-package-through-indirect-symlink-moduleCaseChange.js index c190744661c2d..ade471d451e51 100644 --- a/tests/baselines/reference/tsc/declarationEmit/when-pkg-references-sibling-package-through-indirect-symlink-moduleCaseChange.js +++ b/tests/baselines/reference/tsc/declarationEmit/when-pkg-references-sibling-package-through-indirect-symlink-moduleCaseChange.js @@ -78,7 +78,7 @@ pkg3/src/keys.ts pkg3/src/index.ts Matched by include pattern '**/*' in 'pkg3/tsconfig.json' -Found 1 error. +Found 1 error in /user/username/projects/myproject/pkg3/src/keys.ts:2 diff --git a/tests/baselines/reference/tsc/declarationEmit/when-pkg-references-sibling-package-through-indirect-symlink.js b/tests/baselines/reference/tsc/declarationEmit/when-pkg-references-sibling-package-through-indirect-symlink.js index 14407ff2b68e4..a94cec2d01f47 100644 --- a/tests/baselines/reference/tsc/declarationEmit/when-pkg-references-sibling-package-through-indirect-symlink.js +++ b/tests/baselines/reference/tsc/declarationEmit/when-pkg-references-sibling-package-through-indirect-symlink.js @@ -78,7 +78,7 @@ pkg3/src/keys.ts pkg3/src/index.ts Matched by include pattern '**/*' in 'pkg3/tsconfig.json' -Found 1 error. +Found 1 error in /user/username/projects/myproject/pkg3/src/keys.ts:2 diff --git a/tests/baselines/reference/tsc/incremental/initial-build/noEmit-changes-composite.js b/tests/baselines/reference/tsc/incremental/initial-build/noEmit-changes-composite.js index 00e87a60889b2..0bafe3085597c 100644 --- a/tests/baselines/reference/tsc/incremental/initial-build/noEmit-changes-composite.js +++ b/tests/baselines/reference/tsc/incremental/initial-build/noEmit-changes-composite.js @@ -54,7 +54,7 @@ Output::    ~~~~~~~~~~~~~~~~~~ -Found 1 error. +Found 1 error in /src/project/src/noChangeFileWithEmitSpecificError.ts:1 exitCode:: ExitStatus.DiagnosticsPresent_OutputsGenerated @@ -310,8 +310,11 @@ Output:: 'prop1' is declared here. -Found 2 errors. +Found 2 errors in 2 files. +Errors Files + 1 /src/project/src/directUse.ts:2 + 1 /src/project/src/indirectUse.ts:2 exitCode:: ExitStatus.DiagnosticsPresent_OutputsGenerated @@ -497,7 +500,7 @@ Output::    ~~~~~~~~~~~~~~~~~~ -Found 1 error. +Found 1 error in /src/project/src/noChangeFileWithEmitSpecificError.ts:1 exitCode:: ExitStatus.DiagnosticsPresent_OutputsGenerated @@ -631,7 +634,7 @@ Output::    ~~~~~~~~~~~~~~~~~~ -Found 1 error. +Found 1 error in /src/project/src/noChangeFileWithEmitSpecificError.ts:1 exitCode:: ExitStatus.DiagnosticsPresent_OutputsGenerated @@ -672,7 +675,7 @@ Output::    ~~~~~~~~~~~~~~~~~~ -Found 1 error. +Found 1 error in /src/project/src/noChangeFileWithEmitSpecificError.ts:1 exitCode:: ExitStatus.DiagnosticsPresent_OutputsGenerated @@ -716,8 +719,12 @@ Output::    ~~~~~~~~~~~~~~~~~~ -Found 3 errors. +Found 3 errors in 3 files. +Errors Files + 1 /src/project/src/directUse.ts:2 + 1 /src/project/src/indirectUse.ts:2 + 1 /src/project/src/noChangeFileWithEmitSpecificError.ts:1 exitCode:: ExitStatus.DiagnosticsPresent_OutputsGenerated @@ -929,8 +936,12 @@ Output::    ~~~~~~~~~~~~~~~~~~ -Found 3 errors. +Found 3 errors in 3 files. +Errors Files + 1 /src/project/src/directUse.ts:2 + 1 /src/project/src/indirectUse.ts:2 + 1 /src/project/src/noChangeFileWithEmitSpecificError.ts:1 exitCode:: ExitStatus.DiagnosticsPresent_OutputsGenerated @@ -963,8 +974,11 @@ Output:: 'prop1' is declared here. -Found 2 errors. +Found 2 errors in 2 files. +Errors Files + 1 /src/project/src/directUse.ts:2 + 1 /src/project/src/indirectUse.ts:2 exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped @@ -997,8 +1011,11 @@ Output:: 'prop1' is declared here. -Found 2 errors. +Found 2 errors in 2 files. +Errors Files + 1 /src/project/src/directUse.ts:2 + 1 /src/project/src/indirectUse.ts:2 exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped @@ -1036,8 +1053,12 @@ Output::    ~~~~~~~~~~~~~~~~~~ -Found 3 errors. +Found 3 errors in 3 files. +Errors Files + 1 /src/project/src/directUse.ts:2 + 1 /src/project/src/indirectUse.ts:2 + 1 /src/project/src/noChangeFileWithEmitSpecificError.ts:1 exitCode:: ExitStatus.DiagnosticsPresent_OutputsGenerated @@ -1196,7 +1217,7 @@ Output::    ~~~~~~~~~~~~~~~~~~ -Found 1 error. +Found 1 error in /src/project/src/noChangeFileWithEmitSpecificError.ts:1 exitCode:: ExitStatus.DiagnosticsPresent_OutputsGenerated @@ -1367,7 +1388,7 @@ Output::    ~~~~~~~~~~~~~~~~~~ -Found 1 error. +Found 1 error in /src/project/src/noChangeFileWithEmitSpecificError.ts:1 exitCode:: ExitStatus.DiagnosticsPresent_OutputsGenerated diff --git a/tests/baselines/reference/tsc/incremental/initial-build/noEmit-changes-incremental-declaration.js b/tests/baselines/reference/tsc/incremental/initial-build/noEmit-changes-incremental-declaration.js index 9d7312752fb8d..255c963a2e8d4 100644 --- a/tests/baselines/reference/tsc/incremental/initial-build/noEmit-changes-incremental-declaration.js +++ b/tests/baselines/reference/tsc/incremental/initial-build/noEmit-changes-incremental-declaration.js @@ -54,7 +54,7 @@ Output::    ~~~~~~~~~~~~~~~~~~ -Found 1 error. +Found 1 error in /src/project/src/noChangeFileWithEmitSpecificError.ts:1 exitCode:: ExitStatus.DiagnosticsPresent_OutputsGenerated @@ -310,8 +310,11 @@ Output:: 'prop1' is declared here. -Found 2 errors. +Found 2 errors in 2 files. +Errors Files + 1 /src/project/src/directUse.ts:2 + 1 /src/project/src/indirectUse.ts:2 exitCode:: ExitStatus.DiagnosticsPresent_OutputsGenerated @@ -497,7 +500,7 @@ Output::    ~~~~~~~~~~~~~~~~~~ -Found 1 error. +Found 1 error in /src/project/src/noChangeFileWithEmitSpecificError.ts:1 exitCode:: ExitStatus.DiagnosticsPresent_OutputsGenerated @@ -631,7 +634,7 @@ Output::    ~~~~~~~~~~~~~~~~~~ -Found 1 error. +Found 1 error in /src/project/src/noChangeFileWithEmitSpecificError.ts:1 exitCode:: ExitStatus.DiagnosticsPresent_OutputsGenerated @@ -672,7 +675,7 @@ Output::    ~~~~~~~~~~~~~~~~~~ -Found 1 error. +Found 1 error in /src/project/src/noChangeFileWithEmitSpecificError.ts:1 exitCode:: ExitStatus.DiagnosticsPresent_OutputsGenerated @@ -716,8 +719,12 @@ Output::    ~~~~~~~~~~~~~~~~~~ -Found 3 errors. +Found 3 errors in 3 files. +Errors Files + 1 /src/project/src/directUse.ts:2 + 1 /src/project/src/indirectUse.ts:2 + 1 /src/project/src/noChangeFileWithEmitSpecificError.ts:1 exitCode:: ExitStatus.DiagnosticsPresent_OutputsGenerated @@ -929,8 +936,12 @@ Output::    ~~~~~~~~~~~~~~~~~~ -Found 3 errors. +Found 3 errors in 3 files. +Errors Files + 1 /src/project/src/directUse.ts:2 + 1 /src/project/src/indirectUse.ts:2 + 1 /src/project/src/noChangeFileWithEmitSpecificError.ts:1 exitCode:: ExitStatus.DiagnosticsPresent_OutputsGenerated @@ -963,8 +974,11 @@ Output:: 'prop1' is declared here. -Found 2 errors. +Found 2 errors in 2 files. +Errors Files + 1 /src/project/src/directUse.ts:2 + 1 /src/project/src/indirectUse.ts:2 exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped @@ -997,8 +1011,11 @@ Output:: 'prop1' is declared here. -Found 2 errors. +Found 2 errors in 2 files. +Errors Files + 1 /src/project/src/directUse.ts:2 + 1 /src/project/src/indirectUse.ts:2 exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped @@ -1036,8 +1053,12 @@ Output::    ~~~~~~~~~~~~~~~~~~ -Found 3 errors. +Found 3 errors in 3 files. +Errors Files + 1 /src/project/src/directUse.ts:2 + 1 /src/project/src/indirectUse.ts:2 + 1 /src/project/src/noChangeFileWithEmitSpecificError.ts:1 exitCode:: ExitStatus.DiagnosticsPresent_OutputsGenerated @@ -1196,7 +1217,7 @@ Output::    ~~~~~~~~~~~~~~~~~~ -Found 1 error. +Found 1 error in /src/project/src/noChangeFileWithEmitSpecificError.ts:1 exitCode:: ExitStatus.DiagnosticsPresent_OutputsGenerated @@ -1367,7 +1388,7 @@ Output::    ~~~~~~~~~~~~~~~~~~ -Found 1 error. +Found 1 error in /src/project/src/noChangeFileWithEmitSpecificError.ts:1 exitCode:: ExitStatus.DiagnosticsPresent_OutputsGenerated diff --git a/tests/baselines/reference/tsc/incremental/initial-build/noEmit-changes-incremental.js b/tests/baselines/reference/tsc/incremental/initial-build/noEmit-changes-incremental.js index 1a14e535f5118..b9aa470834562 100644 --- a/tests/baselines/reference/tsc/incremental/initial-build/noEmit-changes-incremental.js +++ b/tests/baselines/reference/tsc/incremental/initial-build/noEmit-changes-incremental.js @@ -54,7 +54,7 @@ Output::    ~~~~~~~~~~~~~~~~~~ -Found 1 error. +Found 1 error in /src/project/src/noChangeFileWithEmitSpecificError.ts:1 exitCode:: ExitStatus.DiagnosticsPresent_OutputsGenerated @@ -278,8 +278,11 @@ Output:: 'prop1' is declared here. -Found 2 errors. +Found 2 errors in 2 files. +Errors Files + 1 /src/project/src/directUse.ts:2 + 1 /src/project/src/indirectUse.ts:2 exitCode:: ExitStatus.DiagnosticsPresent_OutputsGenerated @@ -462,7 +465,7 @@ Output::    ~~~~~~~~~~~~~~~~~~ -Found 1 error. +Found 1 error in /src/project/src/noChangeFileWithEmitSpecificError.ts:1 exitCode:: ExitStatus.DiagnosticsPresent_OutputsGenerated @@ -589,7 +592,7 @@ Output::    ~~~~~~~~~~~~~~~~~~ -Found 1 error. +Found 1 error in /src/project/src/noChangeFileWithEmitSpecificError.ts:1 exitCode:: ExitStatus.DiagnosticsPresent_OutputsGenerated @@ -630,7 +633,7 @@ Output::    ~~~~~~~~~~~~~~~~~~ -Found 1 error. +Found 1 error in /src/project/src/noChangeFileWithEmitSpecificError.ts:1 exitCode:: ExitStatus.DiagnosticsPresent_OutputsGenerated @@ -674,8 +677,12 @@ Output::    ~~~~~~~~~~~~~~~~~~ -Found 3 errors. +Found 3 errors in 3 files. +Errors Files + 1 /src/project/src/directUse.ts:2 + 1 /src/project/src/indirectUse.ts:2 + 1 /src/project/src/noChangeFileWithEmitSpecificError.ts:1 exitCode:: ExitStatus.DiagnosticsPresent_OutputsGenerated @@ -875,8 +882,12 @@ Output::    ~~~~~~~~~~~~~~~~~~ -Found 3 errors. +Found 3 errors in 3 files. +Errors Files + 1 /src/project/src/directUse.ts:2 + 1 /src/project/src/indirectUse.ts:2 + 1 /src/project/src/noChangeFileWithEmitSpecificError.ts:1 exitCode:: ExitStatus.DiagnosticsPresent_OutputsGenerated @@ -909,8 +920,11 @@ Output:: 'prop1' is declared here. -Found 2 errors. +Found 2 errors in 2 files. +Errors Files + 1 /src/project/src/directUse.ts:2 + 1 /src/project/src/indirectUse.ts:2 exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped @@ -943,8 +957,11 @@ Output:: 'prop1' is declared here. -Found 2 errors. +Found 2 errors in 2 files. +Errors Files + 1 /src/project/src/directUse.ts:2 + 1 /src/project/src/indirectUse.ts:2 exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped @@ -982,8 +999,12 @@ Output::    ~~~~~~~~~~~~~~~~~~ -Found 3 errors. +Found 3 errors in 3 files. +Errors Files + 1 /src/project/src/directUse.ts:2 + 1 /src/project/src/indirectUse.ts:2 + 1 /src/project/src/noChangeFileWithEmitSpecificError.ts:1 exitCode:: ExitStatus.DiagnosticsPresent_OutputsGenerated @@ -1131,7 +1152,7 @@ Output::    ~~~~~~~~~~~~~~~~~~ -Found 1 error. +Found 1 error in /src/project/src/noChangeFileWithEmitSpecificError.ts:1 exitCode:: ExitStatus.DiagnosticsPresent_OutputsGenerated @@ -1290,7 +1311,7 @@ Output::    ~~~~~~~~~~~~~~~~~~ -Found 1 error. +Found 1 error in /src/project/src/noChangeFileWithEmitSpecificError.ts:1 exitCode:: ExitStatus.DiagnosticsPresent_OutputsGenerated diff --git a/tests/baselines/reference/tsc/incremental/initial-build/noEmit-changes-with-initial-noEmit-composite.js b/tests/baselines/reference/tsc/incremental/initial-build/noEmit-changes-with-initial-noEmit-composite.js index 5213d4ed75ab8..e207a494dd5c7 100644 --- a/tests/baselines/reference/tsc/incremental/initial-build/noEmit-changes-with-initial-noEmit-composite.js +++ b/tests/baselines/reference/tsc/incremental/initial-build/noEmit-changes-with-initial-noEmit-composite.js @@ -198,7 +198,7 @@ Output::    ~~~~~~~~~~~~~~~~~~ -Found 1 error. +Found 1 error in /src/project/src/noChangeFileWithEmitSpecificError.ts:1 exitCode:: ExitStatus.DiagnosticsPresent_OutputsGenerated @@ -437,8 +437,12 @@ Output::    ~~~~~~~~~~~~~~~~~~ -Found 3 errors. +Found 3 errors in 3 files. +Errors Files + 1 /src/project/src/directUse.ts:2 + 1 /src/project/src/indirectUse.ts:2 + 1 /src/project/src/noChangeFileWithEmitSpecificError.ts:1 exitCode:: ExitStatus.DiagnosticsPresent_OutputsGenerated @@ -767,7 +771,7 @@ Output::    ~~~~~~~~~~~~~~~~~~ -Found 1 error. +Found 1 error in /src/project/src/noChangeFileWithEmitSpecificError.ts:1 exitCode:: ExitStatus.DiagnosticsPresent_OutputsGenerated diff --git a/tests/baselines/reference/tsc/incremental/initial-build/noEmit-changes-with-initial-noEmit-incremental-declaration.js b/tests/baselines/reference/tsc/incremental/initial-build/noEmit-changes-with-initial-noEmit-incremental-declaration.js index 5eb4220816300..d03a9e09bb458 100644 --- a/tests/baselines/reference/tsc/incremental/initial-build/noEmit-changes-with-initial-noEmit-incremental-declaration.js +++ b/tests/baselines/reference/tsc/incremental/initial-build/noEmit-changes-with-initial-noEmit-incremental-declaration.js @@ -198,7 +198,7 @@ Output::    ~~~~~~~~~~~~~~~~~~ -Found 1 error. +Found 1 error in /src/project/src/noChangeFileWithEmitSpecificError.ts:1 exitCode:: ExitStatus.DiagnosticsPresent_OutputsGenerated @@ -437,8 +437,12 @@ Output::    ~~~~~~~~~~~~~~~~~~ -Found 3 errors. +Found 3 errors in 3 files. +Errors Files + 1 /src/project/src/directUse.ts:2 + 1 /src/project/src/indirectUse.ts:2 + 1 /src/project/src/noChangeFileWithEmitSpecificError.ts:1 exitCode:: ExitStatus.DiagnosticsPresent_OutputsGenerated @@ -767,7 +771,7 @@ Output::    ~~~~~~~~~~~~~~~~~~ -Found 1 error. +Found 1 error in /src/project/src/noChangeFileWithEmitSpecificError.ts:1 exitCode:: ExitStatus.DiagnosticsPresent_OutputsGenerated diff --git a/tests/baselines/reference/tsc/incremental/initial-build/noEmit-changes-with-initial-noEmit-incremental.js b/tests/baselines/reference/tsc/incremental/initial-build/noEmit-changes-with-initial-noEmit-incremental.js index 187a07d39e44a..bfb25e16e35ab 100644 --- a/tests/baselines/reference/tsc/incremental/initial-build/noEmit-changes-with-initial-noEmit-incremental.js +++ b/tests/baselines/reference/tsc/incremental/initial-build/noEmit-changes-with-initial-noEmit-incremental.js @@ -195,7 +195,7 @@ Output::    ~~~~~~~~~~~~~~~~~~ -Found 1 error. +Found 1 error in /src/project/src/noChangeFileWithEmitSpecificError.ts:1 exitCode:: ExitStatus.DiagnosticsPresent_OutputsGenerated @@ -402,8 +402,12 @@ Output::    ~~~~~~~~~~~~~~~~~~ -Found 3 errors. +Found 3 errors in 3 files. +Errors Files + 1 /src/project/src/directUse.ts:2 + 1 /src/project/src/indirectUse.ts:2 + 1 /src/project/src/noChangeFileWithEmitSpecificError.ts:1 exitCode:: ExitStatus.DiagnosticsPresent_OutputsGenerated @@ -709,7 +713,7 @@ Output::    ~~~~~~~~~~~~~~~~~~ -Found 1 error. +Found 1 error in /src/project/src/noChangeFileWithEmitSpecificError.ts:1 exitCode:: ExitStatus.DiagnosticsPresent_OutputsGenerated diff --git a/tests/baselines/reference/tsc/incremental/initial-build/when-global-file-is-added,-the-signatures-are-updated.js b/tests/baselines/reference/tsc/incremental/initial-build/when-global-file-is-added,-the-signatures-are-updated.js index bbf6f23b6aad7..11de0578f8923 100644 --- a/tests/baselines/reference/tsc/incremental/initial-build/when-global-file-is-added,-the-signatures-are-updated.js +++ b/tests/baselines/reference/tsc/incremental/initial-build/when-global-file-is-added,-the-signatures-are-updated.js @@ -47,8 +47,11 @@ Output::    ~~~~~~~~~~~~~~~~~ -Found 2 errors. +Found 2 errors in 2 files. +Errors Files + 1 /src/project/src/anotherFileWithSameReferenes.ts:2 + 1 /src/project/src/main.ts:2 exitCode:: ExitStatus.DiagnosticsPresent_OutputsGenerated Program root files: ["/src/project/src/anotherFileWithSameReferenes.ts","/src/project/src/filePresent.ts","/src/project/src/main.ts"] Program options: {"composite":true,"project":"/src/project","configFilePath":"/src/project/tsconfig.json"} @@ -196,8 +199,11 @@ Output::    ~~~~~~~~~~~~~~~~~ -Found 2 errors. +Found 2 errors in 2 files. +Errors Files + 1 /src/project/src/anotherFileWithSameReferenes.ts:2 + 1 /src/project/src/main.ts:2 exitCode:: ExitStatus.DiagnosticsPresent_OutputsGenerated Program root files: ["/src/project/src/anotherFileWithSameReferenes.ts","/src/project/src/filePresent.ts","/src/project/src/main.ts"] Program options: {"composite":true,"project":"/src/project","configFilePath":"/src/project/tsconfig.json"} @@ -238,8 +244,11 @@ Output::    ~~~~~~~~~~~~~~~~~ -Found 2 errors. +Found 2 errors in 2 files. +Errors Files + 1 /src/project/src/anotherFileWithSameReferenes.ts:2 + 1 /src/project/src/main.ts:2 exitCode:: ExitStatus.DiagnosticsPresent_OutputsGenerated Program root files: ["/src/project/src/anotherFileWithSameReferenes.ts","/src/project/src/filePresent.ts","/src/project/src/main.ts"] Program options: {"composite":true,"project":"/src/project","configFilePath":"/src/project/tsconfig.json"} @@ -365,8 +374,11 @@ Output::    ~~~~~~~~~~~~~~~~~ -Found 2 errors. +Found 2 errors in 2 files. +Errors Files + 1 /src/project/src/anotherFileWithSameReferenes.ts:2 + 1 /src/project/src/main.ts:2 exitCode:: ExitStatus.DiagnosticsPresent_OutputsGenerated Program root files: ["/src/project/src/anotherFileWithSameReferenes.ts","/src/project/src/filePresent.ts","/src/project/src/main.ts"] Program options: {"composite":true,"project":"/src/project","configFilePath":"/src/project/tsconfig.json"} @@ -488,8 +500,11 @@ Output::    ~~~~~~~~~~~~~~~~~ -Found 2 errors. +Found 2 errors in 2 files. +Errors Files + 1 /src/project/src/anotherFileWithSameReferenes.ts:2 + 1 /src/project/src/main.ts:3 exitCode:: ExitStatus.DiagnosticsPresent_OutputsGenerated Program root files: ["/src/project/src/anotherFileWithSameReferenes.ts","/src/project/src/filePresent.ts","/src/project/src/main.ts","/src/project/src/newFile.ts"] Program options: {"composite":true,"project":"/src/project","configFilePath":"/src/project/tsconfig.json"} diff --git a/tests/baselines/reference/tsc/incremental/initial-build/with-noEmitOnError-semantic-errors.js b/tests/baselines/reference/tsc/incremental/initial-build/with-noEmitOnError-semantic-errors.js index ed383ba64c188..516a69c986b6b 100644 --- a/tests/baselines/reference/tsc/incremental/initial-build/with-noEmitOnError-semantic-errors.js +++ b/tests/baselines/reference/tsc/incremental/initial-build/with-noEmitOnError-semantic-errors.js @@ -46,7 +46,7 @@ Output::    ~ -Found 1 error. +Found 1 error in /src/src/main.ts:2 exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped Program root files: ["/src/shared/types/db.ts","/src/src/main.ts","/src/src/other.ts"] @@ -172,7 +172,7 @@ Output::    ~ -Found 1 error. +Found 1 error in /src/src/main.ts:2 exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped Program root files: ["/src/shared/types/db.ts","/src/src/main.ts","/src/src/other.ts"] diff --git a/tests/baselines/reference/tsc/incremental/initial-build/with-noEmitOnError-syntax-errors.js b/tests/baselines/reference/tsc/incremental/initial-build/with-noEmitOnError-syntax-errors.js index ef2593bfa760b..7a6ee14dcf618 100644 --- a/tests/baselines/reference/tsc/incremental/initial-build/with-noEmitOnError-syntax-errors.js +++ b/tests/baselines/reference/tsc/incremental/initial-build/with-noEmitOnError-syntax-errors.js @@ -53,7 +53,7 @@ Output:: The parser expected to find a '}' to match the '{' token here. -Found 1 error. +Found 1 error in /src/src/main.ts:4 exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped Program root files: ["/src/shared/types/db.ts","/src/src/main.ts","/src/src/other.ts"] @@ -172,7 +172,7 @@ Output:: The parser expected to find a '}' to match the '{' token here. -Found 1 error. +Found 1 error in /src/src/main.ts:4 exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped Program root files: ["/src/shared/types/db.ts","/src/src/main.ts","/src/src/other.ts"] diff --git a/tests/baselines/reference/tsc/projectReferences/initial-build/when-project-contains-invalid-project-reference.js b/tests/baselines/reference/tsc/projectReferences/initial-build/when-project-contains-invalid-project-reference.js index ab55d2a9e860d..30fabb1615c49 100644 --- a/tests/baselines/reference/tsc/projectReferences/initial-build/when-project-contains-invalid-project-reference.js +++ b/tests/baselines/reference/tsc/projectReferences/initial-build/when-project-contains-invalid-project-reference.js @@ -30,7 +30,7 @@ Output::    ~~~~~~~~~~~~~~~~~~~~~~~~ -Found 1 error. +Found 1 error in src/project/tsconfig.json:1 exitCode:: ExitStatus.DiagnosticsPresent_OutputsGenerated diff --git a/tests/baselines/reference/tsc/projectReferences/initial-build/when-project-references-composite-project-with-noEmit.js b/tests/baselines/reference/tsc/projectReferences/initial-build/when-project-references-composite-project-with-noEmit.js index fbdfa2fa4d2d0..bc6c1f88b861d 100644 --- a/tests/baselines/reference/tsc/projectReferences/initial-build/when-project-references-composite-project-with-noEmit.js +++ b/tests/baselines/reference/tsc/projectReferences/initial-build/when-project-references-composite-project-with-noEmit.js @@ -36,7 +36,7 @@ Output::    ~~~~~~~~~~~~~~~~~~~ -Found 1 error. +Found 1 error in src/project/tsconfig.json:1 exitCode:: ExitStatus.DiagnosticsPresent_OutputsGenerated diff --git a/tests/baselines/reference/tsc/react-jsx-emit-mode/initial-build/with-no-backing-types-found-doesn't-crash-under---strict.js b/tests/baselines/reference/tsc/react-jsx-emit-mode/initial-build/with-no-backing-types-found-doesn't-crash-under---strict.js index 79c5719f321f4..86a9065aca427 100644 --- a/tests/baselines/reference/tsc/react-jsx-emit-mode/initial-build/with-no-backing-types-found-doesn't-crash-under---strict.js +++ b/tests/baselines/reference/tsc/react-jsx-emit-mode/initial-build/with-no-backing-types-found-doesn't-crash-under---strict.js @@ -47,7 +47,7 @@ Output::    ~~~~~~~~~~~~~~~~~~~~~~~~ -Found 1 error. +Found 1 error in /src/project/src/index.tsx:1 exitCode:: ExitStatus.DiagnosticsPresent_OutputsGenerated diff --git a/tests/baselines/reference/tscWatch/incremental/editing-module-augmentation-incremental.js b/tests/baselines/reference/tscWatch/incremental/editing-module-augmentation-incremental.js index 6ef212caad514..bdab18ec6c291 100644 --- a/tests/baselines/reference/tscWatch/incremental/editing-module-augmentation-incremental.js +++ b/tests/baselines/reference/tscWatch/incremental/editing-module-augmentation-incremental.js @@ -154,7 +154,7 @@ Output::    ~~~ -Found 1 error. +Found 1 error in /users/username/projects/project/src/index.ts:1 diff --git a/tests/baselines/reference/tscWatch/incremental/importHelpers-backing-types-removed-incremental.js b/tests/baselines/reference/tscWatch/incremental/importHelpers-backing-types-removed-incremental.js index aa213a823a5c7..55375ace094b9 100644 --- a/tests/baselines/reference/tscWatch/incremental/importHelpers-backing-types-removed-incremental.js +++ b/tests/baselines/reference/tscWatch/incremental/importHelpers-backing-types-removed-incremental.js @@ -133,7 +133,7 @@ Output::    ~~~~~ -Found 1 error. +Found 1 error in /users/username/projects/project/index.tsx:1 diff --git a/tests/baselines/reference/tscWatch/incremental/jsxImportSource-backing-types-added-incremental.js b/tests/baselines/reference/tscWatch/incremental/jsxImportSource-backing-types-added-incremental.js index 5f6738131cf8c..bc8105dd86d3f 100644 --- a/tests/baselines/reference/tscWatch/incremental/jsxImportSource-backing-types-added-incremental.js +++ b/tests/baselines/reference/tscWatch/incremental/jsxImportSource-backing-types-added-incremental.js @@ -29,7 +29,7 @@ Output::    ~~~~~~~~~~~~~~~~~~~~~~~~ -Found 1 error. +Found 1 error in /users/username/projects/project/index.tsx:1 diff --git a/tests/baselines/reference/tscWatch/incremental/jsxImportSource-backing-types-removed-incremental.js b/tests/baselines/reference/tscWatch/incremental/jsxImportSource-backing-types-removed-incremental.js index 8bb9352a713e5..98699033c4a63 100644 --- a/tests/baselines/reference/tscWatch/incremental/jsxImportSource-backing-types-removed-incremental.js +++ b/tests/baselines/reference/tscWatch/incremental/jsxImportSource-backing-types-removed-incremental.js @@ -147,7 +147,7 @@ Output::    ~~~~~~~~~~~~~~~~~~~~~~~~ -Found 1 error. +Found 1 error in /users/username/projects/project/index.tsx:1 diff --git a/tests/baselines/reference/tscWatch/incremental/jsxImportSource-option-changed-incremental.js b/tests/baselines/reference/tscWatch/incremental/jsxImportSource-option-changed-incremental.js index ad6442b726541..9ceb94fe14ca4 100644 --- a/tests/baselines/reference/tscWatch/incremental/jsxImportSource-option-changed-incremental.js +++ b/tests/baselines/reference/tscWatch/incremental/jsxImportSource-option-changed-incremental.js @@ -178,7 +178,7 @@ node_modules/preact/jsx-runtime/index.d.ts index.tsx Matched by include pattern '**/*' in 'tsconfig.json' -Found 1 error. +Found 1 error in /users/username/projects/project/index.tsx:1 diff --git a/tests/baselines/reference/tscWatch/incremental/module-compilation/own-file-emit-with-errors-incremental.js b/tests/baselines/reference/tscWatch/incremental/module-compilation/own-file-emit-with-errors-incremental.js index 47e7393ee6165..ef22d97d563f6 100644 --- a/tests/baselines/reference/tscWatch/incremental/module-compilation/own-file-emit-with-errors-incremental.js +++ b/tests/baselines/reference/tscWatch/incremental/module-compilation/own-file-emit-with-errors-incremental.js @@ -30,7 +30,7 @@ Output::    ~ -Found 1 error. +Found 1 error in /users/username/projects/project/file2.ts:1 @@ -146,7 +146,7 @@ Output::    ~ -Found 1 error. +Found 1 error in /users/username/projects/project/file2.ts:1 diff --git a/tests/baselines/reference/tscWatch/incremental/own-file-emit-with-errors-incremental.js b/tests/baselines/reference/tscWatch/incremental/own-file-emit-with-errors-incremental.js index f9b612dfb22b7..81516f788e9ee 100644 --- a/tests/baselines/reference/tscWatch/incremental/own-file-emit-with-errors-incremental.js +++ b/tests/baselines/reference/tscWatch/incremental/own-file-emit-with-errors-incremental.js @@ -30,7 +30,7 @@ Output::    ~ -Found 1 error. +Found 1 error in /users/username/projects/project/file2.ts:1 @@ -135,7 +135,7 @@ Output::    ~ -Found 1 error. +Found 1 error in /users/username/projects/project/file2.ts:1 diff --git a/tests/baselines/reference/tscWatch/incremental/when-file-with-ambient-global-declaration-file-is-deleted-incremental.js b/tests/baselines/reference/tscWatch/incremental/when-file-with-ambient-global-declaration-file-is-deleted-incremental.js index d6496c809d2e9..2072df7bda71b 100644 --- a/tests/baselines/reference/tscWatch/incremental/when-file-with-ambient-global-declaration-file-is-deleted-incremental.js +++ b/tests/baselines/reference/tscWatch/incremental/when-file-with-ambient-global-declaration-file-is-deleted-incremental.js @@ -111,7 +111,7 @@ Output::    ~~~~~~ -Found 1 error. +Found 1 error in /users/username/projects/project/index.ts:1 diff --git a/tests/baselines/reference/typedefCrossModule5.errors.txt b/tests/baselines/reference/typedefCrossModule5.errors.txt index 6ee4682744109..3ba3c314d41d9 100644 --- a/tests/baselines/reference/typedefCrossModule5.errors.txt +++ b/tests/baselines/reference/typedefCrossModule5.errors.txt @@ -56,5 +56,8 @@ !!! error TS2451: Cannot redeclare block-scoped variable 'Bar'. !!! related TS6203 tests/cases/conformance/jsdoc/mod1.js:2:7: 'Bar' was also declared here. -Found 4 errors. +Found 4 errors in 2 files. +Errors Files + 2 tests/cases/conformance/jsdoc/mod1.js:1 + 2 tests/cases/conformance/jsdoc/mod2.js:1 diff --git a/tests/cases/compiler/manyCompilerErrorsInTheTwoFiles.ts b/tests/cases/compiler/manyCompilerErrorsInTheTwoFiles.ts new file mode 100644 index 0000000000000..cddb47e6b595e --- /dev/null +++ b/tests/cases/compiler/manyCompilerErrorsInTheTwoFiles.ts @@ -0,0 +1,12 @@ +// @pretty: true +// @filename: a.ts +const a =!@#!@$ +const b = !@#!@#!@#! +OK! +HERE's A shouty thing +GOTTA GO FAST + +// @filename: b.ts +fhqwhgads +to +limit \ No newline at end of file