typescript 4.6.0-dev.20211206 → 4.6.0-dev.20211210
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 +188 -48
- package/lib/tsserver.js +203 -52
- package/lib/tsserverlibrary.d.ts +5 -1
- package/lib/tsserverlibrary.js +203 -52
- package/lib/typescript.d.ts +5 -1
- package/lib/typescript.js +203 -52
- package/lib/typescriptServices.d.ts +5 -1
- package/lib/typescriptServices.js +203 -52
- package/lib/typingsInstaller.js +195 -49
- 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.20211210";
|
|
73
73
|
var NativeCollections;
|
|
74
74
|
(function (NativeCollections) {
|
|
75
75
|
function tryGetNativeMap() {
|
|
@@ -5151,7 +5151,7 @@ var ts;
|
|
|
5151
5151
|
Duplicate_label_0: diag(1114, ts.DiagnosticCategory.Error, "Duplicate_label_0_1114", "Duplicate label '{0}'."),
|
|
5152
5152
|
A_continue_statement_can_only_jump_to_a_label_of_an_enclosing_iteration_statement: diag(1115, ts.DiagnosticCategory.Error, "A_continue_statement_can_only_jump_to_a_label_of_an_enclosing_iteration_statement_1115", "A 'continue' statement can only jump to a label of an enclosing iteration statement."),
|
|
5153
5153
|
A_break_statement_can_only_jump_to_a_label_of_an_enclosing_statement: diag(1116, ts.DiagnosticCategory.Error, "A_break_statement_can_only_jump_to_a_label_of_an_enclosing_statement_1116", "A 'break' statement can only jump to a label of an enclosing statement."),
|
|
5154
|
-
|
|
5154
|
+
An_object_literal_cannot_have_multiple_properties_with_the_same_name: diag(1117, ts.DiagnosticCategory.Error, "An_object_literal_cannot_have_multiple_properties_with_the_same_name_1117", "An object literal cannot have multiple properties with the same name."),
|
|
5155
5155
|
An_object_literal_cannot_have_multiple_get_Slashset_accessors_with_the_same_name: diag(1118, ts.DiagnosticCategory.Error, "An_object_literal_cannot_have_multiple_get_Slashset_accessors_with_the_same_name_1118", "An object literal cannot have multiple get/set accessors with the same name."),
|
|
5156
5156
|
An_object_literal_cannot_have_property_and_accessor_with_the_same_name: diag(1119, ts.DiagnosticCategory.Error, "An_object_literal_cannot_have_property_and_accessor_with_the_same_name_1119", "An object literal cannot have property and accessor with the same name."),
|
|
5157
5157
|
An_export_assignment_cannot_have_modifiers: diag(1120, ts.DiagnosticCategory.Error, "An_export_assignment_cannot_have_modifiers_1120", "An export assignment cannot have modifiers."),
|
|
@@ -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;
|
|
@@ -27083,7 +27087,11 @@ var ts;
|
|
|
27083
27087
|
if (type && !allowAmbiguity && typeHasArrowFunctionBlockingParseError(type)) {
|
|
27084
27088
|
return undefined;
|
|
27085
27089
|
}
|
|
27086
|
-
var
|
|
27090
|
+
var unwrappedType = type;
|
|
27091
|
+
while ((unwrappedType === null || unwrappedType === void 0 ? void 0 : unwrappedType.kind) === 190) {
|
|
27092
|
+
unwrappedType = unwrappedType.type;
|
|
27093
|
+
}
|
|
27094
|
+
var hasJSDocFunctionType = unwrappedType && ts.isJSDocFunctionType(unwrappedType);
|
|
27087
27095
|
if (!allowAmbiguity && token() !== 38 && (hasJSDocFunctionType || token() !== 18)) {
|
|
27088
27096
|
return undefined;
|
|
27089
27097
|
}
|
|
@@ -36827,10 +36835,6 @@ var ts;
|
|
|
36827
36835
|
seen.set(identifier.escapedText, currentKind);
|
|
36828
36836
|
continue;
|
|
36829
36837
|
}
|
|
36830
|
-
if (currentKind === 1 && existingKind === 1) {
|
|
36831
|
-
var span = ts.getErrorSpanForNode(file, identifier);
|
|
36832
|
-
file.bindDiagnostics.push(ts.createFileDiagnostic(file, span.start, span.length, ts.Diagnostics.An_object_literal_cannot_have_multiple_properties_with_the_same_name_in_strict_mode));
|
|
36833
|
-
}
|
|
36834
36838
|
}
|
|
36835
36839
|
}
|
|
36836
36840
|
return bindAnonymousDeclaration(node, 4096, "__object");
|
|
@@ -37035,7 +37039,7 @@ var ts;
|
|
|
37035
37039
|
}
|
|
37036
37040
|
}
|
|
37037
37041
|
function checkStrictModeNumericLiteral(node) {
|
|
37038
|
-
if (inStrictMode && node.numericLiteralFlags & 32) {
|
|
37042
|
+
if (languageVersion < 1 && inStrictMode && node.numericLiteralFlags & 32) {
|
|
37039
37043
|
file.bindDiagnostics.push(createDiagnosticForNode(node, ts.Diagnostics.Octal_literals_are_not_allowed_in_strict_mode));
|
|
37040
37044
|
}
|
|
37041
37045
|
}
|
|
@@ -40032,7 +40036,8 @@ var ts;
|
|
|
40032
40036
|
}
|
|
40033
40037
|
}
|
|
40034
40038
|
function isSameScopeDescendentOf(initial, parent, stopAt) {
|
|
40035
|
-
return !!parent && !!ts.findAncestor(initial, function (n) { return n ===
|
|
40039
|
+
return !!parent && !!ts.findAncestor(initial, function (n) { return n === parent
|
|
40040
|
+
|| (n === stopAt || ts.isFunctionLike(n) && !ts.getImmediatelyInvokedFunctionExpression(n) ? "quit" : false); });
|
|
40036
40041
|
}
|
|
40037
40042
|
function getAnyImportSyntax(node) {
|
|
40038
40043
|
switch (node.kind) {
|
|
@@ -44579,7 +44584,24 @@ var ts;
|
|
|
44579
44584
|
return mapType(source, function (t) { return getRestType(t, properties, symbol); });
|
|
44580
44585
|
}
|
|
44581
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
|
+
}
|
|
44582
44601
|
if (isGenericObjectType(source) || isGenericIndexType(omitKeyType)) {
|
|
44602
|
+
if (unspreadableToRestKeys.length) {
|
|
44603
|
+
omitKeyType = getUnionType(__spreadArray([omitKeyType], unspreadableToRestKeys, true));
|
|
44604
|
+
}
|
|
44583
44605
|
if (omitKeyType.flags & 131072) {
|
|
44584
44606
|
return source;
|
|
44585
44607
|
}
|
|
@@ -44590,13 +44612,9 @@ var ts;
|
|
|
44590
44612
|
return getTypeAliasInstantiation(omitTypeAlias, [source, omitKeyType]);
|
|
44591
44613
|
}
|
|
44592
44614
|
var members = ts.createSymbolTable();
|
|
44593
|
-
for (var
|
|
44594
|
-
var prop =
|
|
44595
|
-
|
|
44596
|
-
&& !(ts.getDeclarationModifierFlagsFromSymbol(prop) & (8 | 16))
|
|
44597
|
-
&& isSpreadableProperty(prop)) {
|
|
44598
|
-
members.set(prop.escapedName, getSpreadSymbol(prop, false));
|
|
44599
|
-
}
|
|
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));
|
|
44600
44618
|
}
|
|
44601
44619
|
var result = createAnonymousType(symbol, members, ts.emptyArray, ts.emptyArray, getIndexInfosOfType(source));
|
|
44602
44620
|
result.objectFlags |= 8388608;
|
|
@@ -54666,7 +54684,7 @@ var ts;
|
|
|
54666
54684
|
}
|
|
54667
54685
|
function getBaseTypeOfLiteralType(type) {
|
|
54668
54686
|
return type.flags & 1024 ? getBaseTypeOfEnumLiteralType(type) :
|
|
54669
|
-
type.flags & 128 ? stringType :
|
|
54687
|
+
type.flags & (128 | 134217728 | 268435456) ? stringType :
|
|
54670
54688
|
type.flags & 256 ? numberType :
|
|
54671
54689
|
type.flags & 2048 ? bigintType :
|
|
54672
54690
|
type.flags & 512 ? booleanType :
|
|
@@ -62128,7 +62146,7 @@ var ts;
|
|
|
62128
62146
|
typeArguments.pop();
|
|
62129
62147
|
}
|
|
62130
62148
|
while (typeArguments.length < typeParameters.length) {
|
|
62131
|
-
typeArguments.push(getConstraintOfTypeParameter(typeParameters[typeArguments.length]) || getDefaultTypeArgumentType(isJs));
|
|
62149
|
+
typeArguments.push(getDefaultFromTypeParameter(typeParameters[typeArguments.length]) || getConstraintOfTypeParameter(typeParameters[typeArguments.length]) || getDefaultTypeArgumentType(isJs));
|
|
62132
62150
|
}
|
|
62133
62151
|
return typeArguments;
|
|
62134
62152
|
}
|
|
@@ -62674,8 +62692,7 @@ var ts;
|
|
|
62674
62692
|
}
|
|
62675
62693
|
function checkCallExpression(node, checkMode) {
|
|
62676
62694
|
var _a;
|
|
62677
|
-
|
|
62678
|
-
checkGrammarArguments(node.arguments);
|
|
62695
|
+
checkGrammarTypeArguments(node, node.typeArguments);
|
|
62679
62696
|
var signature = getResolvedSignature(node, undefined, checkMode);
|
|
62680
62697
|
if (signature === resolvingSignature) {
|
|
62681
62698
|
return nonInferrableType;
|
|
@@ -62772,8 +62789,7 @@ var ts;
|
|
|
62772
62789
|
return globalESSymbol === resolveName(left, "Symbol", 111551, undefined, undefined, false);
|
|
62773
62790
|
}
|
|
62774
62791
|
function checkImportCallExpression(node) {
|
|
62775
|
-
|
|
62776
|
-
checkGrammarImportCallExpression(node);
|
|
62792
|
+
checkGrammarImportCallExpression(node);
|
|
62777
62793
|
if (node.arguments.length === 0) {
|
|
62778
62794
|
return createPromiseReturnType(node, anyType);
|
|
62779
62795
|
}
|
|
@@ -72056,20 +72072,6 @@ var ts;
|
|
|
72056
72072
|
}
|
|
72057
72073
|
return false;
|
|
72058
72074
|
}
|
|
72059
|
-
function checkGrammarForOmittedArgument(args) {
|
|
72060
|
-
if (args) {
|
|
72061
|
-
for (var _i = 0, args_4 = args; _i < args_4.length; _i++) {
|
|
72062
|
-
var arg = args_4[_i];
|
|
72063
|
-
if (arg.kind === 226) {
|
|
72064
|
-
return grammarErrorAtPos(arg, arg.pos, 0, ts.Diagnostics.Argument_expression_expected);
|
|
72065
|
-
}
|
|
72066
|
-
}
|
|
72067
|
-
}
|
|
72068
|
-
return false;
|
|
72069
|
-
}
|
|
72070
|
-
function checkGrammarArguments(args) {
|
|
72071
|
-
return checkGrammarForOmittedArgument(args);
|
|
72072
|
-
}
|
|
72073
72075
|
function checkGrammarHeritageClause(node) {
|
|
72074
72076
|
var types = node.types;
|
|
72075
72077
|
if (checkGrammarForDisallowedTrailingComma(types)) {
|
|
@@ -72226,9 +72228,12 @@ var ts;
|
|
|
72226
72228
|
seen.set(effectiveName, currentKind);
|
|
72227
72229
|
}
|
|
72228
72230
|
else {
|
|
72229
|
-
if ((currentKind &
|
|
72231
|
+
if ((currentKind & 8) && (existingKind & 8)) {
|
|
72230
72232
|
grammarErrorOnNode(name, ts.Diagnostics.Duplicate_identifier_0, ts.getTextOfNode(name));
|
|
72231
72233
|
}
|
|
72234
|
+
else if ((currentKind & 4) && (existingKind & 4)) {
|
|
72235
|
+
grammarErrorOnNode(name, ts.Diagnostics.An_object_literal_cannot_have_multiple_properties_with_the_same_name, ts.getTextOfNode(name));
|
|
72236
|
+
}
|
|
72232
72237
|
else if ((currentKind & 3) && (existingKind & 3)) {
|
|
72233
72238
|
if (existingKind !== 3 && currentKind !== existingKind) {
|
|
72234
72239
|
seen.set(effectiveName, currentKind | existingKind);
|
|
@@ -84637,7 +84642,7 @@ var ts;
|
|
|
84637
84642
|
if (ts.isIdentifier(node.expression)) {
|
|
84638
84643
|
var expression = substituteExpressionIdentifier(node.expression);
|
|
84639
84644
|
noSubstitution[ts.getNodeId(expression)] = true;
|
|
84640
|
-
if (!ts.isIdentifier(expression)) {
|
|
84645
|
+
if (!ts.isIdentifier(expression) && !(ts.getEmitFlags(node.expression) & 4096)) {
|
|
84641
84646
|
return ts.addEmitFlags(factory.updateCallExpression(node, expression, undefined, node.arguments), 536870912);
|
|
84642
84647
|
}
|
|
84643
84648
|
}
|
|
@@ -84647,7 +84652,7 @@ var ts;
|
|
|
84647
84652
|
if (ts.isIdentifier(node.tag)) {
|
|
84648
84653
|
var tag = substituteExpressionIdentifier(node.tag);
|
|
84649
84654
|
noSubstitution[ts.getNodeId(tag)] = true;
|
|
84650
|
-
if (!ts.isIdentifier(tag)) {
|
|
84655
|
+
if (!ts.isIdentifier(tag) && !(ts.getEmitFlags(node.tag) & 4096)) {
|
|
84651
84656
|
return ts.addEmitFlags(factory.updateTaggedTemplateExpression(node, tag, undefined, node.template), 536870912);
|
|
84652
84657
|
}
|
|
84653
84658
|
}
|
|
@@ -93742,6 +93747,80 @@ var ts;
|
|
|
93742
93747
|
ts.Diagnostics.A_label_is_not_allowed_here.code,
|
|
93743
93748
|
ts.Diagnostics.Octal_literals_are_not_allowed_in_strict_mode.code,
|
|
93744
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,
|
|
93745
93824
|
]);
|
|
93746
93825
|
function shouldProgramCreateNewSourceFiles(program, newOptions) {
|
|
93747
93826
|
if (!program)
|
|
@@ -94597,9 +94676,10 @@ var ts;
|
|
|
94597
94676
|
var includeBindAndCheckDiagnostics = !isTsNoCheck && (sourceFile.scriptKind === 3 || sourceFile.scriptKind === 4
|
|
94598
94677
|
|| sourceFile.scriptKind === 5 || isPlainJs || isCheckJs || sourceFile.scriptKind === 7);
|
|
94599
94678
|
var bindDiagnostics = includeBindAndCheckDiagnostics ? sourceFile.bindDiagnostics : ts.emptyArray;
|
|
94600
|
-
var checkDiagnostics = includeBindAndCheckDiagnostics
|
|
94679
|
+
var checkDiagnostics = includeBindAndCheckDiagnostics ? typeChecker.getDiagnostics(sourceFile, cancellationToken) : ts.emptyArray;
|
|
94601
94680
|
if (isPlainJs) {
|
|
94602
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); });
|
|
94603
94683
|
}
|
|
94604
94684
|
return getMergedBindAndCheckDiagnostics(sourceFile, includeBindAndCheckDiagnostics && !isPlainJs, bindDiagnostics, checkDiagnostics, isCheckJs ? sourceFile.jsDocDiagnostics : undefined);
|
|
94605
94685
|
});
|
|
@@ -99009,19 +99089,74 @@ var ts;
|
|
|
99009
99089
|
return ts.countWhere(diagnostics, function (diagnostic) { return diagnostic.category === ts.DiagnosticCategory.Error; });
|
|
99010
99090
|
}
|
|
99011
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;
|
|
99012
99113
|
function getWatchErrorSummaryDiagnosticMessage(errorCount) {
|
|
99013
99114
|
return errorCount === 1 ?
|
|
99014
99115
|
ts.Diagnostics.Found_1_error_Watching_for_file_changes :
|
|
99015
99116
|
ts.Diagnostics.Found_0_errors_Watching_for_file_changes;
|
|
99016
99117
|
}
|
|
99017
99118
|
ts.getWatchErrorSummaryDiagnosticMessage = getWatchErrorSummaryDiagnosticMessage;
|
|
99018
|
-
function getErrorSummaryText(errorCount, newLine) {
|
|
99119
|
+
function getErrorSummaryText(errorCount, filesInError, newLine) {
|
|
99019
99120
|
if (errorCount === 0)
|
|
99020
99121
|
return "";
|
|
99021
|
-
var
|
|
99022
|
-
|
|
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) : "");
|
|
99023
99135
|
}
|
|
99024
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
|
+
}
|
|
99025
99160
|
function isBuilderProgram(program) {
|
|
99026
99161
|
return !!program.getState;
|
|
99027
99162
|
}
|
|
@@ -99210,7 +99345,7 @@ var ts;
|
|
|
99210
99345
|
listFiles(program, write);
|
|
99211
99346
|
}
|
|
99212
99347
|
if (reportSummary) {
|
|
99213
|
-
reportSummary(getErrorCountForSummary(diagnostics));
|
|
99348
|
+
reportSummary(getErrorCountForSummary(diagnostics), getFilesInErrorForSummary(diagnostics));
|
|
99214
99349
|
}
|
|
99215
99350
|
return {
|
|
99216
99351
|
emitResult: emitResult,
|
|
@@ -99400,7 +99535,7 @@ var ts;
|
|
|
99400
99535
|
var system = input.system || ts.sys;
|
|
99401
99536
|
var host = input.host || (input.host = ts.createIncrementalCompilerHost(input.options, system));
|
|
99402
99537
|
var builderProgram = ts.createIncrementalProgram(input);
|
|
99403
|
-
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);
|
|
99404
99539
|
if (input.afterProgramEmitAndDiagnostics)
|
|
99405
99540
|
input.afterProgramEmitAndDiagnostics(builderProgram);
|
|
99406
99541
|
return exitStatus;
|
|
@@ -101458,11 +101593,14 @@ var ts;
|
|
|
101458
101593
|
var canReportSummary = state.watch || !!state.host.reportErrorSummary;
|
|
101459
101594
|
var diagnostics = state.diagnostics;
|
|
101460
101595
|
var totalErrors = 0;
|
|
101596
|
+
var filesInError = [];
|
|
101461
101597
|
if (isCircularBuildOrder(buildOrder)) {
|
|
101462
101598
|
reportBuildQueue(state, buildOrder.buildOrder);
|
|
101463
101599
|
reportErrors(state, buildOrder.circularDiagnostics);
|
|
101464
101600
|
if (canReportSummary)
|
|
101465
101601
|
totalErrors += ts.getErrorCountForSummary(buildOrder.circularDiagnostics);
|
|
101602
|
+
if (canReportSummary)
|
|
101603
|
+
filesInError = __spreadArray(__spreadArray([], filesInError, true), ts.getFilesInErrorForSummary(buildOrder.circularDiagnostics), true);
|
|
101466
101604
|
}
|
|
101467
101605
|
else {
|
|
101468
101606
|
buildOrder.forEach(function (project) {
|
|
@@ -101473,12 +101611,14 @@ var ts;
|
|
|
101473
101611
|
});
|
|
101474
101612
|
if (canReportSummary)
|
|
101475
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); });
|
|
101476
101616
|
}
|
|
101477
101617
|
if (state.watch) {
|
|
101478
101618
|
reportWatchStatus(state, ts.getWatchErrorSummaryDiagnosticMessage(totalErrors), totalErrors);
|
|
101479
101619
|
}
|
|
101480
101620
|
else if (state.host.reportErrorSummary) {
|
|
101481
|
-
state.host.reportErrorSummary(totalErrors);
|
|
101621
|
+
state.host.reportErrorSummary(totalErrors, filesInError);
|
|
101482
101622
|
}
|
|
101483
101623
|
}
|
|
101484
101624
|
function reportBuildQueue(state, buildQueue) {
|
|
@@ -102105,7 +102245,7 @@ var ts;
|
|
|
102105
102245
|
}
|
|
102106
102246
|
function createReportErrorSummary(sys, options) {
|
|
102107
102247
|
return shouldBePretty(sys, options) ?
|
|
102108
|
-
function (errorCount) { return sys.write(ts.getErrorSummaryText(errorCount, sys.newLine)); } :
|
|
102248
|
+
function (errorCount, filesInError) { return sys.write(ts.getErrorSummaryText(errorCount, filesInError, sys.newLine)); } :
|
|
102109
102249
|
undefined;
|
|
102110
102250
|
}
|
|
102111
102251
|
function performCompilation(sys, cb, reportDiagnostic, config) {
|