typescript 4.6.0-dev.20211207 → 4.6.0-dev.20211208

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/lib/lib.es5.d.ts CHANGED
@@ -1515,7 +1515,7 @@ interface Promise<T> {
1515
1515
  type Awaited<T> =
1516
1516
  T extends null | undefined ? T : // special case for `null | undefined` when not in `--strictNullChecks` mode
1517
1517
  T extends object & { then(onfulfilled: infer F): any } ? // `await` only unwraps object types with a callable `then`. Non-object types are not unwrapped
1518
- F extends ((value: infer V) => any) ? // if the argument to `then` is callable, extracts the argument
1518
+ F extends ((value: infer V, ...args: any) => any) ? // if the argument to `then` is callable, extracts the first argument
1519
1519
  Awaited<V> : // recursively unwrap the value
1520
1520
  never : // the argument to `then` was not callable
1521
1521
  T; // non-object or non-thenable
package/lib/tsc.js CHANGED
@@ -69,7 +69,7 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
69
69
  var ts;
70
70
  (function (ts) {
71
71
  ts.versionMajorMinor = "4.6";
72
- ts.version = ts.versionMajorMinor + ".0-dev.20211207";
72
+ ts.version = ts.versionMajorMinor + ".0-dev.20211208";
73
73
  var NativeCollections;
74
74
  (function (NativeCollections) {
75
75
  function tryGetNativeMap() {
@@ -6103,6 +6103,7 @@ var ts;
6103
6103
  DIRECTORY: diag(6038, ts.DiagnosticCategory.Message, "DIRECTORY_6038", "DIRECTORY"),
6104
6104
  STRATEGY: diag(6039, ts.DiagnosticCategory.Message, "STRATEGY_6039", "STRATEGY"),
6105
6105
  FILE_OR_DIRECTORY: diag(6040, ts.DiagnosticCategory.Message, "FILE_OR_DIRECTORY_6040", "FILE OR DIRECTORY"),
6106
+ Errors_Files: diag(6041, ts.DiagnosticCategory.Message, "Errors_Files_6041", "Errors Files"),
6106
6107
  Generates_corresponding_map_file: diag(6043, ts.DiagnosticCategory.Message, "Generates_corresponding_map_file_6043", "Generates corresponding '.map' file."),
6107
6108
  Compiler_option_0_expects_an_argument: diag(6044, ts.DiagnosticCategory.Error, "Compiler_option_0_expects_an_argument_6044", "Compiler option '{0}' expects an argument."),
6108
6109
  Unterminated_quoted_string_in_response_file_0: diag(6045, ts.DiagnosticCategory.Error, "Unterminated_quoted_string_in_response_file_0_6045", "Unterminated quoted string in response file '{0}'."),
@@ -6296,6 +6297,9 @@ var ts;
6296
6297
  Output_Formatting: diag(6256, ts.DiagnosticCategory.Message, "Output_Formatting_6256", "Output Formatting"),
6297
6298
  Completeness: diag(6257, ts.DiagnosticCategory.Message, "Completeness_6257", "Completeness"),
6298
6299
  _0_should_be_set_inside_the_compilerOptions_object_of_the_config_json_file: diag(6258, ts.DiagnosticCategory.Error, "_0_should_be_set_inside_the_compilerOptions_object_of_the_config_json_file_6258", "'{0}' should be set inside the 'compilerOptions' object of the config json file"),
6300
+ Found_1_error_in_1: diag(6259, ts.DiagnosticCategory.Message, "Found_1_error_in_1_6259", "Found 1 error in {1}"),
6301
+ Found_0_errors_in_1_file: diag(6260, ts.DiagnosticCategory.Message, "Found_0_errors_in_1_file_6260", "Found {0} errors in 1 file."),
6302
+ Found_0_errors_in_1_files: diag(6261, ts.DiagnosticCategory.Message, "Found_0_errors_in_1_files_6261", "Found {0} errors in {1} files."),
6299
6303
  Directory_0_has_no_containing_package_json_scope_Imports_will_not_resolve: diag(6270, ts.DiagnosticCategory.Message, "Directory_0_has_no_containing_package_json_scope_Imports_will_not_resolve_6270", "Directory '{0}' has no containing package.json scope. Imports will not resolve."),
6300
6304
  Import_specifier_0_does_not_exist_in_package_json_scope_at_path_1: diag(6271, ts.DiagnosticCategory.Message, "Import_specifier_0_does_not_exist_in_package_json_scope_at_path_1_6271", "Import specifier '{0}' does not exist in package.json scope at path '{1}'."),
6301
6305
  Invalid_import_specifier_0_has_no_possible_resolutions: diag(6272, ts.DiagnosticCategory.Message, "Invalid_import_specifier_0_has_no_possible_resolutions_6272", "Invalid import specifier '{0}' has no possible resolutions."),
@@ -99013,19 +99017,74 @@ var ts;
99013
99017
  return ts.countWhere(diagnostics, function (diagnostic) { return diagnostic.category === ts.DiagnosticCategory.Error; });
99014
99018
  }
99015
99019
  ts.getErrorCountForSummary = getErrorCountForSummary;
99020
+ function getFilesInErrorForSummary(diagnostics) {
99021
+ var filesInError = ts.filter(diagnostics, function (diagnostic) { return diagnostic.category === ts.DiagnosticCategory.Error; })
99022
+ .map(function (errorDiagnostic) {
99023
+ if (errorDiagnostic.file === undefined)
99024
+ return;
99025
+ return "" + errorDiagnostic.file.fileName;
99026
+ });
99027
+ return filesInError.map(function (fileName) {
99028
+ var diagnosticForFileName = ts.find(diagnostics, function (diagnostic) {
99029
+ return diagnostic.file !== undefined && diagnostic.file.fileName === fileName;
99030
+ });
99031
+ if (diagnosticForFileName !== undefined) {
99032
+ var line = ts.getLineAndCharacterOfPosition(diagnosticForFileName.file, diagnosticForFileName.start).line;
99033
+ return {
99034
+ fileName: fileName,
99035
+ line: line + 1,
99036
+ };
99037
+ }
99038
+ });
99039
+ }
99040
+ ts.getFilesInErrorForSummary = getFilesInErrorForSummary;
99016
99041
  function getWatchErrorSummaryDiagnosticMessage(errorCount) {
99017
99042
  return errorCount === 1 ?
99018
99043
  ts.Diagnostics.Found_1_error_Watching_for_file_changes :
99019
99044
  ts.Diagnostics.Found_0_errors_Watching_for_file_changes;
99020
99045
  }
99021
99046
  ts.getWatchErrorSummaryDiagnosticMessage = getWatchErrorSummaryDiagnosticMessage;
99022
- function getErrorSummaryText(errorCount, newLine) {
99047
+ function getErrorSummaryText(errorCount, filesInError, newLine) {
99023
99048
  if (errorCount === 0)
99024
99049
  return "";
99025
- var d = ts.createCompilerDiagnostic(errorCount === 1 ? ts.Diagnostics.Found_1_error : ts.Diagnostics.Found_0_errors, errorCount);
99026
- return "" + newLine + ts.flattenDiagnosticMessageText(d.messageText, newLine) + newLine + newLine;
99050
+ var nonNilFiles = filesInError.filter(function (fileInError) { return fileInError !== undefined; });
99051
+ var distinctFileNamesWithLines = nonNilFiles.map(function (fileInError) { return fileInError.fileName + ":" + fileInError.line; })
99052
+ .filter(function (value, index, self) { return self.indexOf(value) === index; });
99053
+ var d = errorCount === 1 ?
99054
+ ts.createCompilerDiagnostic(filesInError[0] !== undefined ?
99055
+ ts.Diagnostics.Found_1_error_in_1 :
99056
+ ts.Diagnostics.Found_1_error, errorCount, distinctFileNamesWithLines[0]) :
99057
+ ts.createCompilerDiagnostic(distinctFileNamesWithLines.length === 0 ?
99058
+ ts.Diagnostics.Found_0_errors :
99059
+ distinctFileNamesWithLines.length === 1 ?
99060
+ ts.Diagnostics.Found_0_errors_in_1_file :
99061
+ ts.Diagnostics.Found_0_errors_in_1_files, errorCount, distinctFileNamesWithLines.length);
99062
+ return "" + newLine + ts.flattenDiagnosticMessageText(d.messageText, newLine) + newLine + newLine + (errorCount > 1 ? createTabularErrorsDisplay(nonNilFiles) : "");
99027
99063
  }
99028
99064
  ts.getErrorSummaryText = getErrorSummaryText;
99065
+ function createTabularErrorsDisplay(filesInError) {
99066
+ var distinctFiles = filesInError.filter(function (value, index, self) { return index === self.findIndex(function (file) { return (file === null || file === void 0 ? void 0 : file.fileName) === (value === null || value === void 0 ? void 0 : value.fileName); }); });
99067
+ if (distinctFiles.length === 0)
99068
+ return "";
99069
+ var numberLength = function (num) { return Math.log(num) * Math.LOG10E + 1; };
99070
+ var fileToErrorCount = distinctFiles.map(function (file) { return [file, ts.countWhere(filesInError, function (fileInError) { return fileInError.fileName === file.fileName; })]; });
99071
+ var maxErrors = fileToErrorCount.reduce(function (acc, value) { return Math.max(acc, value[1] || 0); }, 0);
99072
+ var headerRow = ts.Diagnostics.Errors_Files.message;
99073
+ var leftColumnHeadingLength = headerRow.split(" ")[0].length;
99074
+ var leftPaddingGoal = Math.max(leftColumnHeadingLength, numberLength(maxErrors));
99075
+ var headerPadding = Math.max(numberLength(maxErrors) - leftColumnHeadingLength, 0);
99076
+ var tabularData = "";
99077
+ tabularData += " ".repeat(headerPadding) + headerRow + "\n";
99078
+ fileToErrorCount.forEach(function (row) {
99079
+ var file = row[0], errorCount = row[1];
99080
+ var errorCountDigitsLength = Math.log(errorCount) * Math.LOG10E + 1 | 0;
99081
+ var leftPadding = errorCountDigitsLength < leftPaddingGoal ?
99082
+ " ".repeat(leftPaddingGoal - errorCountDigitsLength)
99083
+ : "";
99084
+ tabularData += "" + leftPadding + errorCount + " " + file.fileName + ":" + file.line + "\n";
99085
+ });
99086
+ return tabularData;
99087
+ }
99029
99088
  function isBuilderProgram(program) {
99030
99089
  return !!program.getState;
99031
99090
  }
@@ -99214,7 +99273,7 @@ var ts;
99214
99273
  listFiles(program, write);
99215
99274
  }
99216
99275
  if (reportSummary) {
99217
- reportSummary(getErrorCountForSummary(diagnostics));
99276
+ reportSummary(getErrorCountForSummary(diagnostics), getFilesInErrorForSummary(diagnostics));
99218
99277
  }
99219
99278
  return {
99220
99279
  emitResult: emitResult,
@@ -99404,7 +99463,7 @@ var ts;
99404
99463
  var system = input.system || ts.sys;
99405
99464
  var host = input.host || (input.host = ts.createIncrementalCompilerHost(input.options, system));
99406
99465
  var builderProgram = ts.createIncrementalProgram(input);
99407
- var exitStatus = emitFilesAndReportErrorsAndGetExitStatus(builderProgram, input.reportDiagnostic || createDiagnosticReporter(system), function (s) { return host.trace && host.trace(s); }, input.reportErrorSummary || input.options.pretty ? function (errorCount) { return system.write(getErrorSummaryText(errorCount, system.newLine)); } : undefined);
99466
+ var exitStatus = emitFilesAndReportErrorsAndGetExitStatus(builderProgram, input.reportDiagnostic || createDiagnosticReporter(system), function (s) { return host.trace && host.trace(s); }, input.reportErrorSummary || input.options.pretty ? function (errorCount, filesInError) { return system.write(getErrorSummaryText(errorCount, filesInError, system.newLine)); } : undefined);
99408
99467
  if (input.afterProgramEmitAndDiagnostics)
99409
99468
  input.afterProgramEmitAndDiagnostics(builderProgram);
99410
99469
  return exitStatus;
@@ -101462,11 +101521,14 @@ var ts;
101462
101521
  var canReportSummary = state.watch || !!state.host.reportErrorSummary;
101463
101522
  var diagnostics = state.diagnostics;
101464
101523
  var totalErrors = 0;
101524
+ var filesInError = [];
101465
101525
  if (isCircularBuildOrder(buildOrder)) {
101466
101526
  reportBuildQueue(state, buildOrder.buildOrder);
101467
101527
  reportErrors(state, buildOrder.circularDiagnostics);
101468
101528
  if (canReportSummary)
101469
101529
  totalErrors += ts.getErrorCountForSummary(buildOrder.circularDiagnostics);
101530
+ if (canReportSummary)
101531
+ filesInError = __spreadArray(__spreadArray([], filesInError, true), ts.getFilesInErrorForSummary(buildOrder.circularDiagnostics), true);
101470
101532
  }
101471
101533
  else {
101472
101534
  buildOrder.forEach(function (project) {
@@ -101477,12 +101539,14 @@ var ts;
101477
101539
  });
101478
101540
  if (canReportSummary)
101479
101541
  diagnostics.forEach(function (singleProjectErrors) { return totalErrors += ts.getErrorCountForSummary(singleProjectErrors); });
101542
+ if (canReportSummary)
101543
+ diagnostics.forEach(function (singleProjectErrors) { return __spreadArray(__spreadArray([], filesInError, true), ts.getFilesInErrorForSummary(singleProjectErrors), true); });
101480
101544
  }
101481
101545
  if (state.watch) {
101482
101546
  reportWatchStatus(state, ts.getWatchErrorSummaryDiagnosticMessage(totalErrors), totalErrors);
101483
101547
  }
101484
101548
  else if (state.host.reportErrorSummary) {
101485
- state.host.reportErrorSummary(totalErrors);
101549
+ state.host.reportErrorSummary(totalErrors, filesInError);
101486
101550
  }
101487
101551
  }
101488
101552
  function reportBuildQueue(state, buildQueue) {
@@ -102109,7 +102173,7 @@ var ts;
102109
102173
  }
102110
102174
  function createReportErrorSummary(sys, options) {
102111
102175
  return shouldBePretty(sys, options) ?
102112
- function (errorCount) { return sys.write(ts.getErrorSummaryText(errorCount, sys.newLine)); } :
102176
+ function (errorCount, filesInError) { return sys.write(ts.getErrorSummaryText(errorCount, filesInError, sys.newLine)); } :
102113
102177
  undefined;
102114
102178
  }
102115
102179
  function performCompilation(sys, cb, reportDiagnostic, config) {
package/lib/tsserver.js CHANGED
@@ -100,7 +100,7 @@ var ts;
100
100
  // The following is baselined as a literal template type without intervention
101
101
  /** The version of the TypeScript compiler release */
102
102
  // eslint-disable-next-line @typescript-eslint/no-inferrable-types
103
- ts.version = ts.versionMajorMinor + ".0-dev.20211207";
103
+ ts.version = ts.versionMajorMinor + ".0-dev.20211208";
104
104
  /* @internal */
105
105
  var Comparison;
106
106
  (function (Comparison) {
@@ -8889,6 +8889,7 @@ var ts;
8889
8889
  DIRECTORY: diag(6038, ts.DiagnosticCategory.Message, "DIRECTORY_6038", "DIRECTORY"),
8890
8890
  STRATEGY: diag(6039, ts.DiagnosticCategory.Message, "STRATEGY_6039", "STRATEGY"),
8891
8891
  FILE_OR_DIRECTORY: diag(6040, ts.DiagnosticCategory.Message, "FILE_OR_DIRECTORY_6040", "FILE OR DIRECTORY"),
8892
+ Errors_Files: diag(6041, ts.DiagnosticCategory.Message, "Errors_Files_6041", "Errors Files"),
8892
8893
  Generates_corresponding_map_file: diag(6043, ts.DiagnosticCategory.Message, "Generates_corresponding_map_file_6043", "Generates corresponding '.map' file."),
8893
8894
  Compiler_option_0_expects_an_argument: diag(6044, ts.DiagnosticCategory.Error, "Compiler_option_0_expects_an_argument_6044", "Compiler option '{0}' expects an argument."),
8894
8895
  Unterminated_quoted_string_in_response_file_0: diag(6045, ts.DiagnosticCategory.Error, "Unterminated_quoted_string_in_response_file_0_6045", "Unterminated quoted string in response file '{0}'."),
@@ -9082,6 +9083,9 @@ var ts;
9082
9083
  Output_Formatting: diag(6256, ts.DiagnosticCategory.Message, "Output_Formatting_6256", "Output Formatting"),
9083
9084
  Completeness: diag(6257, ts.DiagnosticCategory.Message, "Completeness_6257", "Completeness"),
9084
9085
  _0_should_be_set_inside_the_compilerOptions_object_of_the_config_json_file: diag(6258, ts.DiagnosticCategory.Error, "_0_should_be_set_inside_the_compilerOptions_object_of_the_config_json_file_6258", "'{0}' should be set inside the 'compilerOptions' object of the config json file"),
9086
+ Found_1_error_in_1: diag(6259, ts.DiagnosticCategory.Message, "Found_1_error_in_1_6259", "Found 1 error in {1}"),
9087
+ Found_0_errors_in_1_file: diag(6260, ts.DiagnosticCategory.Message, "Found_0_errors_in_1_file_6260", "Found {0} errors in 1 file."),
9088
+ Found_0_errors_in_1_files: diag(6261, ts.DiagnosticCategory.Message, "Found_0_errors_in_1_files_6261", "Found {0} errors in {1} files."),
9085
9089
  Directory_0_has_no_containing_package_json_scope_Imports_will_not_resolve: diag(6270, ts.DiagnosticCategory.Message, "Directory_0_has_no_containing_package_json_scope_Imports_will_not_resolve_6270", "Directory '{0}' has no containing package.json scope. Imports will not resolve."),
9086
9090
  Import_specifier_0_does_not_exist_in_package_json_scope_at_path_1: diag(6271, ts.DiagnosticCategory.Message, "Import_specifier_0_does_not_exist_in_package_json_scope_at_path_1_6271", "Import specifier '{0}' does not exist in package.json scope at path '{1}'."),
9087
9091
  Invalid_import_specifier_0_has_no_possible_resolutions: diag(6272, ts.DiagnosticCategory.Message, "Invalid_import_specifier_0_has_no_possible_resolutions_6272", "Invalid import specifier '{0}' has no possible resolutions."),
@@ -119725,7 +119729,7 @@ var ts;
119725
119729
  getCanonicalFileName: ts.createGetCanonicalFileName(ts.sys.useCaseSensitiveFileNames)
119726
119730
  } : undefined;
119727
119731
  /**
119728
- * Create a function that reports error by writing to the system and handles the formating of the diagnostic
119732
+ * Create a function that reports error by writing to the system and handles the formatting of the diagnostic
119729
119733
  */
119730
119734
  function createDiagnosticReporter(system, pretty) {
119731
119735
  var host = system === ts.sys && sysFormatDiagnosticsHost ? sysFormatDiagnosticsHost : {
@@ -119811,19 +119815,74 @@ var ts;
119811
119815
  return ts.countWhere(diagnostics, function (diagnostic) { return diagnostic.category === ts.DiagnosticCategory.Error; });
119812
119816
  }
119813
119817
  ts.getErrorCountForSummary = getErrorCountForSummary;
119818
+ function getFilesInErrorForSummary(diagnostics) {
119819
+ var filesInError = ts.filter(diagnostics, function (diagnostic) { return diagnostic.category === ts.DiagnosticCategory.Error; })
119820
+ .map(function (errorDiagnostic) {
119821
+ if (errorDiagnostic.file === undefined)
119822
+ return;
119823
+ return "" + errorDiagnostic.file.fileName;
119824
+ });
119825
+ return filesInError.map(function (fileName) {
119826
+ var diagnosticForFileName = ts.find(diagnostics, function (diagnostic) {
119827
+ return diagnostic.file !== undefined && diagnostic.file.fileName === fileName;
119828
+ });
119829
+ if (diagnosticForFileName !== undefined) {
119830
+ var line = ts.getLineAndCharacterOfPosition(diagnosticForFileName.file, diagnosticForFileName.start).line;
119831
+ return {
119832
+ fileName: fileName,
119833
+ line: line + 1,
119834
+ };
119835
+ }
119836
+ });
119837
+ }
119838
+ ts.getFilesInErrorForSummary = getFilesInErrorForSummary;
119814
119839
  function getWatchErrorSummaryDiagnosticMessage(errorCount) {
119815
119840
  return errorCount === 1 ?
119816
119841
  ts.Diagnostics.Found_1_error_Watching_for_file_changes :
119817
119842
  ts.Diagnostics.Found_0_errors_Watching_for_file_changes;
119818
119843
  }
119819
119844
  ts.getWatchErrorSummaryDiagnosticMessage = getWatchErrorSummaryDiagnosticMessage;
119820
- function getErrorSummaryText(errorCount, newLine) {
119845
+ function getErrorSummaryText(errorCount, filesInError, newLine) {
119821
119846
  if (errorCount === 0)
119822
119847
  return "";
119823
- var d = ts.createCompilerDiagnostic(errorCount === 1 ? ts.Diagnostics.Found_1_error : ts.Diagnostics.Found_0_errors, errorCount);
119824
- return "" + newLine + ts.flattenDiagnosticMessageText(d.messageText, newLine) + newLine + newLine;
119848
+ var nonNilFiles = filesInError.filter(function (fileInError) { return fileInError !== undefined; });
119849
+ var distinctFileNamesWithLines = nonNilFiles.map(function (fileInError) { return fileInError.fileName + ":" + fileInError.line; })
119850
+ .filter(function (value, index, self) { return self.indexOf(value) === index; });
119851
+ var d = errorCount === 1 ?
119852
+ ts.createCompilerDiagnostic(filesInError[0] !== undefined ?
119853
+ ts.Diagnostics.Found_1_error_in_1 :
119854
+ ts.Diagnostics.Found_1_error, errorCount, distinctFileNamesWithLines[0]) :
119855
+ ts.createCompilerDiagnostic(distinctFileNamesWithLines.length === 0 ?
119856
+ ts.Diagnostics.Found_0_errors :
119857
+ distinctFileNamesWithLines.length === 1 ?
119858
+ ts.Diagnostics.Found_0_errors_in_1_file :
119859
+ ts.Diagnostics.Found_0_errors_in_1_files, errorCount, distinctFileNamesWithLines.length);
119860
+ return "" + newLine + ts.flattenDiagnosticMessageText(d.messageText, newLine) + newLine + newLine + (errorCount > 1 ? createTabularErrorsDisplay(nonNilFiles) : "");
119825
119861
  }
119826
119862
  ts.getErrorSummaryText = getErrorSummaryText;
119863
+ function createTabularErrorsDisplay(filesInError) {
119864
+ var distinctFiles = filesInError.filter(function (value, index, self) { return index === self.findIndex(function (file) { return (file === null || file === void 0 ? void 0 : file.fileName) === (value === null || value === void 0 ? void 0 : value.fileName); }); });
119865
+ if (distinctFiles.length === 0)
119866
+ return "";
119867
+ var numberLength = function (num) { return Math.log(num) * Math.LOG10E + 1; };
119868
+ var fileToErrorCount = distinctFiles.map(function (file) { return [file, ts.countWhere(filesInError, function (fileInError) { return fileInError.fileName === file.fileName; })]; });
119869
+ var maxErrors = fileToErrorCount.reduce(function (acc, value) { return Math.max(acc, value[1] || 0); }, 0);
119870
+ var headerRow = ts.Diagnostics.Errors_Files.message;
119871
+ var leftColumnHeadingLength = headerRow.split(" ")[0].length;
119872
+ var leftPaddingGoal = Math.max(leftColumnHeadingLength, numberLength(maxErrors));
119873
+ var headerPadding = Math.max(numberLength(maxErrors) - leftColumnHeadingLength, 0);
119874
+ var tabularData = "";
119875
+ tabularData += " ".repeat(headerPadding) + headerRow + "\n";
119876
+ fileToErrorCount.forEach(function (row) {
119877
+ var file = row[0], errorCount = row[1];
119878
+ var errorCountDigitsLength = Math.log(errorCount) * Math.LOG10E + 1 | 0;
119879
+ var leftPadding = errorCountDigitsLength < leftPaddingGoal ?
119880
+ " ".repeat(leftPaddingGoal - errorCountDigitsLength)
119881
+ : "";
119882
+ tabularData += "" + leftPadding + errorCount + " " + file.fileName + ":" + file.line + "\n";
119883
+ });
119884
+ return tabularData;
119885
+ }
119827
119886
  function isBuilderProgram(program) {
119828
119887
  return !!program.getState;
119829
119888
  }
@@ -120027,7 +120086,7 @@ var ts;
120027
120086
  listFiles(program, write);
120028
120087
  }
120029
120088
  if (reportSummary) {
120030
- reportSummary(getErrorCountForSummary(diagnostics));
120089
+ reportSummary(getErrorCountForSummary(diagnostics), getFilesInErrorForSummary(diagnostics));
120031
120090
  }
120032
120091
  return {
120033
120092
  emitResult: emitResult,
@@ -120238,7 +120297,7 @@ var ts;
120238
120297
  var system = input.system || ts.sys;
120239
120298
  var host = input.host || (input.host = ts.createIncrementalCompilerHost(input.options, system));
120240
120299
  var builderProgram = ts.createIncrementalProgram(input);
120241
- var exitStatus = emitFilesAndReportErrorsAndGetExitStatus(builderProgram, input.reportDiagnostic || createDiagnosticReporter(system), function (s) { return host.trace && host.trace(s); }, input.reportErrorSummary || input.options.pretty ? function (errorCount) { return system.write(getErrorSummaryText(errorCount, system.newLine)); } : undefined);
120300
+ var exitStatus = emitFilesAndReportErrorsAndGetExitStatus(builderProgram, input.reportDiagnostic || createDiagnosticReporter(system), function (s) { return host.trace && host.trace(s); }, input.reportErrorSummary || input.options.pretty ? function (errorCount, filesInError) { return system.write(getErrorSummaryText(errorCount, filesInError, system.newLine)); } : undefined);
120242
120301
  if (input.afterProgramEmitAndDiagnostics)
120243
120302
  input.afterProgramEmitAndDiagnostics(builderProgram);
120244
120303
  return exitStatus;
@@ -122457,11 +122516,14 @@ var ts;
122457
122516
  var canReportSummary = state.watch || !!state.host.reportErrorSummary;
122458
122517
  var diagnostics = state.diagnostics;
122459
122518
  var totalErrors = 0;
122519
+ var filesInError = [];
122460
122520
  if (isCircularBuildOrder(buildOrder)) {
122461
122521
  reportBuildQueue(state, buildOrder.buildOrder);
122462
122522
  reportErrors(state, buildOrder.circularDiagnostics);
122463
122523
  if (canReportSummary)
122464
122524
  totalErrors += ts.getErrorCountForSummary(buildOrder.circularDiagnostics);
122525
+ if (canReportSummary)
122526
+ filesInError = __spreadArray(__spreadArray([], filesInError, true), ts.getFilesInErrorForSummary(buildOrder.circularDiagnostics), true);
122465
122527
  }
122466
122528
  else {
122467
122529
  // Report errors from the other projects
@@ -122473,12 +122535,14 @@ var ts;
122473
122535
  });
122474
122536
  if (canReportSummary)
122475
122537
  diagnostics.forEach(function (singleProjectErrors) { return totalErrors += ts.getErrorCountForSummary(singleProjectErrors); });
122538
+ if (canReportSummary)
122539
+ diagnostics.forEach(function (singleProjectErrors) { return __spreadArray(__spreadArray([], filesInError, true), ts.getFilesInErrorForSummary(singleProjectErrors), true); });
122476
122540
  }
122477
122541
  if (state.watch) {
122478
122542
  reportWatchStatus(state, ts.getWatchErrorSummaryDiagnosticMessage(totalErrors), totalErrors);
122479
122543
  }
122480
122544
  else if (state.host.reportErrorSummary) {
122481
- state.host.reportErrorSummary(totalErrors);
122545
+ state.host.reportErrorSummary(totalErrors, filesInError);
122482
122546
  }
122483
122547
  }
122484
122548
  /**
@@ -131155,8 +131219,10 @@ var ts;
131155
131219
  }
131156
131220
  /** Get the corresponding JSDocTag node if the position is in a jsDoc comment */
131157
131221
  function getJsDocTagAtPosition(node, position) {
131158
- var jsdoc = ts.findAncestor(node, ts.isJSDoc);
131159
- return jsdoc && jsdoc.tags && (ts.rangeContainsPosition(jsdoc, position) ? ts.findLast(jsdoc.tags, function (tag) { return tag.pos < position; }) : undefined);
131222
+ return ts.findAncestor(node, function (n) {
131223
+ return ts.isJSDocTag(n) && ts.rangeContainsPosition(n, position) ? true :
131224
+ ts.isJSDoc(n) ? "quit" : false;
131225
+ });
131160
131226
  }
131161
131227
  function getPropertiesForObjectExpression(contextualType, completionsType, obj, checker) {
131162
131228
  var hasCompletionsType = completionsType && completionsType !== contextualType;
@@ -5352,7 +5352,11 @@ declare namespace ts {
5352
5352
  traceResolution?: boolean;
5353
5353
  [option: string]: CompilerOptionsValue | undefined;
5354
5354
  }
5355
- type ReportEmitErrorSummary = (errorCount: number) => void;
5355
+ type ReportEmitErrorSummary = (errorCount: number, filesInError: (ReportFileInError | undefined)[]) => void;
5356
+ interface ReportFileInError {
5357
+ fileName: string;
5358
+ line: number;
5359
+ }
5356
5360
  interface SolutionBuilderHostBase<T extends BuilderProgram> extends ProgramHost<T> {
5357
5361
  createDirectory?(path: string): void;
5358
5362
  /**
@@ -294,7 +294,7 @@ var ts;
294
294
  // The following is baselined as a literal template type without intervention
295
295
  /** The version of the TypeScript compiler release */
296
296
  // eslint-disable-next-line @typescript-eslint/no-inferrable-types
297
- ts.version = ts.versionMajorMinor + ".0-dev.20211207";
297
+ ts.version = ts.versionMajorMinor + ".0-dev.20211208";
298
298
  /* @internal */
299
299
  var Comparison;
300
300
  (function (Comparison) {
@@ -9083,6 +9083,7 @@ var ts;
9083
9083
  DIRECTORY: diag(6038, ts.DiagnosticCategory.Message, "DIRECTORY_6038", "DIRECTORY"),
9084
9084
  STRATEGY: diag(6039, ts.DiagnosticCategory.Message, "STRATEGY_6039", "STRATEGY"),
9085
9085
  FILE_OR_DIRECTORY: diag(6040, ts.DiagnosticCategory.Message, "FILE_OR_DIRECTORY_6040", "FILE OR DIRECTORY"),
9086
+ Errors_Files: diag(6041, ts.DiagnosticCategory.Message, "Errors_Files_6041", "Errors Files"),
9086
9087
  Generates_corresponding_map_file: diag(6043, ts.DiagnosticCategory.Message, "Generates_corresponding_map_file_6043", "Generates corresponding '.map' file."),
9087
9088
  Compiler_option_0_expects_an_argument: diag(6044, ts.DiagnosticCategory.Error, "Compiler_option_0_expects_an_argument_6044", "Compiler option '{0}' expects an argument."),
9088
9089
  Unterminated_quoted_string_in_response_file_0: diag(6045, ts.DiagnosticCategory.Error, "Unterminated_quoted_string_in_response_file_0_6045", "Unterminated quoted string in response file '{0}'."),
@@ -9276,6 +9277,9 @@ var ts;
9276
9277
  Output_Formatting: diag(6256, ts.DiagnosticCategory.Message, "Output_Formatting_6256", "Output Formatting"),
9277
9278
  Completeness: diag(6257, ts.DiagnosticCategory.Message, "Completeness_6257", "Completeness"),
9278
9279
  _0_should_be_set_inside_the_compilerOptions_object_of_the_config_json_file: diag(6258, ts.DiagnosticCategory.Error, "_0_should_be_set_inside_the_compilerOptions_object_of_the_config_json_file_6258", "'{0}' should be set inside the 'compilerOptions' object of the config json file"),
9280
+ Found_1_error_in_1: diag(6259, ts.DiagnosticCategory.Message, "Found_1_error_in_1_6259", "Found 1 error in {1}"),
9281
+ Found_0_errors_in_1_file: diag(6260, ts.DiagnosticCategory.Message, "Found_0_errors_in_1_file_6260", "Found {0} errors in 1 file."),
9282
+ Found_0_errors_in_1_files: diag(6261, ts.DiagnosticCategory.Message, "Found_0_errors_in_1_files_6261", "Found {0} errors in {1} files."),
9279
9283
  Directory_0_has_no_containing_package_json_scope_Imports_will_not_resolve: diag(6270, ts.DiagnosticCategory.Message, "Directory_0_has_no_containing_package_json_scope_Imports_will_not_resolve_6270", "Directory '{0}' has no containing package.json scope. Imports will not resolve."),
9280
9284
  Import_specifier_0_does_not_exist_in_package_json_scope_at_path_1: diag(6271, ts.DiagnosticCategory.Message, "Import_specifier_0_does_not_exist_in_package_json_scope_at_path_1_6271", "Import specifier '{0}' does not exist in package.json scope at path '{1}'."),
9281
9285
  Invalid_import_specifier_0_has_no_possible_resolutions: diag(6272, ts.DiagnosticCategory.Message, "Invalid_import_specifier_0_has_no_possible_resolutions_6272", "Invalid import specifier '{0}' has no possible resolutions."),
@@ -119919,7 +119923,7 @@ var ts;
119919
119923
  getCanonicalFileName: ts.createGetCanonicalFileName(ts.sys.useCaseSensitiveFileNames)
119920
119924
  } : undefined;
119921
119925
  /**
119922
- * Create a function that reports error by writing to the system and handles the formating of the diagnostic
119926
+ * Create a function that reports error by writing to the system and handles the formatting of the diagnostic
119923
119927
  */
119924
119928
  function createDiagnosticReporter(system, pretty) {
119925
119929
  var host = system === ts.sys && sysFormatDiagnosticsHost ? sysFormatDiagnosticsHost : {
@@ -120005,19 +120009,74 @@ var ts;
120005
120009
  return ts.countWhere(diagnostics, function (diagnostic) { return diagnostic.category === ts.DiagnosticCategory.Error; });
120006
120010
  }
120007
120011
  ts.getErrorCountForSummary = getErrorCountForSummary;
120012
+ function getFilesInErrorForSummary(diagnostics) {
120013
+ var filesInError = ts.filter(diagnostics, function (diagnostic) { return diagnostic.category === ts.DiagnosticCategory.Error; })
120014
+ .map(function (errorDiagnostic) {
120015
+ if (errorDiagnostic.file === undefined)
120016
+ return;
120017
+ return "" + errorDiagnostic.file.fileName;
120018
+ });
120019
+ return filesInError.map(function (fileName) {
120020
+ var diagnosticForFileName = ts.find(diagnostics, function (diagnostic) {
120021
+ return diagnostic.file !== undefined && diagnostic.file.fileName === fileName;
120022
+ });
120023
+ if (diagnosticForFileName !== undefined) {
120024
+ var line = ts.getLineAndCharacterOfPosition(diagnosticForFileName.file, diagnosticForFileName.start).line;
120025
+ return {
120026
+ fileName: fileName,
120027
+ line: line + 1,
120028
+ };
120029
+ }
120030
+ });
120031
+ }
120032
+ ts.getFilesInErrorForSummary = getFilesInErrorForSummary;
120008
120033
  function getWatchErrorSummaryDiagnosticMessage(errorCount) {
120009
120034
  return errorCount === 1 ?
120010
120035
  ts.Diagnostics.Found_1_error_Watching_for_file_changes :
120011
120036
  ts.Diagnostics.Found_0_errors_Watching_for_file_changes;
120012
120037
  }
120013
120038
  ts.getWatchErrorSummaryDiagnosticMessage = getWatchErrorSummaryDiagnosticMessage;
120014
- function getErrorSummaryText(errorCount, newLine) {
120039
+ function getErrorSummaryText(errorCount, filesInError, newLine) {
120015
120040
  if (errorCount === 0)
120016
120041
  return "";
120017
- var d = ts.createCompilerDiagnostic(errorCount === 1 ? ts.Diagnostics.Found_1_error : ts.Diagnostics.Found_0_errors, errorCount);
120018
- return "" + newLine + ts.flattenDiagnosticMessageText(d.messageText, newLine) + newLine + newLine;
120042
+ var nonNilFiles = filesInError.filter(function (fileInError) { return fileInError !== undefined; });
120043
+ var distinctFileNamesWithLines = nonNilFiles.map(function (fileInError) { return fileInError.fileName + ":" + fileInError.line; })
120044
+ .filter(function (value, index, self) { return self.indexOf(value) === index; });
120045
+ var d = errorCount === 1 ?
120046
+ ts.createCompilerDiagnostic(filesInError[0] !== undefined ?
120047
+ ts.Diagnostics.Found_1_error_in_1 :
120048
+ ts.Diagnostics.Found_1_error, errorCount, distinctFileNamesWithLines[0]) :
120049
+ ts.createCompilerDiagnostic(distinctFileNamesWithLines.length === 0 ?
120050
+ ts.Diagnostics.Found_0_errors :
120051
+ distinctFileNamesWithLines.length === 1 ?
120052
+ ts.Diagnostics.Found_0_errors_in_1_file :
120053
+ ts.Diagnostics.Found_0_errors_in_1_files, errorCount, distinctFileNamesWithLines.length);
120054
+ return "" + newLine + ts.flattenDiagnosticMessageText(d.messageText, newLine) + newLine + newLine + (errorCount > 1 ? createTabularErrorsDisplay(nonNilFiles) : "");
120019
120055
  }
120020
120056
  ts.getErrorSummaryText = getErrorSummaryText;
120057
+ function createTabularErrorsDisplay(filesInError) {
120058
+ var distinctFiles = filesInError.filter(function (value, index, self) { return index === self.findIndex(function (file) { return (file === null || file === void 0 ? void 0 : file.fileName) === (value === null || value === void 0 ? void 0 : value.fileName); }); });
120059
+ if (distinctFiles.length === 0)
120060
+ return "";
120061
+ var numberLength = function (num) { return Math.log(num) * Math.LOG10E + 1; };
120062
+ var fileToErrorCount = distinctFiles.map(function (file) { return [file, ts.countWhere(filesInError, function (fileInError) { return fileInError.fileName === file.fileName; })]; });
120063
+ var maxErrors = fileToErrorCount.reduce(function (acc, value) { return Math.max(acc, value[1] || 0); }, 0);
120064
+ var headerRow = ts.Diagnostics.Errors_Files.message;
120065
+ var leftColumnHeadingLength = headerRow.split(" ")[0].length;
120066
+ var leftPaddingGoal = Math.max(leftColumnHeadingLength, numberLength(maxErrors));
120067
+ var headerPadding = Math.max(numberLength(maxErrors) - leftColumnHeadingLength, 0);
120068
+ var tabularData = "";
120069
+ tabularData += " ".repeat(headerPadding) + headerRow + "\n";
120070
+ fileToErrorCount.forEach(function (row) {
120071
+ var file = row[0], errorCount = row[1];
120072
+ var errorCountDigitsLength = Math.log(errorCount) * Math.LOG10E + 1 | 0;
120073
+ var leftPadding = errorCountDigitsLength < leftPaddingGoal ?
120074
+ " ".repeat(leftPaddingGoal - errorCountDigitsLength)
120075
+ : "";
120076
+ tabularData += "" + leftPadding + errorCount + " " + file.fileName + ":" + file.line + "\n";
120077
+ });
120078
+ return tabularData;
120079
+ }
120021
120080
  function isBuilderProgram(program) {
120022
120081
  return !!program.getState;
120023
120082
  }
@@ -120221,7 +120280,7 @@ var ts;
120221
120280
  listFiles(program, write);
120222
120281
  }
120223
120282
  if (reportSummary) {
120224
- reportSummary(getErrorCountForSummary(diagnostics));
120283
+ reportSummary(getErrorCountForSummary(diagnostics), getFilesInErrorForSummary(diagnostics));
120225
120284
  }
120226
120285
  return {
120227
120286
  emitResult: emitResult,
@@ -120432,7 +120491,7 @@ var ts;
120432
120491
  var system = input.system || ts.sys;
120433
120492
  var host = input.host || (input.host = ts.createIncrementalCompilerHost(input.options, system));
120434
120493
  var builderProgram = ts.createIncrementalProgram(input);
120435
- var exitStatus = emitFilesAndReportErrorsAndGetExitStatus(builderProgram, input.reportDiagnostic || createDiagnosticReporter(system), function (s) { return host.trace && host.trace(s); }, input.reportErrorSummary || input.options.pretty ? function (errorCount) { return system.write(getErrorSummaryText(errorCount, system.newLine)); } : undefined);
120494
+ var exitStatus = emitFilesAndReportErrorsAndGetExitStatus(builderProgram, input.reportDiagnostic || createDiagnosticReporter(system), function (s) { return host.trace && host.trace(s); }, input.reportErrorSummary || input.options.pretty ? function (errorCount, filesInError) { return system.write(getErrorSummaryText(errorCount, filesInError, system.newLine)); } : undefined);
120436
120495
  if (input.afterProgramEmitAndDiagnostics)
120437
120496
  input.afterProgramEmitAndDiagnostics(builderProgram);
120438
120497
  return exitStatus;
@@ -122651,11 +122710,14 @@ var ts;
122651
122710
  var canReportSummary = state.watch || !!state.host.reportErrorSummary;
122652
122711
  var diagnostics = state.diagnostics;
122653
122712
  var totalErrors = 0;
122713
+ var filesInError = [];
122654
122714
  if (isCircularBuildOrder(buildOrder)) {
122655
122715
  reportBuildQueue(state, buildOrder.buildOrder);
122656
122716
  reportErrors(state, buildOrder.circularDiagnostics);
122657
122717
  if (canReportSummary)
122658
122718
  totalErrors += ts.getErrorCountForSummary(buildOrder.circularDiagnostics);
122719
+ if (canReportSummary)
122720
+ filesInError = __spreadArray(__spreadArray([], filesInError, true), ts.getFilesInErrorForSummary(buildOrder.circularDiagnostics), true);
122659
122721
  }
122660
122722
  else {
122661
122723
  // Report errors from the other projects
@@ -122667,12 +122729,14 @@ var ts;
122667
122729
  });
122668
122730
  if (canReportSummary)
122669
122731
  diagnostics.forEach(function (singleProjectErrors) { return totalErrors += ts.getErrorCountForSummary(singleProjectErrors); });
122732
+ if (canReportSummary)
122733
+ diagnostics.forEach(function (singleProjectErrors) { return __spreadArray(__spreadArray([], filesInError, true), ts.getFilesInErrorForSummary(singleProjectErrors), true); });
122670
122734
  }
122671
122735
  if (state.watch) {
122672
122736
  reportWatchStatus(state, ts.getWatchErrorSummaryDiagnosticMessage(totalErrors), totalErrors);
122673
122737
  }
122674
122738
  else if (state.host.reportErrorSummary) {
122675
- state.host.reportErrorSummary(totalErrors);
122739
+ state.host.reportErrorSummary(totalErrors, filesInError);
122676
122740
  }
122677
122741
  }
122678
122742
  /**
@@ -131737,8 +131801,10 @@ var ts;
131737
131801
  }
131738
131802
  /** Get the corresponding JSDocTag node if the position is in a jsDoc comment */
131739
131803
  function getJsDocTagAtPosition(node, position) {
131740
- var jsdoc = ts.findAncestor(node, ts.isJSDoc);
131741
- return jsdoc && jsdoc.tags && (ts.rangeContainsPosition(jsdoc, position) ? ts.findLast(jsdoc.tags, function (tag) { return tag.pos < position; }) : undefined);
131804
+ return ts.findAncestor(node, function (n) {
131805
+ return ts.isJSDocTag(n) && ts.rangeContainsPosition(n, position) ? true :
131806
+ ts.isJSDoc(n) ? "quit" : false;
131807
+ });
131742
131808
  }
131743
131809
  function getPropertiesForObjectExpression(contextualType, completionsType, obj, checker) {
131744
131810
  var hasCompletionsType = completionsType && completionsType !== contextualType;
@@ -5352,7 +5352,11 @@ declare namespace ts {
5352
5352
  traceResolution?: boolean;
5353
5353
  [option: string]: CompilerOptionsValue | undefined;
5354
5354
  }
5355
- type ReportEmitErrorSummary = (errorCount: number) => void;
5355
+ type ReportEmitErrorSummary = (errorCount: number, filesInError: (ReportFileInError | undefined)[]) => void;
5356
+ interface ReportFileInError {
5357
+ fileName: string;
5358
+ line: number;
5359
+ }
5356
5360
  interface SolutionBuilderHostBase<T extends BuilderProgram> extends ProgramHost<T> {
5357
5361
  createDirectory?(path: string): void;
5358
5362
  /**
package/lib/typescript.js CHANGED
@@ -294,7 +294,7 @@ var ts;
294
294
  // The following is baselined as a literal template type without intervention
295
295
  /** The version of the TypeScript compiler release */
296
296
  // eslint-disable-next-line @typescript-eslint/no-inferrable-types
297
- ts.version = ts.versionMajorMinor + ".0-dev.20211207";
297
+ ts.version = ts.versionMajorMinor + ".0-dev.20211208";
298
298
  /* @internal */
299
299
  var Comparison;
300
300
  (function (Comparison) {
@@ -9083,6 +9083,7 @@ var ts;
9083
9083
  DIRECTORY: diag(6038, ts.DiagnosticCategory.Message, "DIRECTORY_6038", "DIRECTORY"),
9084
9084
  STRATEGY: diag(6039, ts.DiagnosticCategory.Message, "STRATEGY_6039", "STRATEGY"),
9085
9085
  FILE_OR_DIRECTORY: diag(6040, ts.DiagnosticCategory.Message, "FILE_OR_DIRECTORY_6040", "FILE OR DIRECTORY"),
9086
+ Errors_Files: diag(6041, ts.DiagnosticCategory.Message, "Errors_Files_6041", "Errors Files"),
9086
9087
  Generates_corresponding_map_file: diag(6043, ts.DiagnosticCategory.Message, "Generates_corresponding_map_file_6043", "Generates corresponding '.map' file."),
9087
9088
  Compiler_option_0_expects_an_argument: diag(6044, ts.DiagnosticCategory.Error, "Compiler_option_0_expects_an_argument_6044", "Compiler option '{0}' expects an argument."),
9088
9089
  Unterminated_quoted_string_in_response_file_0: diag(6045, ts.DiagnosticCategory.Error, "Unterminated_quoted_string_in_response_file_0_6045", "Unterminated quoted string in response file '{0}'."),
@@ -9276,6 +9277,9 @@ var ts;
9276
9277
  Output_Formatting: diag(6256, ts.DiagnosticCategory.Message, "Output_Formatting_6256", "Output Formatting"),
9277
9278
  Completeness: diag(6257, ts.DiagnosticCategory.Message, "Completeness_6257", "Completeness"),
9278
9279
  _0_should_be_set_inside_the_compilerOptions_object_of_the_config_json_file: diag(6258, ts.DiagnosticCategory.Error, "_0_should_be_set_inside_the_compilerOptions_object_of_the_config_json_file_6258", "'{0}' should be set inside the 'compilerOptions' object of the config json file"),
9280
+ Found_1_error_in_1: diag(6259, ts.DiagnosticCategory.Message, "Found_1_error_in_1_6259", "Found 1 error in {1}"),
9281
+ Found_0_errors_in_1_file: diag(6260, ts.DiagnosticCategory.Message, "Found_0_errors_in_1_file_6260", "Found {0} errors in 1 file."),
9282
+ Found_0_errors_in_1_files: diag(6261, ts.DiagnosticCategory.Message, "Found_0_errors_in_1_files_6261", "Found {0} errors in {1} files."),
9279
9283
  Directory_0_has_no_containing_package_json_scope_Imports_will_not_resolve: diag(6270, ts.DiagnosticCategory.Message, "Directory_0_has_no_containing_package_json_scope_Imports_will_not_resolve_6270", "Directory '{0}' has no containing package.json scope. Imports will not resolve."),
9280
9284
  Import_specifier_0_does_not_exist_in_package_json_scope_at_path_1: diag(6271, ts.DiagnosticCategory.Message, "Import_specifier_0_does_not_exist_in_package_json_scope_at_path_1_6271", "Import specifier '{0}' does not exist in package.json scope at path '{1}'."),
9281
9285
  Invalid_import_specifier_0_has_no_possible_resolutions: diag(6272, ts.DiagnosticCategory.Message, "Invalid_import_specifier_0_has_no_possible_resolutions_6272", "Invalid import specifier '{0}' has no possible resolutions."),
@@ -119919,7 +119923,7 @@ var ts;
119919
119923
  getCanonicalFileName: ts.createGetCanonicalFileName(ts.sys.useCaseSensitiveFileNames)
119920
119924
  } : undefined;
119921
119925
  /**
119922
- * Create a function that reports error by writing to the system and handles the formating of the diagnostic
119926
+ * Create a function that reports error by writing to the system and handles the formatting of the diagnostic
119923
119927
  */
119924
119928
  function createDiagnosticReporter(system, pretty) {
119925
119929
  var host = system === ts.sys && sysFormatDiagnosticsHost ? sysFormatDiagnosticsHost : {
@@ -120005,19 +120009,74 @@ var ts;
120005
120009
  return ts.countWhere(diagnostics, function (diagnostic) { return diagnostic.category === ts.DiagnosticCategory.Error; });
120006
120010
  }
120007
120011
  ts.getErrorCountForSummary = getErrorCountForSummary;
120012
+ function getFilesInErrorForSummary(diagnostics) {
120013
+ var filesInError = ts.filter(diagnostics, function (diagnostic) { return diagnostic.category === ts.DiagnosticCategory.Error; })
120014
+ .map(function (errorDiagnostic) {
120015
+ if (errorDiagnostic.file === undefined)
120016
+ return;
120017
+ return "" + errorDiagnostic.file.fileName;
120018
+ });
120019
+ return filesInError.map(function (fileName) {
120020
+ var diagnosticForFileName = ts.find(diagnostics, function (diagnostic) {
120021
+ return diagnostic.file !== undefined && diagnostic.file.fileName === fileName;
120022
+ });
120023
+ if (diagnosticForFileName !== undefined) {
120024
+ var line = ts.getLineAndCharacterOfPosition(diagnosticForFileName.file, diagnosticForFileName.start).line;
120025
+ return {
120026
+ fileName: fileName,
120027
+ line: line + 1,
120028
+ };
120029
+ }
120030
+ });
120031
+ }
120032
+ ts.getFilesInErrorForSummary = getFilesInErrorForSummary;
120008
120033
  function getWatchErrorSummaryDiagnosticMessage(errorCount) {
120009
120034
  return errorCount === 1 ?
120010
120035
  ts.Diagnostics.Found_1_error_Watching_for_file_changes :
120011
120036
  ts.Diagnostics.Found_0_errors_Watching_for_file_changes;
120012
120037
  }
120013
120038
  ts.getWatchErrorSummaryDiagnosticMessage = getWatchErrorSummaryDiagnosticMessage;
120014
- function getErrorSummaryText(errorCount, newLine) {
120039
+ function getErrorSummaryText(errorCount, filesInError, newLine) {
120015
120040
  if (errorCount === 0)
120016
120041
  return "";
120017
- var d = ts.createCompilerDiagnostic(errorCount === 1 ? ts.Diagnostics.Found_1_error : ts.Diagnostics.Found_0_errors, errorCount);
120018
- return "" + newLine + ts.flattenDiagnosticMessageText(d.messageText, newLine) + newLine + newLine;
120042
+ var nonNilFiles = filesInError.filter(function (fileInError) { return fileInError !== undefined; });
120043
+ var distinctFileNamesWithLines = nonNilFiles.map(function (fileInError) { return fileInError.fileName + ":" + fileInError.line; })
120044
+ .filter(function (value, index, self) { return self.indexOf(value) === index; });
120045
+ var d = errorCount === 1 ?
120046
+ ts.createCompilerDiagnostic(filesInError[0] !== undefined ?
120047
+ ts.Diagnostics.Found_1_error_in_1 :
120048
+ ts.Diagnostics.Found_1_error, errorCount, distinctFileNamesWithLines[0]) :
120049
+ ts.createCompilerDiagnostic(distinctFileNamesWithLines.length === 0 ?
120050
+ ts.Diagnostics.Found_0_errors :
120051
+ distinctFileNamesWithLines.length === 1 ?
120052
+ ts.Diagnostics.Found_0_errors_in_1_file :
120053
+ ts.Diagnostics.Found_0_errors_in_1_files, errorCount, distinctFileNamesWithLines.length);
120054
+ return "" + newLine + ts.flattenDiagnosticMessageText(d.messageText, newLine) + newLine + newLine + (errorCount > 1 ? createTabularErrorsDisplay(nonNilFiles) : "");
120019
120055
  }
120020
120056
  ts.getErrorSummaryText = getErrorSummaryText;
120057
+ function createTabularErrorsDisplay(filesInError) {
120058
+ var distinctFiles = filesInError.filter(function (value, index, self) { return index === self.findIndex(function (file) { return (file === null || file === void 0 ? void 0 : file.fileName) === (value === null || value === void 0 ? void 0 : value.fileName); }); });
120059
+ if (distinctFiles.length === 0)
120060
+ return "";
120061
+ var numberLength = function (num) { return Math.log(num) * Math.LOG10E + 1; };
120062
+ var fileToErrorCount = distinctFiles.map(function (file) { return [file, ts.countWhere(filesInError, function (fileInError) { return fileInError.fileName === file.fileName; })]; });
120063
+ var maxErrors = fileToErrorCount.reduce(function (acc, value) { return Math.max(acc, value[1] || 0); }, 0);
120064
+ var headerRow = ts.Diagnostics.Errors_Files.message;
120065
+ var leftColumnHeadingLength = headerRow.split(" ")[0].length;
120066
+ var leftPaddingGoal = Math.max(leftColumnHeadingLength, numberLength(maxErrors));
120067
+ var headerPadding = Math.max(numberLength(maxErrors) - leftColumnHeadingLength, 0);
120068
+ var tabularData = "";
120069
+ tabularData += " ".repeat(headerPadding) + headerRow + "\n";
120070
+ fileToErrorCount.forEach(function (row) {
120071
+ var file = row[0], errorCount = row[1];
120072
+ var errorCountDigitsLength = Math.log(errorCount) * Math.LOG10E + 1 | 0;
120073
+ var leftPadding = errorCountDigitsLength < leftPaddingGoal ?
120074
+ " ".repeat(leftPaddingGoal - errorCountDigitsLength)
120075
+ : "";
120076
+ tabularData += "" + leftPadding + errorCount + " " + file.fileName + ":" + file.line + "\n";
120077
+ });
120078
+ return tabularData;
120079
+ }
120021
120080
  function isBuilderProgram(program) {
120022
120081
  return !!program.getState;
120023
120082
  }
@@ -120221,7 +120280,7 @@ var ts;
120221
120280
  listFiles(program, write);
120222
120281
  }
120223
120282
  if (reportSummary) {
120224
- reportSummary(getErrorCountForSummary(diagnostics));
120283
+ reportSummary(getErrorCountForSummary(diagnostics), getFilesInErrorForSummary(diagnostics));
120225
120284
  }
120226
120285
  return {
120227
120286
  emitResult: emitResult,
@@ -120432,7 +120491,7 @@ var ts;
120432
120491
  var system = input.system || ts.sys;
120433
120492
  var host = input.host || (input.host = ts.createIncrementalCompilerHost(input.options, system));
120434
120493
  var builderProgram = ts.createIncrementalProgram(input);
120435
- var exitStatus = emitFilesAndReportErrorsAndGetExitStatus(builderProgram, input.reportDiagnostic || createDiagnosticReporter(system), function (s) { return host.trace && host.trace(s); }, input.reportErrorSummary || input.options.pretty ? function (errorCount) { return system.write(getErrorSummaryText(errorCount, system.newLine)); } : undefined);
120494
+ var exitStatus = emitFilesAndReportErrorsAndGetExitStatus(builderProgram, input.reportDiagnostic || createDiagnosticReporter(system), function (s) { return host.trace && host.trace(s); }, input.reportErrorSummary || input.options.pretty ? function (errorCount, filesInError) { return system.write(getErrorSummaryText(errorCount, filesInError, system.newLine)); } : undefined);
120436
120495
  if (input.afterProgramEmitAndDiagnostics)
120437
120496
  input.afterProgramEmitAndDiagnostics(builderProgram);
120438
120497
  return exitStatus;
@@ -122651,11 +122710,14 @@ var ts;
122651
122710
  var canReportSummary = state.watch || !!state.host.reportErrorSummary;
122652
122711
  var diagnostics = state.diagnostics;
122653
122712
  var totalErrors = 0;
122713
+ var filesInError = [];
122654
122714
  if (isCircularBuildOrder(buildOrder)) {
122655
122715
  reportBuildQueue(state, buildOrder.buildOrder);
122656
122716
  reportErrors(state, buildOrder.circularDiagnostics);
122657
122717
  if (canReportSummary)
122658
122718
  totalErrors += ts.getErrorCountForSummary(buildOrder.circularDiagnostics);
122719
+ if (canReportSummary)
122720
+ filesInError = __spreadArray(__spreadArray([], filesInError, true), ts.getFilesInErrorForSummary(buildOrder.circularDiagnostics), true);
122659
122721
  }
122660
122722
  else {
122661
122723
  // Report errors from the other projects
@@ -122667,12 +122729,14 @@ var ts;
122667
122729
  });
122668
122730
  if (canReportSummary)
122669
122731
  diagnostics.forEach(function (singleProjectErrors) { return totalErrors += ts.getErrorCountForSummary(singleProjectErrors); });
122732
+ if (canReportSummary)
122733
+ diagnostics.forEach(function (singleProjectErrors) { return __spreadArray(__spreadArray([], filesInError, true), ts.getFilesInErrorForSummary(singleProjectErrors), true); });
122670
122734
  }
122671
122735
  if (state.watch) {
122672
122736
  reportWatchStatus(state, ts.getWatchErrorSummaryDiagnosticMessage(totalErrors), totalErrors);
122673
122737
  }
122674
122738
  else if (state.host.reportErrorSummary) {
122675
- state.host.reportErrorSummary(totalErrors);
122739
+ state.host.reportErrorSummary(totalErrors, filesInError);
122676
122740
  }
122677
122741
  }
122678
122742
  /**
@@ -131737,8 +131801,10 @@ var ts;
131737
131801
  }
131738
131802
  /** Get the corresponding JSDocTag node if the position is in a jsDoc comment */
131739
131803
  function getJsDocTagAtPosition(node, position) {
131740
- var jsdoc = ts.findAncestor(node, ts.isJSDoc);
131741
- return jsdoc && jsdoc.tags && (ts.rangeContainsPosition(jsdoc, position) ? ts.findLast(jsdoc.tags, function (tag) { return tag.pos < position; }) : undefined);
131804
+ return ts.findAncestor(node, function (n) {
131805
+ return ts.isJSDocTag(n) && ts.rangeContainsPosition(n, position) ? true :
131806
+ ts.isJSDoc(n) ? "quit" : false;
131807
+ });
131742
131808
  }
131743
131809
  function getPropertiesForObjectExpression(contextualType, completionsType, obj, checker) {
131744
131810
  var hasCompletionsType = completionsType && completionsType !== contextualType;
@@ -5352,7 +5352,11 @@ declare namespace ts {
5352
5352
  traceResolution?: boolean;
5353
5353
  [option: string]: CompilerOptionsValue | undefined;
5354
5354
  }
5355
- type ReportEmitErrorSummary = (errorCount: number) => void;
5355
+ type ReportEmitErrorSummary = (errorCount: number, filesInError: (ReportFileInError | undefined)[]) => void;
5356
+ interface ReportFileInError {
5357
+ fileName: string;
5358
+ line: number;
5359
+ }
5356
5360
  interface SolutionBuilderHostBase<T extends BuilderProgram> extends ProgramHost<T> {
5357
5361
  createDirectory?(path: string): void;
5358
5362
  /**
@@ -294,7 +294,7 @@ var ts;
294
294
  // The following is baselined as a literal template type without intervention
295
295
  /** The version of the TypeScript compiler release */
296
296
  // eslint-disable-next-line @typescript-eslint/no-inferrable-types
297
- ts.version = ts.versionMajorMinor + ".0-dev.20211207";
297
+ ts.version = ts.versionMajorMinor + ".0-dev.20211208";
298
298
  /* @internal */
299
299
  var Comparison;
300
300
  (function (Comparison) {
@@ -9083,6 +9083,7 @@ var ts;
9083
9083
  DIRECTORY: diag(6038, ts.DiagnosticCategory.Message, "DIRECTORY_6038", "DIRECTORY"),
9084
9084
  STRATEGY: diag(6039, ts.DiagnosticCategory.Message, "STRATEGY_6039", "STRATEGY"),
9085
9085
  FILE_OR_DIRECTORY: diag(6040, ts.DiagnosticCategory.Message, "FILE_OR_DIRECTORY_6040", "FILE OR DIRECTORY"),
9086
+ Errors_Files: diag(6041, ts.DiagnosticCategory.Message, "Errors_Files_6041", "Errors Files"),
9086
9087
  Generates_corresponding_map_file: diag(6043, ts.DiagnosticCategory.Message, "Generates_corresponding_map_file_6043", "Generates corresponding '.map' file."),
9087
9088
  Compiler_option_0_expects_an_argument: diag(6044, ts.DiagnosticCategory.Error, "Compiler_option_0_expects_an_argument_6044", "Compiler option '{0}' expects an argument."),
9088
9089
  Unterminated_quoted_string_in_response_file_0: diag(6045, ts.DiagnosticCategory.Error, "Unterminated_quoted_string_in_response_file_0_6045", "Unterminated quoted string in response file '{0}'."),
@@ -9276,6 +9277,9 @@ var ts;
9276
9277
  Output_Formatting: diag(6256, ts.DiagnosticCategory.Message, "Output_Formatting_6256", "Output Formatting"),
9277
9278
  Completeness: diag(6257, ts.DiagnosticCategory.Message, "Completeness_6257", "Completeness"),
9278
9279
  _0_should_be_set_inside_the_compilerOptions_object_of_the_config_json_file: diag(6258, ts.DiagnosticCategory.Error, "_0_should_be_set_inside_the_compilerOptions_object_of_the_config_json_file_6258", "'{0}' should be set inside the 'compilerOptions' object of the config json file"),
9280
+ Found_1_error_in_1: diag(6259, ts.DiagnosticCategory.Message, "Found_1_error_in_1_6259", "Found 1 error in {1}"),
9281
+ Found_0_errors_in_1_file: diag(6260, ts.DiagnosticCategory.Message, "Found_0_errors_in_1_file_6260", "Found {0} errors in 1 file."),
9282
+ Found_0_errors_in_1_files: diag(6261, ts.DiagnosticCategory.Message, "Found_0_errors_in_1_files_6261", "Found {0} errors in {1} files."),
9279
9283
  Directory_0_has_no_containing_package_json_scope_Imports_will_not_resolve: diag(6270, ts.DiagnosticCategory.Message, "Directory_0_has_no_containing_package_json_scope_Imports_will_not_resolve_6270", "Directory '{0}' has no containing package.json scope. Imports will not resolve."),
9280
9284
  Import_specifier_0_does_not_exist_in_package_json_scope_at_path_1: diag(6271, ts.DiagnosticCategory.Message, "Import_specifier_0_does_not_exist_in_package_json_scope_at_path_1_6271", "Import specifier '{0}' does not exist in package.json scope at path '{1}'."),
9281
9285
  Invalid_import_specifier_0_has_no_possible_resolutions: diag(6272, ts.DiagnosticCategory.Message, "Invalid_import_specifier_0_has_no_possible_resolutions_6272", "Invalid import specifier '{0}' has no possible resolutions."),
@@ -119919,7 +119923,7 @@ var ts;
119919
119923
  getCanonicalFileName: ts.createGetCanonicalFileName(ts.sys.useCaseSensitiveFileNames)
119920
119924
  } : undefined;
119921
119925
  /**
119922
- * Create a function that reports error by writing to the system and handles the formating of the diagnostic
119926
+ * Create a function that reports error by writing to the system and handles the formatting of the diagnostic
119923
119927
  */
119924
119928
  function createDiagnosticReporter(system, pretty) {
119925
119929
  var host = system === ts.sys && sysFormatDiagnosticsHost ? sysFormatDiagnosticsHost : {
@@ -120005,19 +120009,74 @@ var ts;
120005
120009
  return ts.countWhere(diagnostics, function (diagnostic) { return diagnostic.category === ts.DiagnosticCategory.Error; });
120006
120010
  }
120007
120011
  ts.getErrorCountForSummary = getErrorCountForSummary;
120012
+ function getFilesInErrorForSummary(diagnostics) {
120013
+ var filesInError = ts.filter(diagnostics, function (diagnostic) { return diagnostic.category === ts.DiagnosticCategory.Error; })
120014
+ .map(function (errorDiagnostic) {
120015
+ if (errorDiagnostic.file === undefined)
120016
+ return;
120017
+ return "" + errorDiagnostic.file.fileName;
120018
+ });
120019
+ return filesInError.map(function (fileName) {
120020
+ var diagnosticForFileName = ts.find(diagnostics, function (diagnostic) {
120021
+ return diagnostic.file !== undefined && diagnostic.file.fileName === fileName;
120022
+ });
120023
+ if (diagnosticForFileName !== undefined) {
120024
+ var line = ts.getLineAndCharacterOfPosition(diagnosticForFileName.file, diagnosticForFileName.start).line;
120025
+ return {
120026
+ fileName: fileName,
120027
+ line: line + 1,
120028
+ };
120029
+ }
120030
+ });
120031
+ }
120032
+ ts.getFilesInErrorForSummary = getFilesInErrorForSummary;
120008
120033
  function getWatchErrorSummaryDiagnosticMessage(errorCount) {
120009
120034
  return errorCount === 1 ?
120010
120035
  ts.Diagnostics.Found_1_error_Watching_for_file_changes :
120011
120036
  ts.Diagnostics.Found_0_errors_Watching_for_file_changes;
120012
120037
  }
120013
120038
  ts.getWatchErrorSummaryDiagnosticMessage = getWatchErrorSummaryDiagnosticMessage;
120014
- function getErrorSummaryText(errorCount, newLine) {
120039
+ function getErrorSummaryText(errorCount, filesInError, newLine) {
120015
120040
  if (errorCount === 0)
120016
120041
  return "";
120017
- var d = ts.createCompilerDiagnostic(errorCount === 1 ? ts.Diagnostics.Found_1_error : ts.Diagnostics.Found_0_errors, errorCount);
120018
- return "" + newLine + ts.flattenDiagnosticMessageText(d.messageText, newLine) + newLine + newLine;
120042
+ var nonNilFiles = filesInError.filter(function (fileInError) { return fileInError !== undefined; });
120043
+ var distinctFileNamesWithLines = nonNilFiles.map(function (fileInError) { return fileInError.fileName + ":" + fileInError.line; })
120044
+ .filter(function (value, index, self) { return self.indexOf(value) === index; });
120045
+ var d = errorCount === 1 ?
120046
+ ts.createCompilerDiagnostic(filesInError[0] !== undefined ?
120047
+ ts.Diagnostics.Found_1_error_in_1 :
120048
+ ts.Diagnostics.Found_1_error, errorCount, distinctFileNamesWithLines[0]) :
120049
+ ts.createCompilerDiagnostic(distinctFileNamesWithLines.length === 0 ?
120050
+ ts.Diagnostics.Found_0_errors :
120051
+ distinctFileNamesWithLines.length === 1 ?
120052
+ ts.Diagnostics.Found_0_errors_in_1_file :
120053
+ ts.Diagnostics.Found_0_errors_in_1_files, errorCount, distinctFileNamesWithLines.length);
120054
+ return "" + newLine + ts.flattenDiagnosticMessageText(d.messageText, newLine) + newLine + newLine + (errorCount > 1 ? createTabularErrorsDisplay(nonNilFiles) : "");
120019
120055
  }
120020
120056
  ts.getErrorSummaryText = getErrorSummaryText;
120057
+ function createTabularErrorsDisplay(filesInError) {
120058
+ var distinctFiles = filesInError.filter(function (value, index, self) { return index === self.findIndex(function (file) { return (file === null || file === void 0 ? void 0 : file.fileName) === (value === null || value === void 0 ? void 0 : value.fileName); }); });
120059
+ if (distinctFiles.length === 0)
120060
+ return "";
120061
+ var numberLength = function (num) { return Math.log(num) * Math.LOG10E + 1; };
120062
+ var fileToErrorCount = distinctFiles.map(function (file) { return [file, ts.countWhere(filesInError, function (fileInError) { return fileInError.fileName === file.fileName; })]; });
120063
+ var maxErrors = fileToErrorCount.reduce(function (acc, value) { return Math.max(acc, value[1] || 0); }, 0);
120064
+ var headerRow = ts.Diagnostics.Errors_Files.message;
120065
+ var leftColumnHeadingLength = headerRow.split(" ")[0].length;
120066
+ var leftPaddingGoal = Math.max(leftColumnHeadingLength, numberLength(maxErrors));
120067
+ var headerPadding = Math.max(numberLength(maxErrors) - leftColumnHeadingLength, 0);
120068
+ var tabularData = "";
120069
+ tabularData += " ".repeat(headerPadding) + headerRow + "\n";
120070
+ fileToErrorCount.forEach(function (row) {
120071
+ var file = row[0], errorCount = row[1];
120072
+ var errorCountDigitsLength = Math.log(errorCount) * Math.LOG10E + 1 | 0;
120073
+ var leftPadding = errorCountDigitsLength < leftPaddingGoal ?
120074
+ " ".repeat(leftPaddingGoal - errorCountDigitsLength)
120075
+ : "";
120076
+ tabularData += "" + leftPadding + errorCount + " " + file.fileName + ":" + file.line + "\n";
120077
+ });
120078
+ return tabularData;
120079
+ }
120021
120080
  function isBuilderProgram(program) {
120022
120081
  return !!program.getState;
120023
120082
  }
@@ -120221,7 +120280,7 @@ var ts;
120221
120280
  listFiles(program, write);
120222
120281
  }
120223
120282
  if (reportSummary) {
120224
- reportSummary(getErrorCountForSummary(diagnostics));
120283
+ reportSummary(getErrorCountForSummary(diagnostics), getFilesInErrorForSummary(diagnostics));
120225
120284
  }
120226
120285
  return {
120227
120286
  emitResult: emitResult,
@@ -120432,7 +120491,7 @@ var ts;
120432
120491
  var system = input.system || ts.sys;
120433
120492
  var host = input.host || (input.host = ts.createIncrementalCompilerHost(input.options, system));
120434
120493
  var builderProgram = ts.createIncrementalProgram(input);
120435
- var exitStatus = emitFilesAndReportErrorsAndGetExitStatus(builderProgram, input.reportDiagnostic || createDiagnosticReporter(system), function (s) { return host.trace && host.trace(s); }, input.reportErrorSummary || input.options.pretty ? function (errorCount) { return system.write(getErrorSummaryText(errorCount, system.newLine)); } : undefined);
120494
+ var exitStatus = emitFilesAndReportErrorsAndGetExitStatus(builderProgram, input.reportDiagnostic || createDiagnosticReporter(system), function (s) { return host.trace && host.trace(s); }, input.reportErrorSummary || input.options.pretty ? function (errorCount, filesInError) { return system.write(getErrorSummaryText(errorCount, filesInError, system.newLine)); } : undefined);
120436
120495
  if (input.afterProgramEmitAndDiagnostics)
120437
120496
  input.afterProgramEmitAndDiagnostics(builderProgram);
120438
120497
  return exitStatus;
@@ -122651,11 +122710,14 @@ var ts;
122651
122710
  var canReportSummary = state.watch || !!state.host.reportErrorSummary;
122652
122711
  var diagnostics = state.diagnostics;
122653
122712
  var totalErrors = 0;
122713
+ var filesInError = [];
122654
122714
  if (isCircularBuildOrder(buildOrder)) {
122655
122715
  reportBuildQueue(state, buildOrder.buildOrder);
122656
122716
  reportErrors(state, buildOrder.circularDiagnostics);
122657
122717
  if (canReportSummary)
122658
122718
  totalErrors += ts.getErrorCountForSummary(buildOrder.circularDiagnostics);
122719
+ if (canReportSummary)
122720
+ filesInError = __spreadArray(__spreadArray([], filesInError, true), ts.getFilesInErrorForSummary(buildOrder.circularDiagnostics), true);
122659
122721
  }
122660
122722
  else {
122661
122723
  // Report errors from the other projects
@@ -122667,12 +122729,14 @@ var ts;
122667
122729
  });
122668
122730
  if (canReportSummary)
122669
122731
  diagnostics.forEach(function (singleProjectErrors) { return totalErrors += ts.getErrorCountForSummary(singleProjectErrors); });
122732
+ if (canReportSummary)
122733
+ diagnostics.forEach(function (singleProjectErrors) { return __spreadArray(__spreadArray([], filesInError, true), ts.getFilesInErrorForSummary(singleProjectErrors), true); });
122670
122734
  }
122671
122735
  if (state.watch) {
122672
122736
  reportWatchStatus(state, ts.getWatchErrorSummaryDiagnosticMessage(totalErrors), totalErrors);
122673
122737
  }
122674
122738
  else if (state.host.reportErrorSummary) {
122675
- state.host.reportErrorSummary(totalErrors);
122739
+ state.host.reportErrorSummary(totalErrors, filesInError);
122676
122740
  }
122677
122741
  }
122678
122742
  /**
@@ -131737,8 +131801,10 @@ var ts;
131737
131801
  }
131738
131802
  /** Get the corresponding JSDocTag node if the position is in a jsDoc comment */
131739
131803
  function getJsDocTagAtPosition(node, position) {
131740
- var jsdoc = ts.findAncestor(node, ts.isJSDoc);
131741
- return jsdoc && jsdoc.tags && (ts.rangeContainsPosition(jsdoc, position) ? ts.findLast(jsdoc.tags, function (tag) { return tag.pos < position; }) : undefined);
131804
+ return ts.findAncestor(node, function (n) {
131805
+ return ts.isJSDocTag(n) && ts.rangeContainsPosition(n, position) ? true :
131806
+ ts.isJSDoc(n) ? "quit" : false;
131807
+ });
131742
131808
  }
131743
131809
  function getPropertiesForObjectExpression(contextualType, completionsType, obj, checker) {
131744
131810
  var hasCompletionsType = completionsType && completionsType !== contextualType;
@@ -89,7 +89,7 @@ var ts;
89
89
  // The following is baselined as a literal template type without intervention
90
90
  /** The version of the TypeScript compiler release */
91
91
  // eslint-disable-next-line @typescript-eslint/no-inferrable-types
92
- ts.version = ts.versionMajorMinor + ".0-dev.20211207";
92
+ ts.version = ts.versionMajorMinor + ".0-dev.20211208";
93
93
  /* @internal */
94
94
  var Comparison;
95
95
  (function (Comparison) {
@@ -8878,6 +8878,7 @@ var ts;
8878
8878
  DIRECTORY: diag(6038, ts.DiagnosticCategory.Message, "DIRECTORY_6038", "DIRECTORY"),
8879
8879
  STRATEGY: diag(6039, ts.DiagnosticCategory.Message, "STRATEGY_6039", "STRATEGY"),
8880
8880
  FILE_OR_DIRECTORY: diag(6040, ts.DiagnosticCategory.Message, "FILE_OR_DIRECTORY_6040", "FILE OR DIRECTORY"),
8881
+ Errors_Files: diag(6041, ts.DiagnosticCategory.Message, "Errors_Files_6041", "Errors Files"),
8881
8882
  Generates_corresponding_map_file: diag(6043, ts.DiagnosticCategory.Message, "Generates_corresponding_map_file_6043", "Generates corresponding '.map' file."),
8882
8883
  Compiler_option_0_expects_an_argument: diag(6044, ts.DiagnosticCategory.Error, "Compiler_option_0_expects_an_argument_6044", "Compiler option '{0}' expects an argument."),
8883
8884
  Unterminated_quoted_string_in_response_file_0: diag(6045, ts.DiagnosticCategory.Error, "Unterminated_quoted_string_in_response_file_0_6045", "Unterminated quoted string in response file '{0}'."),
@@ -9071,6 +9072,9 @@ var ts;
9071
9072
  Output_Formatting: diag(6256, ts.DiagnosticCategory.Message, "Output_Formatting_6256", "Output Formatting"),
9072
9073
  Completeness: diag(6257, ts.DiagnosticCategory.Message, "Completeness_6257", "Completeness"),
9073
9074
  _0_should_be_set_inside_the_compilerOptions_object_of_the_config_json_file: diag(6258, ts.DiagnosticCategory.Error, "_0_should_be_set_inside_the_compilerOptions_object_of_the_config_json_file_6258", "'{0}' should be set inside the 'compilerOptions' object of the config json file"),
9075
+ Found_1_error_in_1: diag(6259, ts.DiagnosticCategory.Message, "Found_1_error_in_1_6259", "Found 1 error in {1}"),
9076
+ Found_0_errors_in_1_file: diag(6260, ts.DiagnosticCategory.Message, "Found_0_errors_in_1_file_6260", "Found {0} errors in 1 file."),
9077
+ Found_0_errors_in_1_files: diag(6261, ts.DiagnosticCategory.Message, "Found_0_errors_in_1_files_6261", "Found {0} errors in {1} files."),
9074
9078
  Directory_0_has_no_containing_package_json_scope_Imports_will_not_resolve: diag(6270, ts.DiagnosticCategory.Message, "Directory_0_has_no_containing_package_json_scope_Imports_will_not_resolve_6270", "Directory '{0}' has no containing package.json scope. Imports will not resolve."),
9075
9079
  Import_specifier_0_does_not_exist_in_package_json_scope_at_path_1: diag(6271, ts.DiagnosticCategory.Message, "Import_specifier_0_does_not_exist_in_package_json_scope_at_path_1_6271", "Import specifier '{0}' does not exist in package.json scope at path '{1}'."),
9076
9080
  Invalid_import_specifier_0_has_no_possible_resolutions: diag(6272, ts.DiagnosticCategory.Message, "Invalid_import_specifier_0_has_no_possible_resolutions_6272", "Invalid import specifier '{0}' has no possible resolutions."),
@@ -119714,7 +119718,7 @@ var ts;
119714
119718
  getCanonicalFileName: ts.createGetCanonicalFileName(ts.sys.useCaseSensitiveFileNames)
119715
119719
  } : undefined;
119716
119720
  /**
119717
- * Create a function that reports error by writing to the system and handles the formating of the diagnostic
119721
+ * Create a function that reports error by writing to the system and handles the formatting of the diagnostic
119718
119722
  */
119719
119723
  function createDiagnosticReporter(system, pretty) {
119720
119724
  var host = system === ts.sys && sysFormatDiagnosticsHost ? sysFormatDiagnosticsHost : {
@@ -119800,19 +119804,74 @@ var ts;
119800
119804
  return ts.countWhere(diagnostics, function (diagnostic) { return diagnostic.category === ts.DiagnosticCategory.Error; });
119801
119805
  }
119802
119806
  ts.getErrorCountForSummary = getErrorCountForSummary;
119807
+ function getFilesInErrorForSummary(diagnostics) {
119808
+ var filesInError = ts.filter(diagnostics, function (diagnostic) { return diagnostic.category === ts.DiagnosticCategory.Error; })
119809
+ .map(function (errorDiagnostic) {
119810
+ if (errorDiagnostic.file === undefined)
119811
+ return;
119812
+ return "" + errorDiagnostic.file.fileName;
119813
+ });
119814
+ return filesInError.map(function (fileName) {
119815
+ var diagnosticForFileName = ts.find(diagnostics, function (diagnostic) {
119816
+ return diagnostic.file !== undefined && diagnostic.file.fileName === fileName;
119817
+ });
119818
+ if (diagnosticForFileName !== undefined) {
119819
+ var line = ts.getLineAndCharacterOfPosition(diagnosticForFileName.file, diagnosticForFileName.start).line;
119820
+ return {
119821
+ fileName: fileName,
119822
+ line: line + 1,
119823
+ };
119824
+ }
119825
+ });
119826
+ }
119827
+ ts.getFilesInErrorForSummary = getFilesInErrorForSummary;
119803
119828
  function getWatchErrorSummaryDiagnosticMessage(errorCount) {
119804
119829
  return errorCount === 1 ?
119805
119830
  ts.Diagnostics.Found_1_error_Watching_for_file_changes :
119806
119831
  ts.Diagnostics.Found_0_errors_Watching_for_file_changes;
119807
119832
  }
119808
119833
  ts.getWatchErrorSummaryDiagnosticMessage = getWatchErrorSummaryDiagnosticMessage;
119809
- function getErrorSummaryText(errorCount, newLine) {
119834
+ function getErrorSummaryText(errorCount, filesInError, newLine) {
119810
119835
  if (errorCount === 0)
119811
119836
  return "";
119812
- var d = ts.createCompilerDiagnostic(errorCount === 1 ? ts.Diagnostics.Found_1_error : ts.Diagnostics.Found_0_errors, errorCount);
119813
- return "" + newLine + ts.flattenDiagnosticMessageText(d.messageText, newLine) + newLine + newLine;
119837
+ var nonNilFiles = filesInError.filter(function (fileInError) { return fileInError !== undefined; });
119838
+ var distinctFileNamesWithLines = nonNilFiles.map(function (fileInError) { return fileInError.fileName + ":" + fileInError.line; })
119839
+ .filter(function (value, index, self) { return self.indexOf(value) === index; });
119840
+ var d = errorCount === 1 ?
119841
+ ts.createCompilerDiagnostic(filesInError[0] !== undefined ?
119842
+ ts.Diagnostics.Found_1_error_in_1 :
119843
+ ts.Diagnostics.Found_1_error, errorCount, distinctFileNamesWithLines[0]) :
119844
+ ts.createCompilerDiagnostic(distinctFileNamesWithLines.length === 0 ?
119845
+ ts.Diagnostics.Found_0_errors :
119846
+ distinctFileNamesWithLines.length === 1 ?
119847
+ ts.Diagnostics.Found_0_errors_in_1_file :
119848
+ ts.Diagnostics.Found_0_errors_in_1_files, errorCount, distinctFileNamesWithLines.length);
119849
+ return "" + newLine + ts.flattenDiagnosticMessageText(d.messageText, newLine) + newLine + newLine + (errorCount > 1 ? createTabularErrorsDisplay(nonNilFiles) : "");
119814
119850
  }
119815
119851
  ts.getErrorSummaryText = getErrorSummaryText;
119852
+ function createTabularErrorsDisplay(filesInError) {
119853
+ var distinctFiles = filesInError.filter(function (value, index, self) { return index === self.findIndex(function (file) { return (file === null || file === void 0 ? void 0 : file.fileName) === (value === null || value === void 0 ? void 0 : value.fileName); }); });
119854
+ if (distinctFiles.length === 0)
119855
+ return "";
119856
+ var numberLength = function (num) { return Math.log(num) * Math.LOG10E + 1; };
119857
+ var fileToErrorCount = distinctFiles.map(function (file) { return [file, ts.countWhere(filesInError, function (fileInError) { return fileInError.fileName === file.fileName; })]; });
119858
+ var maxErrors = fileToErrorCount.reduce(function (acc, value) { return Math.max(acc, value[1] || 0); }, 0);
119859
+ var headerRow = ts.Diagnostics.Errors_Files.message;
119860
+ var leftColumnHeadingLength = headerRow.split(" ")[0].length;
119861
+ var leftPaddingGoal = Math.max(leftColumnHeadingLength, numberLength(maxErrors));
119862
+ var headerPadding = Math.max(numberLength(maxErrors) - leftColumnHeadingLength, 0);
119863
+ var tabularData = "";
119864
+ tabularData += " ".repeat(headerPadding) + headerRow + "\n";
119865
+ fileToErrorCount.forEach(function (row) {
119866
+ var file = row[0], errorCount = row[1];
119867
+ var errorCountDigitsLength = Math.log(errorCount) * Math.LOG10E + 1 | 0;
119868
+ var leftPadding = errorCountDigitsLength < leftPaddingGoal ?
119869
+ " ".repeat(leftPaddingGoal - errorCountDigitsLength)
119870
+ : "";
119871
+ tabularData += "" + leftPadding + errorCount + " " + file.fileName + ":" + file.line + "\n";
119872
+ });
119873
+ return tabularData;
119874
+ }
119816
119875
  function isBuilderProgram(program) {
119817
119876
  return !!program.getState;
119818
119877
  }
@@ -120016,7 +120075,7 @@ var ts;
120016
120075
  listFiles(program, write);
120017
120076
  }
120018
120077
  if (reportSummary) {
120019
- reportSummary(getErrorCountForSummary(diagnostics));
120078
+ reportSummary(getErrorCountForSummary(diagnostics), getFilesInErrorForSummary(diagnostics));
120020
120079
  }
120021
120080
  return {
120022
120081
  emitResult: emitResult,
@@ -120227,7 +120286,7 @@ var ts;
120227
120286
  var system = input.system || ts.sys;
120228
120287
  var host = input.host || (input.host = ts.createIncrementalCompilerHost(input.options, system));
120229
120288
  var builderProgram = ts.createIncrementalProgram(input);
120230
- var exitStatus = emitFilesAndReportErrorsAndGetExitStatus(builderProgram, input.reportDiagnostic || createDiagnosticReporter(system), function (s) { return host.trace && host.trace(s); }, input.reportErrorSummary || input.options.pretty ? function (errorCount) { return system.write(getErrorSummaryText(errorCount, system.newLine)); } : undefined);
120289
+ var exitStatus = emitFilesAndReportErrorsAndGetExitStatus(builderProgram, input.reportDiagnostic || createDiagnosticReporter(system), function (s) { return host.trace && host.trace(s); }, input.reportErrorSummary || input.options.pretty ? function (errorCount, filesInError) { return system.write(getErrorSummaryText(errorCount, filesInError, system.newLine)); } : undefined);
120231
120290
  if (input.afterProgramEmitAndDiagnostics)
120232
120291
  input.afterProgramEmitAndDiagnostics(builderProgram);
120233
120292
  return exitStatus;
@@ -122446,11 +122505,14 @@ var ts;
122446
122505
  var canReportSummary = state.watch || !!state.host.reportErrorSummary;
122447
122506
  var diagnostics = state.diagnostics;
122448
122507
  var totalErrors = 0;
122508
+ var filesInError = [];
122449
122509
  if (isCircularBuildOrder(buildOrder)) {
122450
122510
  reportBuildQueue(state, buildOrder.buildOrder);
122451
122511
  reportErrors(state, buildOrder.circularDiagnostics);
122452
122512
  if (canReportSummary)
122453
122513
  totalErrors += ts.getErrorCountForSummary(buildOrder.circularDiagnostics);
122514
+ if (canReportSummary)
122515
+ filesInError = __spreadArray(__spreadArray([], filesInError, true), ts.getFilesInErrorForSummary(buildOrder.circularDiagnostics), true);
122454
122516
  }
122455
122517
  else {
122456
122518
  // Report errors from the other projects
@@ -122462,12 +122524,14 @@ var ts;
122462
122524
  });
122463
122525
  if (canReportSummary)
122464
122526
  diagnostics.forEach(function (singleProjectErrors) { return totalErrors += ts.getErrorCountForSummary(singleProjectErrors); });
122527
+ if (canReportSummary)
122528
+ diagnostics.forEach(function (singleProjectErrors) { return __spreadArray(__spreadArray([], filesInError, true), ts.getFilesInErrorForSummary(singleProjectErrors), true); });
122465
122529
  }
122466
122530
  if (state.watch) {
122467
122531
  reportWatchStatus(state, ts.getWatchErrorSummaryDiagnosticMessage(totalErrors), totalErrors);
122468
122532
  }
122469
122533
  else if (state.host.reportErrorSummary) {
122470
- state.host.reportErrorSummary(totalErrors);
122534
+ state.host.reportErrorSummary(totalErrors, filesInError);
122471
122535
  }
122472
122536
  }
122473
122537
  /**
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "typescript",
3
3
  "author": "Microsoft Corp.",
4
4
  "homepage": "https://www.typescriptlang.org/",
5
- "version": "4.6.0-dev.20211207",
5
+ "version": "4.6.0-dev.20211208",
6
6
  "license": "Apache-2.0",
7
7
  "description": "TypeScript is a language for application scale JavaScript development",
8
8
  "keywords": [