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/lib.es5.d.ts +1 -1
- package/lib/tsc.js +175 -39
- package/lib/tsserver.js +187 -41
- package/lib/tsserverlibrary.d.ts +5 -1
- package/lib/tsserverlibrary.js +187 -41
- package/lib/typescript.d.ts +5 -1
- package/lib/typescript.js +187 -41
- package/lib/typescriptServices.d.ts +5 -1
- package/lib/typescriptServices.js +187 -41
- package/lib/typingsInstaller.js +180 -39
- package/package.json +2 -1
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.
|
|
72
|
+
ts.version = ts.versionMajorMinor + ".0-dev.20211211";
|
|
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."),
|
|
@@ -19674,7 +19678,7 @@ var ts;
|
|
|
19674
19678
|
}
|
|
19675
19679
|
function createAssertClause(elements, multiLine) {
|
|
19676
19680
|
var node = createBaseNode(292);
|
|
19677
|
-
node.elements = elements;
|
|
19681
|
+
node.elements = createNodeArray(elements);
|
|
19678
19682
|
node.multiLine = multiLine;
|
|
19679
19683
|
node.transformFlags |= 4;
|
|
19680
19684
|
return node;
|
|
@@ -44580,7 +44584,24 @@ var ts;
|
|
|
44580
44584
|
return mapType(source, function (t) { return getRestType(t, properties, symbol); });
|
|
44581
44585
|
}
|
|
44582
44586
|
var omitKeyType = getUnionType(ts.map(properties, getLiteralTypeFromPropertyName));
|
|
44587
|
+
var spreadableProperties = [];
|
|
44588
|
+
var unspreadableToRestKeys = [];
|
|
44589
|
+
for (var _i = 0, _a = getPropertiesOfType(source); _i < _a.length; _i++) {
|
|
44590
|
+
var prop = _a[_i];
|
|
44591
|
+
var literalTypeFromProperty = getLiteralTypeFromProperty(prop, 8576);
|
|
44592
|
+
if (!isTypeAssignableTo(literalTypeFromProperty, omitKeyType)
|
|
44593
|
+
&& !(ts.getDeclarationModifierFlagsFromSymbol(prop) & (8 | 16))
|
|
44594
|
+
&& isSpreadableProperty(prop)) {
|
|
44595
|
+
spreadableProperties.push(prop);
|
|
44596
|
+
}
|
|
44597
|
+
else {
|
|
44598
|
+
unspreadableToRestKeys.push(literalTypeFromProperty);
|
|
44599
|
+
}
|
|
44600
|
+
}
|
|
44583
44601
|
if (isGenericObjectType(source) || isGenericIndexType(omitKeyType)) {
|
|
44602
|
+
if (unspreadableToRestKeys.length) {
|
|
44603
|
+
omitKeyType = getUnionType(__spreadArray([omitKeyType], unspreadableToRestKeys, true));
|
|
44604
|
+
}
|
|
44584
44605
|
if (omitKeyType.flags & 131072) {
|
|
44585
44606
|
return source;
|
|
44586
44607
|
}
|
|
@@ -44591,13 +44612,9 @@ var ts;
|
|
|
44591
44612
|
return getTypeAliasInstantiation(omitTypeAlias, [source, omitKeyType]);
|
|
44592
44613
|
}
|
|
44593
44614
|
var members = ts.createSymbolTable();
|
|
44594
|
-
for (var
|
|
44595
|
-
var prop =
|
|
44596
|
-
|
|
44597
|
-
&& !(ts.getDeclarationModifierFlagsFromSymbol(prop) & (8 | 16))
|
|
44598
|
-
&& isSpreadableProperty(prop)) {
|
|
44599
|
-
members.set(prop.escapedName, getSpreadSymbol(prop, false));
|
|
44600
|
-
}
|
|
44615
|
+
for (var _b = 0, spreadableProperties_1 = spreadableProperties; _b < spreadableProperties_1.length; _b++) {
|
|
44616
|
+
var prop = spreadableProperties_1[_b];
|
|
44617
|
+
members.set(prop.escapedName, getSpreadSymbol(prop, false));
|
|
44601
44618
|
}
|
|
44602
44619
|
var result = createAnonymousType(symbol, members, ts.emptyArray, ts.emptyArray, getIndexInfosOfType(source));
|
|
44603
44620
|
result.objectFlags |= 8388608;
|
|
@@ -62129,7 +62146,7 @@ var ts;
|
|
|
62129
62146
|
typeArguments.pop();
|
|
62130
62147
|
}
|
|
62131
62148
|
while (typeArguments.length < typeParameters.length) {
|
|
62132
|
-
typeArguments.push(getConstraintOfTypeParameter(typeParameters[typeArguments.length]) || getDefaultTypeArgumentType(isJs));
|
|
62149
|
+
typeArguments.push(getDefaultFromTypeParameter(typeParameters[typeArguments.length]) || getConstraintOfTypeParameter(typeParameters[typeArguments.length]) || getDefaultTypeArgumentType(isJs));
|
|
62133
62150
|
}
|
|
62134
62151
|
return typeArguments;
|
|
62135
62152
|
}
|
|
@@ -62675,8 +62692,7 @@ var ts;
|
|
|
62675
62692
|
}
|
|
62676
62693
|
function checkCallExpression(node, checkMode) {
|
|
62677
62694
|
var _a;
|
|
62678
|
-
|
|
62679
|
-
checkGrammarArguments(node.arguments);
|
|
62695
|
+
checkGrammarTypeArguments(node, node.typeArguments);
|
|
62680
62696
|
var signature = getResolvedSignature(node, undefined, checkMode);
|
|
62681
62697
|
if (signature === resolvingSignature) {
|
|
62682
62698
|
return nonInferrableType;
|
|
@@ -62773,8 +62789,7 @@ var ts;
|
|
|
62773
62789
|
return globalESSymbol === resolveName(left, "Symbol", 111551, undefined, undefined, false);
|
|
62774
62790
|
}
|
|
62775
62791
|
function checkImportCallExpression(node) {
|
|
62776
|
-
|
|
62777
|
-
checkGrammarImportCallExpression(node);
|
|
62792
|
+
checkGrammarImportCallExpression(node);
|
|
62778
62793
|
if (node.arguments.length === 0) {
|
|
62779
62794
|
return createPromiseReturnType(node, anyType);
|
|
62780
62795
|
}
|
|
@@ -68824,7 +68839,7 @@ var ts;
|
|
|
68824
68839
|
for (var _a = 0, properties_4 = properties_5; _a < properties_4.length; _a++) {
|
|
68825
68840
|
var prop = properties_4[_a];
|
|
68826
68841
|
var existing = seen.get(prop.escapedName);
|
|
68827
|
-
if (existing &&
|
|
68842
|
+
if (existing && prop.parent === existing.parent) {
|
|
68828
68843
|
seen.delete(prop.escapedName);
|
|
68829
68844
|
}
|
|
68830
68845
|
}
|
|
@@ -72057,20 +72072,6 @@ var ts;
|
|
|
72057
72072
|
}
|
|
72058
72073
|
return false;
|
|
72059
72074
|
}
|
|
72060
|
-
function checkGrammarForOmittedArgument(args) {
|
|
72061
|
-
if (args) {
|
|
72062
|
-
for (var _i = 0, args_4 = args; _i < args_4.length; _i++) {
|
|
72063
|
-
var arg = args_4[_i];
|
|
72064
|
-
if (arg.kind === 226) {
|
|
72065
|
-
return grammarErrorAtPos(arg, arg.pos, 0, ts.Diagnostics.Argument_expression_expected);
|
|
72066
|
-
}
|
|
72067
|
-
}
|
|
72068
|
-
}
|
|
72069
|
-
return false;
|
|
72070
|
-
}
|
|
72071
|
-
function checkGrammarArguments(args) {
|
|
72072
|
-
return checkGrammarForOmittedArgument(args);
|
|
72073
|
-
}
|
|
72074
72075
|
function checkGrammarHeritageClause(node) {
|
|
72075
72076
|
var types = node.types;
|
|
72076
72077
|
if (checkGrammarForDisallowedTrailingComma(types)) {
|
|
@@ -84641,7 +84642,7 @@ var ts;
|
|
|
84641
84642
|
if (ts.isIdentifier(node.expression)) {
|
|
84642
84643
|
var expression = substituteExpressionIdentifier(node.expression);
|
|
84643
84644
|
noSubstitution[ts.getNodeId(expression)] = true;
|
|
84644
|
-
if (!ts.isIdentifier(expression)) {
|
|
84645
|
+
if (!ts.isIdentifier(expression) && !(ts.getEmitFlags(node.expression) & 4096)) {
|
|
84645
84646
|
return ts.addEmitFlags(factory.updateCallExpression(node, expression, undefined, node.arguments), 536870912);
|
|
84646
84647
|
}
|
|
84647
84648
|
}
|
|
@@ -84651,7 +84652,7 @@ var ts;
|
|
|
84651
84652
|
if (ts.isIdentifier(node.tag)) {
|
|
84652
84653
|
var tag = substituteExpressionIdentifier(node.tag);
|
|
84653
84654
|
noSubstitution[ts.getNodeId(tag)] = true;
|
|
84654
|
-
if (!ts.isIdentifier(tag)) {
|
|
84655
|
+
if (!ts.isIdentifier(tag) && !(ts.getEmitFlags(node.tag) & 4096)) {
|
|
84655
84656
|
return ts.addEmitFlags(factory.updateTaggedTemplateExpression(node, tag, undefined, node.template), 536870912);
|
|
84656
84657
|
}
|
|
84657
84658
|
}
|
|
@@ -93746,6 +93747,80 @@ var ts;
|
|
|
93746
93747
|
ts.Diagnostics.A_label_is_not_allowed_here.code,
|
|
93747
93748
|
ts.Diagnostics.Octal_literals_are_not_allowed_in_strict_mode.code,
|
|
93748
93749
|
ts.Diagnostics.with_statements_are_not_allowed_in_strict_mode.code,
|
|
93750
|
+
ts.Diagnostics.A_break_statement_can_only_be_used_within_an_enclosing_iteration_or_switch_statement.code,
|
|
93751
|
+
ts.Diagnostics.A_break_statement_can_only_jump_to_a_label_of_an_enclosing_statement.code,
|
|
93752
|
+
ts.Diagnostics.A_class_declaration_without_the_default_modifier_must_have_a_name.code,
|
|
93753
|
+
ts.Diagnostics.A_class_member_cannot_have_the_0_keyword.code,
|
|
93754
|
+
ts.Diagnostics.A_comma_expression_is_not_allowed_in_a_computed_property_name.code,
|
|
93755
|
+
ts.Diagnostics.A_continue_statement_can_only_be_used_within_an_enclosing_iteration_statement.code,
|
|
93756
|
+
ts.Diagnostics.A_continue_statement_can_only_jump_to_a_label_of_an_enclosing_iteration_statement.code,
|
|
93757
|
+
ts.Diagnostics.A_continue_statement_can_only_jump_to_a_label_of_an_enclosing_iteration_statement.code,
|
|
93758
|
+
ts.Diagnostics.A_default_clause_cannot_appear_more_than_once_in_a_switch_statement.code,
|
|
93759
|
+
ts.Diagnostics.A_default_export_must_be_at_the_top_level_of_a_file_or_module_declaration.code,
|
|
93760
|
+
ts.Diagnostics.A_definite_assignment_assertion_is_not_permitted_in_this_context.code,
|
|
93761
|
+
ts.Diagnostics.A_destructuring_declaration_must_have_an_initializer.code,
|
|
93762
|
+
ts.Diagnostics.A_get_accessor_cannot_have_parameters.code,
|
|
93763
|
+
ts.Diagnostics.A_rest_element_cannot_contain_a_binding_pattern.code,
|
|
93764
|
+
ts.Diagnostics.A_rest_element_cannot_have_a_property_name.code,
|
|
93765
|
+
ts.Diagnostics.A_rest_element_cannot_have_an_initializer.code,
|
|
93766
|
+
ts.Diagnostics.A_rest_element_must_be_last_in_a_destructuring_pattern.code,
|
|
93767
|
+
ts.Diagnostics.A_rest_parameter_cannot_have_an_initializer.code,
|
|
93768
|
+
ts.Diagnostics.A_rest_parameter_must_be_last_in_a_parameter_list.code,
|
|
93769
|
+
ts.Diagnostics.A_rest_parameter_or_binding_pattern_may_not_have_a_trailing_comma.code,
|
|
93770
|
+
ts.Diagnostics.A_return_statement_can_only_be_used_within_a_function_body.code,
|
|
93771
|
+
ts.Diagnostics.A_return_statement_cannot_be_used_inside_a_class_static_block.code,
|
|
93772
|
+
ts.Diagnostics.A_set_accessor_cannot_have_rest_parameter.code,
|
|
93773
|
+
ts.Diagnostics.A_set_accessor_must_have_exactly_one_parameter.code,
|
|
93774
|
+
ts.Diagnostics.An_export_declaration_can_only_be_used_in_a_module.code,
|
|
93775
|
+
ts.Diagnostics.An_export_declaration_cannot_have_modifiers.code,
|
|
93776
|
+
ts.Diagnostics.An_import_declaration_can_only_be_used_in_a_namespace_or_module.code,
|
|
93777
|
+
ts.Diagnostics.An_import_declaration_cannot_have_modifiers.code,
|
|
93778
|
+
ts.Diagnostics.An_object_member_cannot_be_declared_optional.code,
|
|
93779
|
+
ts.Diagnostics.Argument_of_dynamic_import_cannot_be_spread_element.code,
|
|
93780
|
+
ts.Diagnostics.Cannot_assign_to_private_method_0_Private_methods_are_not_writable.code,
|
|
93781
|
+
ts.Diagnostics.Cannot_redeclare_identifier_0_in_catch_clause.code,
|
|
93782
|
+
ts.Diagnostics.Catch_clause_variable_cannot_have_an_initializer.code,
|
|
93783
|
+
ts.Diagnostics.Class_decorators_can_t_be_used_with_static_private_identifier_Consider_removing_the_experimental_decorator.code,
|
|
93784
|
+
ts.Diagnostics.Classes_can_only_extend_a_single_class.code,
|
|
93785
|
+
ts.Diagnostics.Classes_may_not_have_a_field_named_constructor.code,
|
|
93786
|
+
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,
|
|
93787
|
+
ts.Diagnostics.Duplicate_label_0.code,
|
|
93788
|
+
ts.Diagnostics.Dynamic_imports_can_only_accept_a_module_specifier_and_an_optional_assertion_as_arguments.code,
|
|
93789
|
+
ts.Diagnostics.For_await_loops_cannot_be_used_inside_a_class_static_block.code,
|
|
93790
|
+
ts.Diagnostics.JSX_attributes_must_only_be_assigned_a_non_empty_expression.code,
|
|
93791
|
+
ts.Diagnostics.JSX_elements_cannot_have_multiple_attributes_with_the_same_name.code,
|
|
93792
|
+
ts.Diagnostics.JSX_expressions_may_not_use_the_comma_operator_Did_you_mean_to_write_an_array.code,
|
|
93793
|
+
ts.Diagnostics.JSX_property_access_expressions_cannot_include_JSX_namespace_names.code,
|
|
93794
|
+
ts.Diagnostics.Jump_target_cannot_cross_function_boundary.code,
|
|
93795
|
+
ts.Diagnostics.Line_terminator_not_permitted_before_arrow.code,
|
|
93796
|
+
ts.Diagnostics.Modifiers_cannot_appear_here.code,
|
|
93797
|
+
ts.Diagnostics.Only_a_single_variable_declaration_is_allowed_in_a_for_in_statement.code,
|
|
93798
|
+
ts.Diagnostics.Only_a_single_variable_declaration_is_allowed_in_a_for_of_statement.code,
|
|
93799
|
+
ts.Diagnostics.Private_identifiers_are_not_allowed_outside_class_bodies.code,
|
|
93800
|
+
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,
|
|
93801
|
+
ts.Diagnostics.Property_0_is_not_accessible_outside_class_1_because_it_has_a_private_identifier.code,
|
|
93802
|
+
ts.Diagnostics.Tagged_template_expressions_are_not_permitted_in_an_optional_chain.code,
|
|
93803
|
+
ts.Diagnostics.The_left_hand_side_of_a_for_of_statement_may_not_be_async.code,
|
|
93804
|
+
ts.Diagnostics.The_variable_declaration_of_a_for_in_statement_cannot_have_an_initializer.code,
|
|
93805
|
+
ts.Diagnostics.The_variable_declaration_of_a_for_of_statement_cannot_have_an_initializer.code,
|
|
93806
|
+
ts.Diagnostics.Trailing_comma_not_allowed.code,
|
|
93807
|
+
ts.Diagnostics.Variable_declaration_list_cannot_be_empty.code,
|
|
93808
|
+
ts.Diagnostics._0_and_1_operations_cannot_be_mixed_without_parentheses.code,
|
|
93809
|
+
ts.Diagnostics._0_expected.code,
|
|
93810
|
+
ts.Diagnostics._0_is_not_a_valid_meta_property_for_keyword_1_Did_you_mean_2.code,
|
|
93811
|
+
ts.Diagnostics._0_list_cannot_be_empty.code,
|
|
93812
|
+
ts.Diagnostics._0_modifier_already_seen.code,
|
|
93813
|
+
ts.Diagnostics._0_modifier_cannot_appear_on_a_constructor_declaration.code,
|
|
93814
|
+
ts.Diagnostics._0_modifier_cannot_appear_on_a_module_or_namespace_element.code,
|
|
93815
|
+
ts.Diagnostics._0_modifier_cannot_appear_on_a_parameter.code,
|
|
93816
|
+
ts.Diagnostics._0_modifier_cannot_appear_on_class_elements_of_this_kind.code,
|
|
93817
|
+
ts.Diagnostics._0_modifier_cannot_be_used_here.code,
|
|
93818
|
+
ts.Diagnostics._0_modifier_must_precede_1_modifier.code,
|
|
93819
|
+
ts.Diagnostics.const_declarations_can_only_be_declared_inside_a_block.code,
|
|
93820
|
+
ts.Diagnostics.const_declarations_must_be_initialized.code,
|
|
93821
|
+
ts.Diagnostics.extends_clause_already_seen.code,
|
|
93822
|
+
ts.Diagnostics.let_declarations_can_only_be_declared_inside_a_block.code,
|
|
93823
|
+
ts.Diagnostics.let_is_not_allowed_to_be_used_as_a_name_in_let_or_const_declarations.code,
|
|
93749
93824
|
]);
|
|
93750
93825
|
function shouldProgramCreateNewSourceFiles(program, newOptions) {
|
|
93751
93826
|
if (!program)
|
|
@@ -94601,9 +94676,10 @@ var ts;
|
|
|
94601
94676
|
var includeBindAndCheckDiagnostics = !isTsNoCheck && (sourceFile.scriptKind === 3 || sourceFile.scriptKind === 4
|
|
94602
94677
|
|| sourceFile.scriptKind === 5 || isPlainJs || isCheckJs || sourceFile.scriptKind === 7);
|
|
94603
94678
|
var bindDiagnostics = includeBindAndCheckDiagnostics ? sourceFile.bindDiagnostics : ts.emptyArray;
|
|
94604
|
-
var checkDiagnostics = includeBindAndCheckDiagnostics
|
|
94679
|
+
var checkDiagnostics = includeBindAndCheckDiagnostics ? typeChecker.getDiagnostics(sourceFile, cancellationToken) : ts.emptyArray;
|
|
94605
94680
|
if (isPlainJs) {
|
|
94606
94681
|
bindDiagnostics = ts.filter(bindDiagnostics, function (d) { return ts.plainJSErrors.has(d.code); });
|
|
94682
|
+
checkDiagnostics = ts.filter(checkDiagnostics, function (d) { return ts.plainJSErrors.has(d.code); });
|
|
94607
94683
|
}
|
|
94608
94684
|
return getMergedBindAndCheckDiagnostics(sourceFile, includeBindAndCheckDiagnostics && !isPlainJs, bindDiagnostics, checkDiagnostics, isCheckJs ? sourceFile.jsDocDiagnostics : undefined);
|
|
94609
94685
|
});
|
|
@@ -99013,19 +99089,74 @@ var ts;
|
|
|
99013
99089
|
return ts.countWhere(diagnostics, function (diagnostic) { return diagnostic.category === ts.DiagnosticCategory.Error; });
|
|
99014
99090
|
}
|
|
99015
99091
|
ts.getErrorCountForSummary = getErrorCountForSummary;
|
|
99092
|
+
function getFilesInErrorForSummary(diagnostics) {
|
|
99093
|
+
var filesInError = ts.filter(diagnostics, function (diagnostic) { return diagnostic.category === ts.DiagnosticCategory.Error; })
|
|
99094
|
+
.map(function (errorDiagnostic) {
|
|
99095
|
+
if (errorDiagnostic.file === undefined)
|
|
99096
|
+
return;
|
|
99097
|
+
return "" + errorDiagnostic.file.fileName;
|
|
99098
|
+
});
|
|
99099
|
+
return filesInError.map(function (fileName) {
|
|
99100
|
+
var diagnosticForFileName = ts.find(diagnostics, function (diagnostic) {
|
|
99101
|
+
return diagnostic.file !== undefined && diagnostic.file.fileName === fileName;
|
|
99102
|
+
});
|
|
99103
|
+
if (diagnosticForFileName !== undefined) {
|
|
99104
|
+
var line = ts.getLineAndCharacterOfPosition(diagnosticForFileName.file, diagnosticForFileName.start).line;
|
|
99105
|
+
return {
|
|
99106
|
+
fileName: fileName,
|
|
99107
|
+
line: line + 1,
|
|
99108
|
+
};
|
|
99109
|
+
}
|
|
99110
|
+
});
|
|
99111
|
+
}
|
|
99112
|
+
ts.getFilesInErrorForSummary = getFilesInErrorForSummary;
|
|
99016
99113
|
function getWatchErrorSummaryDiagnosticMessage(errorCount) {
|
|
99017
99114
|
return errorCount === 1 ?
|
|
99018
99115
|
ts.Diagnostics.Found_1_error_Watching_for_file_changes :
|
|
99019
99116
|
ts.Diagnostics.Found_0_errors_Watching_for_file_changes;
|
|
99020
99117
|
}
|
|
99021
99118
|
ts.getWatchErrorSummaryDiagnosticMessage = getWatchErrorSummaryDiagnosticMessage;
|
|
99022
|
-
function getErrorSummaryText(errorCount, newLine) {
|
|
99119
|
+
function getErrorSummaryText(errorCount, filesInError, newLine) {
|
|
99023
99120
|
if (errorCount === 0)
|
|
99024
99121
|
return "";
|
|
99025
|
-
var
|
|
99026
|
-
|
|
99122
|
+
var nonNilFiles = filesInError.filter(function (fileInError) { return fileInError !== undefined; });
|
|
99123
|
+
var distinctFileNamesWithLines = nonNilFiles.map(function (fileInError) { return fileInError.fileName + ":" + fileInError.line; })
|
|
99124
|
+
.filter(function (value, index, self) { return self.indexOf(value) === index; });
|
|
99125
|
+
var d = errorCount === 1 ?
|
|
99126
|
+
ts.createCompilerDiagnostic(filesInError[0] !== undefined ?
|
|
99127
|
+
ts.Diagnostics.Found_1_error_in_1 :
|
|
99128
|
+
ts.Diagnostics.Found_1_error, errorCount, distinctFileNamesWithLines[0]) :
|
|
99129
|
+
ts.createCompilerDiagnostic(distinctFileNamesWithLines.length === 0 ?
|
|
99130
|
+
ts.Diagnostics.Found_0_errors :
|
|
99131
|
+
distinctFileNamesWithLines.length === 1 ?
|
|
99132
|
+
ts.Diagnostics.Found_0_errors_in_1_file :
|
|
99133
|
+
ts.Diagnostics.Found_0_errors_in_1_files, errorCount, distinctFileNamesWithLines.length);
|
|
99134
|
+
return "" + newLine + ts.flattenDiagnosticMessageText(d.messageText, newLine) + newLine + newLine + (errorCount > 1 ? createTabularErrorsDisplay(nonNilFiles) : "");
|
|
99027
99135
|
}
|
|
99028
99136
|
ts.getErrorSummaryText = getErrorSummaryText;
|
|
99137
|
+
function createTabularErrorsDisplay(filesInError) {
|
|
99138
|
+
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); }); });
|
|
99139
|
+
if (distinctFiles.length === 0)
|
|
99140
|
+
return "";
|
|
99141
|
+
var numberLength = function (num) { return Math.log(num) * Math.LOG10E + 1; };
|
|
99142
|
+
var fileToErrorCount = distinctFiles.map(function (file) { return [file, ts.countWhere(filesInError, function (fileInError) { return fileInError.fileName === file.fileName; })]; });
|
|
99143
|
+
var maxErrors = fileToErrorCount.reduce(function (acc, value) { return Math.max(acc, value[1] || 0); }, 0);
|
|
99144
|
+
var headerRow = ts.Diagnostics.Errors_Files.message;
|
|
99145
|
+
var leftColumnHeadingLength = headerRow.split(" ")[0].length;
|
|
99146
|
+
var leftPaddingGoal = Math.max(leftColumnHeadingLength, numberLength(maxErrors));
|
|
99147
|
+
var headerPadding = Math.max(numberLength(maxErrors) - leftColumnHeadingLength, 0);
|
|
99148
|
+
var tabularData = "";
|
|
99149
|
+
tabularData += " ".repeat(headerPadding) + headerRow + "\n";
|
|
99150
|
+
fileToErrorCount.forEach(function (row) {
|
|
99151
|
+
var file = row[0], errorCount = row[1];
|
|
99152
|
+
var errorCountDigitsLength = Math.log(errorCount) * Math.LOG10E + 1 | 0;
|
|
99153
|
+
var leftPadding = errorCountDigitsLength < leftPaddingGoal ?
|
|
99154
|
+
" ".repeat(leftPaddingGoal - errorCountDigitsLength)
|
|
99155
|
+
: "";
|
|
99156
|
+
tabularData += "" + leftPadding + errorCount + " " + file.fileName + ":" + file.line + "\n";
|
|
99157
|
+
});
|
|
99158
|
+
return tabularData;
|
|
99159
|
+
}
|
|
99029
99160
|
function isBuilderProgram(program) {
|
|
99030
99161
|
return !!program.getState;
|
|
99031
99162
|
}
|
|
@@ -99214,7 +99345,7 @@ var ts;
|
|
|
99214
99345
|
listFiles(program, write);
|
|
99215
99346
|
}
|
|
99216
99347
|
if (reportSummary) {
|
|
99217
|
-
reportSummary(getErrorCountForSummary(diagnostics));
|
|
99348
|
+
reportSummary(getErrorCountForSummary(diagnostics), getFilesInErrorForSummary(diagnostics));
|
|
99218
99349
|
}
|
|
99219
99350
|
return {
|
|
99220
99351
|
emitResult: emitResult,
|
|
@@ -99404,7 +99535,7 @@ var ts;
|
|
|
99404
99535
|
var system = input.system || ts.sys;
|
|
99405
99536
|
var host = input.host || (input.host = ts.createIncrementalCompilerHost(input.options, system));
|
|
99406
99537
|
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);
|
|
99538
|
+
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
99539
|
if (input.afterProgramEmitAndDiagnostics)
|
|
99409
99540
|
input.afterProgramEmitAndDiagnostics(builderProgram);
|
|
99410
99541
|
return exitStatus;
|
|
@@ -101462,11 +101593,14 @@ var ts;
|
|
|
101462
101593
|
var canReportSummary = state.watch || !!state.host.reportErrorSummary;
|
|
101463
101594
|
var diagnostics = state.diagnostics;
|
|
101464
101595
|
var totalErrors = 0;
|
|
101596
|
+
var filesInError = [];
|
|
101465
101597
|
if (isCircularBuildOrder(buildOrder)) {
|
|
101466
101598
|
reportBuildQueue(state, buildOrder.buildOrder);
|
|
101467
101599
|
reportErrors(state, buildOrder.circularDiagnostics);
|
|
101468
101600
|
if (canReportSummary)
|
|
101469
101601
|
totalErrors += ts.getErrorCountForSummary(buildOrder.circularDiagnostics);
|
|
101602
|
+
if (canReportSummary)
|
|
101603
|
+
filesInError = __spreadArray(__spreadArray([], filesInError, true), ts.getFilesInErrorForSummary(buildOrder.circularDiagnostics), true);
|
|
101470
101604
|
}
|
|
101471
101605
|
else {
|
|
101472
101606
|
buildOrder.forEach(function (project) {
|
|
@@ -101477,12 +101611,14 @@ var ts;
|
|
|
101477
101611
|
});
|
|
101478
101612
|
if (canReportSummary)
|
|
101479
101613
|
diagnostics.forEach(function (singleProjectErrors) { return totalErrors += ts.getErrorCountForSummary(singleProjectErrors); });
|
|
101614
|
+
if (canReportSummary)
|
|
101615
|
+
diagnostics.forEach(function (singleProjectErrors) { return __spreadArray(__spreadArray([], filesInError, true), ts.getFilesInErrorForSummary(singleProjectErrors), true); });
|
|
101480
101616
|
}
|
|
101481
101617
|
if (state.watch) {
|
|
101482
101618
|
reportWatchStatus(state, ts.getWatchErrorSummaryDiagnosticMessage(totalErrors), totalErrors);
|
|
101483
101619
|
}
|
|
101484
101620
|
else if (state.host.reportErrorSummary) {
|
|
101485
|
-
state.host.reportErrorSummary(totalErrors);
|
|
101621
|
+
state.host.reportErrorSummary(totalErrors, filesInError);
|
|
101486
101622
|
}
|
|
101487
101623
|
}
|
|
101488
101624
|
function reportBuildQueue(state, buildQueue) {
|
|
@@ -102109,7 +102245,7 @@ var ts;
|
|
|
102109
102245
|
}
|
|
102110
102246
|
function createReportErrorSummary(sys, options) {
|
|
102111
102247
|
return shouldBePretty(sys, options) ?
|
|
102112
|
-
function (errorCount) { return sys.write(ts.getErrorSummaryText(errorCount, sys.newLine)); } :
|
|
102248
|
+
function (errorCount, filesInError) { return sys.write(ts.getErrorSummaryText(errorCount, filesInError, sys.newLine)); } :
|
|
102113
102249
|
undefined;
|
|
102114
102250
|
}
|
|
102115
102251
|
function performCompilation(sys, cb, reportDiagnostic, config) {
|