typescript 4.6.0-dev.20211207 → 4.6.0-dev.20211211

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/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.20211211";
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."),
@@ -24628,7 +24632,7 @@ var ts;
24628
24632
  // @api
24629
24633
  function createAssertClause(elements, multiLine) {
24630
24634
  var node = createBaseNode(292 /* AssertClause */);
24631
- node.elements = elements;
24635
+ node.elements = createNodeArray(elements);
24632
24636
  node.multiLine = multiLine;
24633
24637
  node.transformFlags |= 4 /* ContainsESNext */;
24634
24638
  return node;
@@ -54249,7 +54253,27 @@ var ts;
54249
54253
  return mapType(source, function (t) { return getRestType(t, properties, symbol); });
54250
54254
  }
54251
54255
  var omitKeyType = getUnionType(ts.map(properties, getLiteralTypeFromPropertyName));
54256
+ var spreadableProperties = [];
54257
+ var unspreadableToRestKeys = [];
54258
+ for (var _i = 0, _a = getPropertiesOfType(source); _i < _a.length; _i++) {
54259
+ var prop = _a[_i];
54260
+ var literalTypeFromProperty = getLiteralTypeFromProperty(prop, 8576 /* StringOrNumberLiteralOrUnique */);
54261
+ if (!isTypeAssignableTo(literalTypeFromProperty, omitKeyType)
54262
+ && !(ts.getDeclarationModifierFlagsFromSymbol(prop) & (8 /* Private */ | 16 /* Protected */))
54263
+ && isSpreadableProperty(prop)) {
54264
+ spreadableProperties.push(prop);
54265
+ }
54266
+ else {
54267
+ unspreadableToRestKeys.push(literalTypeFromProperty);
54268
+ }
54269
+ }
54252
54270
  if (isGenericObjectType(source) || isGenericIndexType(omitKeyType)) {
54271
+ if (unspreadableToRestKeys.length) {
54272
+ // If the type we're spreading from has properties that cannot
54273
+ // be spread into the rest type (e.g. getters, methods), ensure
54274
+ // they are explicitly omitted, as they would in the non-generic case.
54275
+ omitKeyType = getUnionType(__spreadArray([omitKeyType], unspreadableToRestKeys, true));
54276
+ }
54253
54277
  if (omitKeyType.flags & 131072 /* Never */) {
54254
54278
  return source;
54255
54279
  }
@@ -54260,13 +54284,9 @@ var ts;
54260
54284
  return getTypeAliasInstantiation(omitTypeAlias, [source, omitKeyType]);
54261
54285
  }
54262
54286
  var members = ts.createSymbolTable();
54263
- for (var _i = 0, _a = getPropertiesOfType(source); _i < _a.length; _i++) {
54264
- var prop = _a[_i];
54265
- if (!isTypeAssignableTo(getLiteralTypeFromProperty(prop, 8576 /* StringOrNumberLiteralOrUnique */), omitKeyType)
54266
- && !(ts.getDeclarationModifierFlagsFromSymbol(prop) & (8 /* Private */ | 16 /* Protected */))
54267
- && isSpreadableProperty(prop)) {
54268
- members.set(prop.escapedName, getSpreadSymbol(prop, /*readonly*/ false));
54269
- }
54287
+ for (var _b = 0, spreadableProperties_1 = spreadableProperties; _b < spreadableProperties_1.length; _b++) {
54288
+ var prop = spreadableProperties_1[_b];
54289
+ members.set(prop.escapedName, getSpreadSymbol(prop, /*readonly*/ false));
54270
54290
  }
54271
54291
  var result = createAnonymousType(symbol, members, ts.emptyArray, ts.emptyArray, getIndexInfosOfType(source));
54272
54292
  result.objectFlags |= 8388608 /* ObjectRestType */;
@@ -74533,7 +74553,7 @@ var ts;
74533
74553
  typeArguments.pop();
74534
74554
  }
74535
74555
  while (typeArguments.length < typeParameters.length) {
74536
- typeArguments.push(getConstraintOfTypeParameter(typeParameters[typeArguments.length]) || getDefaultTypeArgumentType(isJs));
74556
+ typeArguments.push(getDefaultFromTypeParameter(typeParameters[typeArguments.length]) || getConstraintOfTypeParameter(typeParameters[typeArguments.length]) || getDefaultTypeArgumentType(isJs));
74537
74557
  }
74538
74558
  return typeArguments;
74539
74559
  }
@@ -75189,8 +75209,7 @@ var ts;
75189
75209
  */
75190
75210
  function checkCallExpression(node, checkMode) {
75191
75211
  var _a;
75192
- if (!checkGrammarTypeArguments(node, node.typeArguments))
75193
- checkGrammarArguments(node.arguments);
75212
+ checkGrammarTypeArguments(node, node.typeArguments);
75194
75213
  var signature = getResolvedSignature(node, /*candidatesOutArray*/ undefined, checkMode);
75195
75214
  if (signature === resolvingSignature) {
75196
75215
  // CheckMode.SkipGenericFunctions is enabled and this is a call to a generic function that
@@ -75295,8 +75314,7 @@ var ts;
75295
75314
  }
75296
75315
  function checkImportCallExpression(node) {
75297
75316
  // Check grammar of dynamic import
75298
- if (!checkGrammarArguments(node.arguments))
75299
- checkGrammarImportCallExpression(node);
75317
+ checkGrammarImportCallExpression(node);
75300
75318
  if (node.arguments.length === 0) {
75301
75319
  return createPromiseReturnType(node, anyType);
75302
75320
  }
@@ -82404,7 +82422,7 @@ var ts;
82404
82422
  for (var _a = 0, properties_4 = properties_5; _a < properties_4.length; _a++) {
82405
82423
  var prop = properties_4[_a];
82406
82424
  var existing = seen.get(prop.escapedName);
82407
- if (existing && !isPropertyIdenticalTo(existing, prop)) {
82425
+ if (existing && prop.parent === existing.parent) {
82408
82426
  seen.delete(prop.escapedName);
82409
82427
  }
82410
82428
  }
@@ -85957,20 +85975,6 @@ var ts;
85957
85975
  }
85958
85976
  return false;
85959
85977
  }
85960
- function checkGrammarForOmittedArgument(args) {
85961
- if (args) {
85962
- for (var _i = 0, args_4 = args; _i < args_4.length; _i++) {
85963
- var arg = args_4[_i];
85964
- if (arg.kind === 226 /* OmittedExpression */) {
85965
- return grammarErrorAtPos(arg, arg.pos, 0, ts.Diagnostics.Argument_expression_expected);
85966
- }
85967
- }
85968
- }
85969
- return false;
85970
- }
85971
- function checkGrammarArguments(args) {
85972
- return checkGrammarForOmittedArgument(args);
85973
- }
85974
85978
  function checkGrammarHeritageClause(node) {
85975
85979
  var types = node.types;
85976
85980
  if (checkGrammarForDisallowedTrailingComma(types)) {
@@ -103218,7 +103222,7 @@ var ts;
103218
103222
  if (ts.isIdentifier(node.expression)) {
103219
103223
  var expression = substituteExpressionIdentifier(node.expression);
103220
103224
  noSubstitution[ts.getNodeId(expression)] = true;
103221
- if (!ts.isIdentifier(expression)) {
103225
+ if (!ts.isIdentifier(expression) && !(ts.getEmitFlags(node.expression) & 4096 /* HelperName */)) {
103222
103226
  return ts.addEmitFlags(factory.updateCallExpression(node, expression,
103223
103227
  /*typeArguments*/ undefined, node.arguments), 536870912 /* IndirectCall */);
103224
103228
  }
@@ -103229,7 +103233,7 @@ var ts;
103229
103233
  if (ts.isIdentifier(node.tag)) {
103230
103234
  var tag = substituteExpressionIdentifier(node.tag);
103231
103235
  noSubstitution[ts.getNodeId(tag)] = true;
103232
- if (!ts.isIdentifier(tag)) {
103236
+ if (!ts.isIdentifier(tag) && !(ts.getEmitFlags(node.tag) & 4096 /* HelperName */)) {
103233
103237
  return ts.addEmitFlags(factory.updateTaggedTemplateExpression(node, tag,
103234
103238
  /*typeArguments*/ undefined, node.template), 536870912 /* IndirectCall */);
103235
103239
  }
@@ -113855,6 +113859,7 @@ var ts;
113855
113859
  ts.getImpliedNodeFormatForFile = getImpliedNodeFormatForFile;
113856
113860
  /** @internal */
113857
113861
  ts.plainJSErrors = new ts.Set([
113862
+ // binder errors
113858
113863
  ts.Diagnostics.Cannot_redeclare_block_scoped_variable_0.code,
113859
113864
  ts.Diagnostics.A_module_cannot_have_multiple_default_exports.code,
113860
113865
  ts.Diagnostics.Another_export_default_is_here.code,
@@ -113870,6 +113875,81 @@ var ts;
113870
113875
  ts.Diagnostics.A_label_is_not_allowed_here.code,
113871
113876
  ts.Diagnostics.Octal_literals_are_not_allowed_in_strict_mode.code,
113872
113877
  ts.Diagnostics.with_statements_are_not_allowed_in_strict_mode.code,
113878
+ // grammar errors
113879
+ ts.Diagnostics.A_break_statement_can_only_be_used_within_an_enclosing_iteration_or_switch_statement.code,
113880
+ ts.Diagnostics.A_break_statement_can_only_jump_to_a_label_of_an_enclosing_statement.code,
113881
+ ts.Diagnostics.A_class_declaration_without_the_default_modifier_must_have_a_name.code,
113882
+ ts.Diagnostics.A_class_member_cannot_have_the_0_keyword.code,
113883
+ ts.Diagnostics.A_comma_expression_is_not_allowed_in_a_computed_property_name.code,
113884
+ ts.Diagnostics.A_continue_statement_can_only_be_used_within_an_enclosing_iteration_statement.code,
113885
+ ts.Diagnostics.A_continue_statement_can_only_jump_to_a_label_of_an_enclosing_iteration_statement.code,
113886
+ ts.Diagnostics.A_continue_statement_can_only_jump_to_a_label_of_an_enclosing_iteration_statement.code,
113887
+ ts.Diagnostics.A_default_clause_cannot_appear_more_than_once_in_a_switch_statement.code,
113888
+ ts.Diagnostics.A_default_export_must_be_at_the_top_level_of_a_file_or_module_declaration.code,
113889
+ ts.Diagnostics.A_definite_assignment_assertion_is_not_permitted_in_this_context.code,
113890
+ ts.Diagnostics.A_destructuring_declaration_must_have_an_initializer.code,
113891
+ ts.Diagnostics.A_get_accessor_cannot_have_parameters.code,
113892
+ ts.Diagnostics.A_rest_element_cannot_contain_a_binding_pattern.code,
113893
+ ts.Diagnostics.A_rest_element_cannot_have_a_property_name.code,
113894
+ ts.Diagnostics.A_rest_element_cannot_have_an_initializer.code,
113895
+ ts.Diagnostics.A_rest_element_must_be_last_in_a_destructuring_pattern.code,
113896
+ ts.Diagnostics.A_rest_parameter_cannot_have_an_initializer.code,
113897
+ ts.Diagnostics.A_rest_parameter_must_be_last_in_a_parameter_list.code,
113898
+ ts.Diagnostics.A_rest_parameter_or_binding_pattern_may_not_have_a_trailing_comma.code,
113899
+ ts.Diagnostics.A_return_statement_can_only_be_used_within_a_function_body.code,
113900
+ ts.Diagnostics.A_return_statement_cannot_be_used_inside_a_class_static_block.code,
113901
+ ts.Diagnostics.A_set_accessor_cannot_have_rest_parameter.code,
113902
+ ts.Diagnostics.A_set_accessor_must_have_exactly_one_parameter.code,
113903
+ ts.Diagnostics.An_export_declaration_can_only_be_used_in_a_module.code,
113904
+ ts.Diagnostics.An_export_declaration_cannot_have_modifiers.code,
113905
+ ts.Diagnostics.An_import_declaration_can_only_be_used_in_a_namespace_or_module.code,
113906
+ ts.Diagnostics.An_import_declaration_cannot_have_modifiers.code,
113907
+ ts.Diagnostics.An_object_member_cannot_be_declared_optional.code,
113908
+ ts.Diagnostics.Argument_of_dynamic_import_cannot_be_spread_element.code,
113909
+ ts.Diagnostics.Cannot_assign_to_private_method_0_Private_methods_are_not_writable.code,
113910
+ ts.Diagnostics.Cannot_redeclare_identifier_0_in_catch_clause.code,
113911
+ ts.Diagnostics.Catch_clause_variable_cannot_have_an_initializer.code,
113912
+ ts.Diagnostics.Class_decorators_can_t_be_used_with_static_private_identifier_Consider_removing_the_experimental_decorator.code,
113913
+ ts.Diagnostics.Classes_can_only_extend_a_single_class.code,
113914
+ ts.Diagnostics.Classes_may_not_have_a_field_named_constructor.code,
113915
+ ts.Diagnostics.Did_you_mean_to_use_a_Colon_An_can_only_follow_a_property_name_when_the_containing_object_literal_is_part_of_a_destructuring_pattern.code,
113916
+ ts.Diagnostics.Duplicate_label_0.code,
113917
+ ts.Diagnostics.Dynamic_imports_can_only_accept_a_module_specifier_and_an_optional_assertion_as_arguments.code,
113918
+ ts.Diagnostics.For_await_loops_cannot_be_used_inside_a_class_static_block.code,
113919
+ ts.Diagnostics.JSX_attributes_must_only_be_assigned_a_non_empty_expression.code,
113920
+ ts.Diagnostics.JSX_elements_cannot_have_multiple_attributes_with_the_same_name.code,
113921
+ ts.Diagnostics.JSX_expressions_may_not_use_the_comma_operator_Did_you_mean_to_write_an_array.code,
113922
+ ts.Diagnostics.JSX_property_access_expressions_cannot_include_JSX_namespace_names.code,
113923
+ ts.Diagnostics.Jump_target_cannot_cross_function_boundary.code,
113924
+ ts.Diagnostics.Line_terminator_not_permitted_before_arrow.code,
113925
+ ts.Diagnostics.Modifiers_cannot_appear_here.code,
113926
+ ts.Diagnostics.Only_a_single_variable_declaration_is_allowed_in_a_for_in_statement.code,
113927
+ ts.Diagnostics.Only_a_single_variable_declaration_is_allowed_in_a_for_of_statement.code,
113928
+ ts.Diagnostics.Private_identifiers_are_not_allowed_outside_class_bodies.code,
113929
+ ts.Diagnostics.Private_identifiers_are_only_allowed_in_class_bodies_and_may_only_be_used_as_part_of_a_class_member_declaration_property_access_or_on_the_left_hand_side_of_an_in_expression.code,
113930
+ ts.Diagnostics.Property_0_is_not_accessible_outside_class_1_because_it_has_a_private_identifier.code,
113931
+ ts.Diagnostics.Tagged_template_expressions_are_not_permitted_in_an_optional_chain.code,
113932
+ ts.Diagnostics.The_left_hand_side_of_a_for_of_statement_may_not_be_async.code,
113933
+ ts.Diagnostics.The_variable_declaration_of_a_for_in_statement_cannot_have_an_initializer.code,
113934
+ ts.Diagnostics.The_variable_declaration_of_a_for_of_statement_cannot_have_an_initializer.code,
113935
+ ts.Diagnostics.Trailing_comma_not_allowed.code,
113936
+ ts.Diagnostics.Variable_declaration_list_cannot_be_empty.code,
113937
+ ts.Diagnostics._0_and_1_operations_cannot_be_mixed_without_parentheses.code,
113938
+ ts.Diagnostics._0_expected.code,
113939
+ ts.Diagnostics._0_is_not_a_valid_meta_property_for_keyword_1_Did_you_mean_2.code,
113940
+ ts.Diagnostics._0_list_cannot_be_empty.code,
113941
+ ts.Diagnostics._0_modifier_already_seen.code,
113942
+ ts.Diagnostics._0_modifier_cannot_appear_on_a_constructor_declaration.code,
113943
+ ts.Diagnostics._0_modifier_cannot_appear_on_a_module_or_namespace_element.code,
113944
+ ts.Diagnostics._0_modifier_cannot_appear_on_a_parameter.code,
113945
+ ts.Diagnostics._0_modifier_cannot_appear_on_class_elements_of_this_kind.code,
113946
+ ts.Diagnostics._0_modifier_cannot_be_used_here.code,
113947
+ ts.Diagnostics._0_modifier_must_precede_1_modifier.code,
113948
+ ts.Diagnostics.const_declarations_can_only_be_declared_inside_a_block.code,
113949
+ ts.Diagnostics.const_declarations_must_be_initialized.code,
113950
+ ts.Diagnostics.extends_clause_already_seen.code,
113951
+ ts.Diagnostics.let_declarations_can_only_be_declared_inside_a_block.code,
113952
+ ts.Diagnostics.let_is_not_allowed_to_be_used_as_a_name_in_let_or_const_declarations.code,
113873
113953
  ]);
113874
113954
  /**
113875
113955
  * Determine if source file needs to be re-created even if its text hasn't changed
@@ -114899,9 +114979,10 @@ var ts;
114899
114979
  var includeBindAndCheckDiagnostics = !isTsNoCheck && (sourceFile.scriptKind === 3 /* TS */ || sourceFile.scriptKind === 4 /* TSX */
114900
114980
  || sourceFile.scriptKind === 5 /* External */ || isPlainJs || isCheckJs || sourceFile.scriptKind === 7 /* Deferred */);
114901
114981
  var bindDiagnostics = includeBindAndCheckDiagnostics ? sourceFile.bindDiagnostics : ts.emptyArray;
114902
- var checkDiagnostics = includeBindAndCheckDiagnostics && !isPlainJs ? typeChecker.getDiagnostics(sourceFile, cancellationToken) : ts.emptyArray;
114982
+ var checkDiagnostics = includeBindAndCheckDiagnostics ? typeChecker.getDiagnostics(sourceFile, cancellationToken) : ts.emptyArray;
114903
114983
  if (isPlainJs) {
114904
114984
  bindDiagnostics = ts.filter(bindDiagnostics, function (d) { return ts.plainJSErrors.has(d.code); });
114985
+ checkDiagnostics = ts.filter(checkDiagnostics, function (d) { return ts.plainJSErrors.has(d.code); });
114905
114986
  }
114906
114987
  // skip ts-expect-error errors in plain JS files, and skip JSDoc errors except in checked JS
114907
114988
  return getMergedBindAndCheckDiagnostics(sourceFile, includeBindAndCheckDiagnostics && !isPlainJs, bindDiagnostics, checkDiagnostics, isCheckJs ? sourceFile.jsDocDiagnostics : undefined);
@@ -119919,7 +120000,7 @@ var ts;
119919
120000
  getCanonicalFileName: ts.createGetCanonicalFileName(ts.sys.useCaseSensitiveFileNames)
119920
120001
  } : undefined;
119921
120002
  /**
119922
- * Create a function that reports error by writing to the system and handles the formating of the diagnostic
120003
+ * Create a function that reports error by writing to the system and handles the formatting of the diagnostic
119923
120004
  */
119924
120005
  function createDiagnosticReporter(system, pretty) {
119925
120006
  var host = system === ts.sys && sysFormatDiagnosticsHost ? sysFormatDiagnosticsHost : {
@@ -120005,19 +120086,74 @@ var ts;
120005
120086
  return ts.countWhere(diagnostics, function (diagnostic) { return diagnostic.category === ts.DiagnosticCategory.Error; });
120006
120087
  }
120007
120088
  ts.getErrorCountForSummary = getErrorCountForSummary;
120089
+ function getFilesInErrorForSummary(diagnostics) {
120090
+ var filesInError = ts.filter(diagnostics, function (diagnostic) { return diagnostic.category === ts.DiagnosticCategory.Error; })
120091
+ .map(function (errorDiagnostic) {
120092
+ if (errorDiagnostic.file === undefined)
120093
+ return;
120094
+ return "" + errorDiagnostic.file.fileName;
120095
+ });
120096
+ return filesInError.map(function (fileName) {
120097
+ var diagnosticForFileName = ts.find(diagnostics, function (diagnostic) {
120098
+ return diagnostic.file !== undefined && diagnostic.file.fileName === fileName;
120099
+ });
120100
+ if (diagnosticForFileName !== undefined) {
120101
+ var line = ts.getLineAndCharacterOfPosition(diagnosticForFileName.file, diagnosticForFileName.start).line;
120102
+ return {
120103
+ fileName: fileName,
120104
+ line: line + 1,
120105
+ };
120106
+ }
120107
+ });
120108
+ }
120109
+ ts.getFilesInErrorForSummary = getFilesInErrorForSummary;
120008
120110
  function getWatchErrorSummaryDiagnosticMessage(errorCount) {
120009
120111
  return errorCount === 1 ?
120010
120112
  ts.Diagnostics.Found_1_error_Watching_for_file_changes :
120011
120113
  ts.Diagnostics.Found_0_errors_Watching_for_file_changes;
120012
120114
  }
120013
120115
  ts.getWatchErrorSummaryDiagnosticMessage = getWatchErrorSummaryDiagnosticMessage;
120014
- function getErrorSummaryText(errorCount, newLine) {
120116
+ function getErrorSummaryText(errorCount, filesInError, newLine) {
120015
120117
  if (errorCount === 0)
120016
120118
  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;
120119
+ var nonNilFiles = filesInError.filter(function (fileInError) { return fileInError !== undefined; });
120120
+ var distinctFileNamesWithLines = nonNilFiles.map(function (fileInError) { return fileInError.fileName + ":" + fileInError.line; })
120121
+ .filter(function (value, index, self) { return self.indexOf(value) === index; });
120122
+ var d = errorCount === 1 ?
120123
+ ts.createCompilerDiagnostic(filesInError[0] !== undefined ?
120124
+ ts.Diagnostics.Found_1_error_in_1 :
120125
+ ts.Diagnostics.Found_1_error, errorCount, distinctFileNamesWithLines[0]) :
120126
+ ts.createCompilerDiagnostic(distinctFileNamesWithLines.length === 0 ?
120127
+ ts.Diagnostics.Found_0_errors :
120128
+ distinctFileNamesWithLines.length === 1 ?
120129
+ ts.Diagnostics.Found_0_errors_in_1_file :
120130
+ ts.Diagnostics.Found_0_errors_in_1_files, errorCount, distinctFileNamesWithLines.length);
120131
+ return "" + newLine + ts.flattenDiagnosticMessageText(d.messageText, newLine) + newLine + newLine + (errorCount > 1 ? createTabularErrorsDisplay(nonNilFiles) : "");
120019
120132
  }
120020
120133
  ts.getErrorSummaryText = getErrorSummaryText;
120134
+ function createTabularErrorsDisplay(filesInError) {
120135
+ 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); }); });
120136
+ if (distinctFiles.length === 0)
120137
+ return "";
120138
+ var numberLength = function (num) { return Math.log(num) * Math.LOG10E + 1; };
120139
+ var fileToErrorCount = distinctFiles.map(function (file) { return [file, ts.countWhere(filesInError, function (fileInError) { return fileInError.fileName === file.fileName; })]; });
120140
+ var maxErrors = fileToErrorCount.reduce(function (acc, value) { return Math.max(acc, value[1] || 0); }, 0);
120141
+ var headerRow = ts.Diagnostics.Errors_Files.message;
120142
+ var leftColumnHeadingLength = headerRow.split(" ")[0].length;
120143
+ var leftPaddingGoal = Math.max(leftColumnHeadingLength, numberLength(maxErrors));
120144
+ var headerPadding = Math.max(numberLength(maxErrors) - leftColumnHeadingLength, 0);
120145
+ var tabularData = "";
120146
+ tabularData += " ".repeat(headerPadding) + headerRow + "\n";
120147
+ fileToErrorCount.forEach(function (row) {
120148
+ var file = row[0], errorCount = row[1];
120149
+ var errorCountDigitsLength = Math.log(errorCount) * Math.LOG10E + 1 | 0;
120150
+ var leftPadding = errorCountDigitsLength < leftPaddingGoal ?
120151
+ " ".repeat(leftPaddingGoal - errorCountDigitsLength)
120152
+ : "";
120153
+ tabularData += "" + leftPadding + errorCount + " " + file.fileName + ":" + file.line + "\n";
120154
+ });
120155
+ return tabularData;
120156
+ }
120021
120157
  function isBuilderProgram(program) {
120022
120158
  return !!program.getState;
120023
120159
  }
@@ -120221,7 +120357,7 @@ var ts;
120221
120357
  listFiles(program, write);
120222
120358
  }
120223
120359
  if (reportSummary) {
120224
- reportSummary(getErrorCountForSummary(diagnostics));
120360
+ reportSummary(getErrorCountForSummary(diagnostics), getFilesInErrorForSummary(diagnostics));
120225
120361
  }
120226
120362
  return {
120227
120363
  emitResult: emitResult,
@@ -120432,7 +120568,7 @@ var ts;
120432
120568
  var system = input.system || ts.sys;
120433
120569
  var host = input.host || (input.host = ts.createIncrementalCompilerHost(input.options, system));
120434
120570
  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);
120571
+ 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
120572
  if (input.afterProgramEmitAndDiagnostics)
120437
120573
  input.afterProgramEmitAndDiagnostics(builderProgram);
120438
120574
  return exitStatus;
@@ -122651,11 +122787,14 @@ var ts;
122651
122787
  var canReportSummary = state.watch || !!state.host.reportErrorSummary;
122652
122788
  var diagnostics = state.diagnostics;
122653
122789
  var totalErrors = 0;
122790
+ var filesInError = [];
122654
122791
  if (isCircularBuildOrder(buildOrder)) {
122655
122792
  reportBuildQueue(state, buildOrder.buildOrder);
122656
122793
  reportErrors(state, buildOrder.circularDiagnostics);
122657
122794
  if (canReportSummary)
122658
122795
  totalErrors += ts.getErrorCountForSummary(buildOrder.circularDiagnostics);
122796
+ if (canReportSummary)
122797
+ filesInError = __spreadArray(__spreadArray([], filesInError, true), ts.getFilesInErrorForSummary(buildOrder.circularDiagnostics), true);
122659
122798
  }
122660
122799
  else {
122661
122800
  // Report errors from the other projects
@@ -122667,12 +122806,14 @@ var ts;
122667
122806
  });
122668
122807
  if (canReportSummary)
122669
122808
  diagnostics.forEach(function (singleProjectErrors) { return totalErrors += ts.getErrorCountForSummary(singleProjectErrors); });
122809
+ if (canReportSummary)
122810
+ diagnostics.forEach(function (singleProjectErrors) { return __spreadArray(__spreadArray([], filesInError, true), ts.getFilesInErrorForSummary(singleProjectErrors), true); });
122670
122811
  }
122671
122812
  if (state.watch) {
122672
122813
  reportWatchStatus(state, ts.getWatchErrorSummaryDiagnosticMessage(totalErrors), totalErrors);
122673
122814
  }
122674
122815
  else if (state.host.reportErrorSummary) {
122675
- state.host.reportErrorSummary(totalErrors);
122816
+ state.host.reportErrorSummary(totalErrors, filesInError);
122676
122817
  }
122677
122818
  }
122678
122819
  /**
@@ -127917,6 +128058,9 @@ var ts;
127917
128058
  }
127918
128059
  return;
127919
128060
  }
128061
+ if (ts.isConstTypeReference(token.parent)) {
128062
+ return 3 /* keyword */;
128063
+ }
127920
128064
  }
127921
128065
  return 2 /* identifier */;
127922
128066
  }
@@ -131737,8 +131881,10 @@ var ts;
131737
131881
  }
131738
131882
  /** Get the corresponding JSDocTag node if the position is in a jsDoc comment */
131739
131883
  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);
131884
+ return ts.findAncestor(node, function (n) {
131885
+ return ts.isJSDocTag(n) && ts.rangeContainsPosition(n, position) ? true :
131886
+ ts.isJSDoc(n) ? "quit" : false;
131887
+ });
131742
131888
  }
131743
131889
  function getPropertiesForObjectExpression(contextualType, completionsType, obj, checker) {
131744
131890
  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
  /**