Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 5 additions & 22 deletions src/compiler/diagnosticMessages.json
Original file line number Diff line number Diff line change
Expand Up @@ -1539,7 +1539,6 @@
"category": "Error",
"code": 1464
},

"The 'import.meta' meta-property is not allowed in files which will build into CommonJS output.": {
"category": "Error",
"code": 1470
Expand Down Expand Up @@ -1860,7 +1859,6 @@
"category": "Message",
"code": 1549
},

"The types of '{0}' are incompatible between these types.": {
"category": "Error",
"code": 2200
Expand Down Expand Up @@ -1901,7 +1899,6 @@
"category": "Error",
"code": 2208
},

"The project root is ambiguous, but is required to resolve export map entry '{0}' in file '{1}'. Supply the `rootDir` compiler option to disambiguate.": {
"category": "Error",
"code": 2209
Expand All @@ -1918,7 +1915,6 @@
"category": "Message",
"code": 2212
},

"Duplicate identifier '{0}'.": {
"category": "Error",
"code": 2300
Expand Down Expand Up @@ -2899,7 +2895,6 @@
"category": "Error",
"code": 2568
},

"Could not find name '{0}'. Did you mean '{1}'?": {
"category": "Error",
"code": 2570
Expand Down Expand Up @@ -3140,7 +3135,6 @@
"category": "Error",
"code": 2639
},

"Cannot augment module '{0}' with value exports because it resolves to a non-module entity.": {
"category": "Error",
"code": 2649
Expand Down Expand Up @@ -4022,7 +4016,6 @@
"category": "Error",
"code": 2882
},

"Import declaration '{0}' is using private name '{1}'.": {
"category": "Error",
"code": 4000
Expand Down Expand Up @@ -4467,7 +4460,6 @@
"category": "Error",
"code": 4128
},

"The current host does not support the '{0}' option.": {
"category": "Error",
"code": 5001
Expand Down Expand Up @@ -4744,7 +4736,6 @@
"category": "Error",
"code": 5112
},

"Generates a sourcemap for each corresponding '.d.ts' file.": {
"category": "Message",
"code": 6000
Expand Down Expand Up @@ -5401,6 +5392,10 @@
"category": "Message",
"code": 6194
},
"{0} Watching for file changes.": {
"category": "Message",
"code": 6499
},
"Resolve 'keyof' to string valued property names only (no numbers or symbols).": {
"category": "Message",
"code": 6195
Expand Down Expand Up @@ -5688,7 +5683,6 @@
"category": "Error",
"code": 6266
},

"Directory '{0}' has no containing package.json scope. Imports will not resolve.": {
"category": "Message",
"code": 6270
Expand Down Expand Up @@ -5781,7 +5775,6 @@
"category": "Message",
"code": 6294
},

"Enable project compilation": {
"category": "Message",
"code": 6302
Expand Down Expand Up @@ -6064,7 +6057,6 @@
"category": "Message",
"code": 6421
},

"The expected type comes from property '{0}' which is declared here on type '{1}'": {
"category": "Message",
"code": 6500
Expand Down Expand Up @@ -6593,7 +6585,6 @@
"category": "Message",
"code": 6809
},

"one of:": {
"category": "Message",
"code": 6900
Expand All @@ -6610,7 +6601,6 @@
"category": "Message",
"code": 6903
},

"`true`, unless `strict` is `false`": {
"category": "Message",
"code": 6905
Expand Down Expand Up @@ -6723,7 +6713,6 @@
"category": "Message",
"code": 6932
},

"Variable '{0}' implicitly has an '{1}' type.": {
"category": "Error",
"code": 7005
Expand Down Expand Up @@ -6946,7 +6935,6 @@
"category": "Error",
"code": 7061
},

"You cannot rename this element.": {
"category": "Error",
"code": 8000
Expand Down Expand Up @@ -7091,7 +7079,6 @@
"category": "Error",
"code": 8039
},

"Declaration emit for this file requires using private name '{0}'. An explicit type annotation may unblock declaration emit.": {
"category": "Error",
"code": 9005
Expand Down Expand Up @@ -7324,7 +7311,6 @@
"category": "Error",
"code": 18003
},

"File is a CommonJS module; it may be converted to an ES module.": {
"category": "Suggestion",
"code": 80001
Expand Down Expand Up @@ -7365,7 +7351,6 @@
"category": "Suggestion",
"code": 80010
},

"Add missing 'super()' call": {
"category": "Message",
"code": 90001
Expand Down Expand Up @@ -7586,7 +7571,6 @@
"category": "Message",
"code": 90071
},

"Convert function to an ES2015 class": {
"category": "Message",
"code": 95001
Expand Down Expand Up @@ -8355,7 +8339,6 @@
"category": "Message",
"code": 95197
},

"No value exists in scope for the shorthand property '{0}'. Either declare one or provide an initializer.": {
"category": "Error",
"code": 18004
Expand Down Expand Up @@ -8552,4 +8535,4 @@
"category": "Error",
"code": 18061
}
}
}
22 changes: 15 additions & 7 deletions src/compiler/watch.ts
Original file line number Diff line number Diff line change
Expand Up @@ -263,6 +263,14 @@ export function getWatchErrorSummaryDiagnosticMessage(errorCount: number): Diagn
Diagnostics.Found_0_errors_Watching_for_file_changes;
}

export function getWatchErrorSummaryDiagnostic(errorCount: number, filesInError: (ReportFileInError | undefined)[], newLine: string, host: HasCurrentDirectory, options: CompilerOptions): Diagnostic {
if (errorCount === 0) {
return createCompilerDiagnostic(Diagnostics.Found_0_errors_Watching_for_file_changes, 0);
}
const errorSummary = getErrorSummaryText(errorCount, filesInError, newLine, host);
return createCompilerDiagnostic(Diagnostics._0_Watching_for_file_changes, errorSummary);
}

function prettyPathForFileError(error: ReportFileInError, cwd: string) {
const line = formatColorAndReset(":" + error.line, ForegroundColorEscapeSequences.Grey);
if (pathIsAbsolute(error.fileName) && pathIsAbsolute(cwd)) {
Expand Down Expand Up @@ -293,7 +301,7 @@ export function getErrorSummaryText(
else {
messageAndArgs = distinctFileNamesWithLines.length === 0 ? [Diagnostics.Found_0_errors, errorCount] :
distinctFileNamesWithLines.length === 1 ? [Diagnostics.Found_0_errors_in_the_same_file_starting_at_Colon_1, errorCount, firstFileReference] :
[Diagnostics.Found_0_errors_in_1_files, errorCount, distinctFileNamesWithLines.length];
[Diagnostics.Found_0_errors_in_1_files, errorCount, distinctFileNamesWithLines.length];
}

const d = createCompilerDiagnostic(...messageAndArgs);
Expand Down Expand Up @@ -524,8 +532,8 @@ export function fileIncludeReasonToDiagnostics(program: Program, reason: FileInc
Diagnostics.Output_from_referenced_project_0_included_because_1_specified :
Diagnostics.Source_from_referenced_project_0_included_because_1_specified :
isOutput ?
Diagnostics.Output_from_referenced_project_0_included_because_module_is_specified_as_none :
Diagnostics.Source_from_referenced_project_0_included_because_module_is_specified_as_none,
Diagnostics.Output_from_referenced_project_0_included_because_module_is_specified_as_none :
Diagnostics.Source_from_referenced_project_0_included_because_module_is_specified_as_none,
toFileName(referencedResolvedRef.sourceFile.fileName, fileNameConvertor),
options.outFile ? "--outFile" : "--out",
);
Expand All @@ -535,8 +543,8 @@ export function fileIncludeReasonToDiagnostics(program: Program, reason: FileInc
[Diagnostics.Entry_point_of_type_library_0_specified_in_compilerOptions_with_packageId_1, reason.typeReference, packageIdToString(reason.packageId)] :
[Diagnostics.Entry_point_of_type_library_0_specified_in_compilerOptions, reason.typeReference] :
reason.packageId ?
[Diagnostics.Entry_point_for_implicit_type_library_0_with_packageId_1, reason.typeReference, packageIdToString(reason.packageId)] :
[Diagnostics.Entry_point_for_implicit_type_library_0, reason.typeReference];
[Diagnostics.Entry_point_for_implicit_type_library_0_with_packageId_1, reason.typeReference, packageIdToString(reason.packageId)] :
[Diagnostics.Entry_point_for_implicit_type_library_0, reason.typeReference];

return chainDiagnosticMessages(/*details*/ undefined, ...messageAndArgs);
}
Expand Down Expand Up @@ -880,9 +888,9 @@ function createWatchCompilerHost<T extends BuilderProgram = EmitAndSemanticDiagn
builderProgram,
reportDiagnostic,
write,
errorCount =>
(errorCount, filesInError) =>
result.onWatchStatusChange!(
createCompilerDiagnostic(getWatchErrorSummaryDiagnosticMessage(errorCount), errorCount),
getWatchErrorSummaryDiagnostic(errorCount, filesInError, newLine, result, compilerOptions),
newLine,
compilerOptions,
errorCount,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,10 @@ Output::
4 "outFile": "/home/src/projects/a/b/out.js"
   ~~~~~~~~~

[HH:MM:SS AM] Found 2 errors. Watching for file changes.
[HH:MM:SS AM]
Found 2 errors in the same file, starting at: tsconfig.json:3

Watching for file changes.



Expand Down Expand Up @@ -186,7 +189,10 @@ Output::
4 "outFile": "/home/src/projects/a/b/out.js"
   ~~~~~~~~~

[HH:MM:SS AM] Found 2 errors. Watching for file changes.
[HH:MM:SS AM]
Found 2 errors in the same file, starting at: tsconfig.json:3

Watching for file changes.



Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,10 @@ Output::
1 export let y = Foo();
   ~~~

[HH:MM:SS AM] Found 1 error. Watching for file changes.
[HH:MM:SS AM]
Found 1 error in file1Consumer1.ts:1

Watching for file changes.



Expand Down Expand Up @@ -211,7 +214,10 @@ Output::
1 export let y = Foo();
   ~~~

[HH:MM:SS AM] Found 1 error. Watching for file changes.
[HH:MM:SS AM]
Found 1 error in file1Consumer1.ts:1

Watching for file changes.



Expand Down Expand Up @@ -346,7 +352,14 @@ Output::
1 export let y = Foo();
   ~~~

[HH:MM:SS AM] Found 3 errors. Watching for file changes.
[HH:MM:SS AM]
Found 3 errors in 3 files.

Errors Files
1 file1Consumer1.ts:1
1 file1Consumer2.ts:1
1 moduleFile1.ts:1
Watching for file changes.



Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,10 @@ Output::
2 export var x = Foo();
   ~~~

[HH:MM:SS AM] Found 2 errors. Watching for file changes.
[HH:MM:SS AM]
Found 2 errors in the same file, starting at: referenceFile1.ts:1

Watching for file changes.



Expand Down Expand Up @@ -122,7 +125,10 @@ Output::
2 export var x = Foo();export var yy = Foo();
   ~~~

[HH:MM:SS AM] Found 3 errors. Watching for file changes.
[HH:MM:SS AM]
Found 3 errors in the same file, starting at: referenceFile1.ts:1

Watching for file changes.



Expand Down Expand Up @@ -199,7 +205,10 @@ Output::
2 export var x = Foo();export var yy = Foo();
   ~~~

[HH:MM:SS AM] Found 2 errors. Watching for file changes.
[HH:MM:SS AM]
Found 2 errors in the same file, starting at: referenceFile1.ts:2

Watching for file changes.



Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,10 @@ Output::
2 export var x = Foo();
   ~~~

[HH:MM:SS AM] Found 1 error. Watching for file changes.
[HH:MM:SS AM]
Found 1 error in referenceFile1.ts:2

Watching for file changes.



Expand Down Expand Up @@ -119,7 +122,10 @@ Output::
2 export var x = Foo();
   ~~~

[HH:MM:SS AM] Found 2 errors. Watching for file changes.
[HH:MM:SS AM]
Found 2 errors in the same file, starting at: referenceFile1.ts:1

Watching for file changes.



Expand Down
Loading