typescript 4.4.0-insiders.20210805 → 4.4.3
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/ko/diagnosticMessages.generated.json +2 -2
- package/lib/lib.dom.d.ts +6 -2
- package/lib/protocol.d.ts +2 -6
- package/lib/tsc.js +47 -50
- package/lib/tsserver.js +157 -92
- package/lib/tsserverlibrary.d.ts +3 -7
- package/lib/tsserverlibrary.js +156 -91
- package/lib/typescript.d.ts +1 -1
- package/lib/typescript.js +154 -83
- package/lib/typescriptServices.d.ts +1 -1
- package/lib/typescriptServices.js +154 -83
- package/lib/typingsInstaller.js +56 -58
- package/package.json +2 -2
package/lib/tsserver.js
CHANGED
|
@@ -22,7 +22,7 @@ var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
|
|
|
22
22
|
ar[i] = from[i];
|
|
23
23
|
}
|
|
24
24
|
}
|
|
25
|
-
return to.concat(ar || from);
|
|
25
|
+
return to.concat(ar || Array.prototype.slice.call(from));
|
|
26
26
|
};
|
|
27
27
|
var __assign = (this && this.__assign) || function () {
|
|
28
28
|
__assign = Object.assign || function(t) {
|
|
@@ -100,7 +100,7 @@ var ts;
|
|
|
100
100
|
// The following is baselined as a literal template type without intervention
|
|
101
101
|
/** The version of the TypeScript compiler release */
|
|
102
102
|
// eslint-disable-next-line @typescript-eslint/no-inferrable-types
|
|
103
|
-
ts.version =
|
|
103
|
+
ts.version = "4.4.3";
|
|
104
104
|
/* @internal */
|
|
105
105
|
var Comparison;
|
|
106
106
|
(function (Comparison) {
|
|
@@ -4913,21 +4913,21 @@ var ts;
|
|
|
4913
4913
|
ObjectFlags[ObjectFlags["IdenticalBaseTypeExists"] = 67108864] = "IdenticalBaseTypeExists";
|
|
4914
4914
|
// Flags that require TypeFlags.UnionOrIntersection or TypeFlags.Substitution
|
|
4915
4915
|
/* @internal */
|
|
4916
|
-
ObjectFlags[ObjectFlags["
|
|
4916
|
+
ObjectFlags[ObjectFlags["IsGenericTypeComputed"] = 4194304] = "IsGenericTypeComputed";
|
|
4917
4917
|
/* @internal */
|
|
4918
4918
|
ObjectFlags[ObjectFlags["IsGenericObjectType"] = 8388608] = "IsGenericObjectType";
|
|
4919
4919
|
/* @internal */
|
|
4920
|
-
ObjectFlags[ObjectFlags["
|
|
4920
|
+
ObjectFlags[ObjectFlags["IsGenericIndexType"] = 16777216] = "IsGenericIndexType";
|
|
4921
4921
|
/* @internal */
|
|
4922
|
-
ObjectFlags[ObjectFlags["
|
|
4922
|
+
ObjectFlags[ObjectFlags["IsGenericType"] = 25165824] = "IsGenericType";
|
|
4923
4923
|
// Flags that require TypeFlags.Union
|
|
4924
4924
|
/* @internal */
|
|
4925
|
-
ObjectFlags[ObjectFlags["ContainsIntersections"] =
|
|
4925
|
+
ObjectFlags[ObjectFlags["ContainsIntersections"] = 33554432] = "ContainsIntersections";
|
|
4926
4926
|
// Flags that require TypeFlags.Intersection
|
|
4927
4927
|
/* @internal */
|
|
4928
|
-
ObjectFlags[ObjectFlags["IsNeverIntersectionComputed"] =
|
|
4928
|
+
ObjectFlags[ObjectFlags["IsNeverIntersectionComputed"] = 33554432] = "IsNeverIntersectionComputed";
|
|
4929
4929
|
/* @internal */
|
|
4930
|
-
ObjectFlags[ObjectFlags["IsNeverIntersection"] =
|
|
4930
|
+
ObjectFlags[ObjectFlags["IsNeverIntersection"] = 67108864] = "IsNeverIntersection";
|
|
4931
4931
|
})(ObjectFlags = ts.ObjectFlags || (ts.ObjectFlags = {}));
|
|
4932
4932
|
/* @internal */
|
|
4933
4933
|
var VarianceFlags;
|
|
@@ -7976,7 +7976,7 @@ var ts;
|
|
|
7976
7976
|
Decorators_are_not_valid_here: diag(1206, ts.DiagnosticCategory.Error, "Decorators_are_not_valid_here_1206", "Decorators are not valid here."),
|
|
7977
7977
|
Decorators_cannot_be_applied_to_multiple_get_Slashset_accessors_of_the_same_name: diag(1207, ts.DiagnosticCategory.Error, "Decorators_cannot_be_applied_to_multiple_get_Slashset_accessors_of_the_same_name_1207", "Decorators cannot be applied to multiple get/set accessors of the same name."),
|
|
7978
7978
|
_0_cannot_be_compiled_under_isolatedModules_because_it_is_considered_a_global_script_file_Add_an_import_export_or_an_empty_export_statement_to_make_it_a_module: diag(1208, ts.DiagnosticCategory.Error, "_0_cannot_be_compiled_under_isolatedModules_because_it_is_considered_a_global_script_file_Add_an_imp_1208", "'{0}' cannot be compiled under '--isolatedModules' because it is considered a global script file. Add an import, export, or an empty 'export {}' statement to make it a module."),
|
|
7979
|
-
|
|
7979
|
+
Code_contained_in_a_class_is_evaluated_in_JavaScript_s_strict_mode_which_does_not_allow_this_use_of_0_For_more_information_see_https_Colon_Slash_Slashdeveloper_mozilla_org_Slashen_US_Slashdocs_SlashWeb_SlashJavaScript_SlashReference_SlashStrict_mode: diag(1210, ts.DiagnosticCategory.Error, "Code_contained_in_a_class_is_evaluated_in_JavaScript_s_strict_mode_which_does_not_allow_this_use_of__1210", "Code contained in a class is evaluated in JavaScript's strict mode which does not allow this use of '{0}'. For more information, see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Strict_mode."),
|
|
7980
7980
|
A_class_declaration_without_the_default_modifier_must_have_a_name: diag(1211, ts.DiagnosticCategory.Error, "A_class_declaration_without_the_default_modifier_must_have_a_name_1211", "A class declaration without the 'default' modifier must have a name."),
|
|
7981
7981
|
Identifier_expected_0_is_a_reserved_word_in_strict_mode: diag(1212, ts.DiagnosticCategory.Error, "Identifier_expected_0_is_a_reserved_word_in_strict_mode_1212", "Identifier expected. '{0}' is a reserved word in strict mode."),
|
|
7982
7982
|
Identifier_expected_0_is_a_reserved_word_in_strict_mode_Class_definitions_are_automatically_in_strict_mode: diag(1213, ts.DiagnosticCategory.Error, "Identifier_expected_0_is_a_reserved_word_in_strict_mode_Class_definitions_are_automatically_in_stric_1213", "Identifier expected. '{0}' is a reserved word in strict mode. Class definitions are automatically in strict mode."),
|
|
@@ -9578,6 +9578,8 @@ var ts;
|
|
|
9578
9578
|
Can_only_convert_named_export: diag(95164, ts.DiagnosticCategory.Message, "Can_only_convert_named_export_95164", "Can only convert named export"),
|
|
9579
9579
|
Add_missing_properties: diag(95165, ts.DiagnosticCategory.Message, "Add_missing_properties_95165", "Add missing properties"),
|
|
9580
9580
|
Add_all_missing_properties: diag(95166, ts.DiagnosticCategory.Message, "Add_all_missing_properties_95166", "Add all missing properties"),
|
|
9581
|
+
Add_missing_attributes: diag(95167, ts.DiagnosticCategory.Message, "Add_missing_attributes_95167", "Add missing attributes"),
|
|
9582
|
+
Add_all_missing_attributes: diag(95168, ts.DiagnosticCategory.Message, "Add_all_missing_attributes_95168", "Add all missing attributes"),
|
|
9581
9583
|
No_value_exists_in_scope_for_the_shorthand_property_0_Either_declare_one_or_provide_an_initializer: diag(18004, ts.DiagnosticCategory.Error, "No_value_exists_in_scope_for_the_shorthand_property_0_Either_declare_one_or_provide_an_initializer_18004", "No value exists in scope for the shorthand property '{0}'. Either declare one or provide an initializer."),
|
|
9582
9584
|
Classes_may_not_have_a_field_named_constructor: diag(18006, ts.DiagnosticCategory.Error, "Classes_may_not_have_a_field_named_constructor_18006", "Classes may not have a field named 'constructor'."),
|
|
9583
9585
|
JSX_expressions_may_not_use_the_comma_operator_Did_you_mean_to_write_an_array: diag(18007, ts.DiagnosticCategory.Error, "JSX_expressions_may_not_use_the_comma_operator_Did_you_mean_to_write_an_array_18007", "JSX expressions may not use the comma operator. Did you mean to write an array?"),
|
|
@@ -20669,6 +20671,11 @@ var ts;
|
|
|
20669
20671
|
return false;
|
|
20670
20672
|
}
|
|
20671
20673
|
ts.hasContextSensitiveParameters = hasContextSensitiveParameters;
|
|
20674
|
+
/* @internal */
|
|
20675
|
+
function isInfinityOrNaNString(name) {
|
|
20676
|
+
return name === "Infinity" || name === "-Infinity" || name === "NaN";
|
|
20677
|
+
}
|
|
20678
|
+
ts.isInfinityOrNaNString = isInfinityOrNaNString;
|
|
20672
20679
|
})(ts || (ts = {}));
|
|
20673
20680
|
/* @internal */
|
|
20674
20681
|
var ts;
|
|
@@ -27226,7 +27233,7 @@ var ts;
|
|
|
27226
27233
|
name: "typescript:spreadArray",
|
|
27227
27234
|
importName: "__spreadArray",
|
|
27228
27235
|
scoped: false,
|
|
27229
|
-
text: "\n var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {\n if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {\n if (ar || !(i in from)) {\n if (!ar) ar = Array.prototype.slice.call(from, 0, i);\n ar[i] = from[i];\n }\n }\n return to.concat(ar || from);\n };"
|
|
27236
|
+
text: "\n var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {\n if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {\n if (ar || !(i in from)) {\n if (!ar) ar = Array.prototype.slice.call(from, 0, i);\n ar[i] = from[i];\n }\n }\n return to.concat(ar || Array.prototype.slice.call(from));\n };"
|
|
27230
27237
|
};
|
|
27231
27238
|
// ES2015 Destructuring Helpers
|
|
27232
27239
|
ts.valuesHelper = {
|
|
@@ -44272,7 +44279,7 @@ var ts;
|
|
|
44272
44279
|
// Provide specialized messages to help the user understand why we think they're in
|
|
44273
44280
|
// strict mode.
|
|
44274
44281
|
if (ts.getContainingClass(node)) {
|
|
44275
|
-
return ts.Diagnostics.
|
|
44282
|
+
return ts.Diagnostics.Code_contained_in_a_class_is_evaluated_in_JavaScript_s_strict_mode_which_does_not_allow_this_use_of_0_For_more_information_see_https_Colon_Slash_Slashdeveloper_mozilla_org_Slashen_US_Slashdocs_SlashWeb_SlashJavaScript_SlashReference_SlashStrict_mode;
|
|
44276
44283
|
}
|
|
44277
44284
|
if (file.externalModuleIndicator) {
|
|
44278
44285
|
return ts.Diagnostics.Invalid_use_of_0_Modules_are_automatically_in_strict_mode;
|
|
@@ -56484,15 +56491,15 @@ var ts;
|
|
|
56484
56491
|
* no constituent property has type 'never', but the intersection of the constituent property types is 'never'.
|
|
56485
56492
|
*/
|
|
56486
56493
|
function getReducedType(type) {
|
|
56487
|
-
if (type.flags & 1048576 /* Union */ && type.objectFlags &
|
|
56494
|
+
if (type.flags & 1048576 /* Union */ && type.objectFlags & 33554432 /* ContainsIntersections */) {
|
|
56488
56495
|
return type.resolvedReducedType || (type.resolvedReducedType = getReducedUnionType(type));
|
|
56489
56496
|
}
|
|
56490
56497
|
else if (type.flags & 2097152 /* Intersection */) {
|
|
56491
|
-
if (!(type.objectFlags &
|
|
56492
|
-
type.objectFlags |=
|
|
56493
|
-
(ts.some(getPropertiesOfUnionOrIntersectionType(type), isNeverReducedProperty) ?
|
|
56498
|
+
if (!(type.objectFlags & 33554432 /* IsNeverIntersectionComputed */)) {
|
|
56499
|
+
type.objectFlags |= 33554432 /* IsNeverIntersectionComputed */ |
|
|
56500
|
+
(ts.some(getPropertiesOfUnionOrIntersectionType(type), isNeverReducedProperty) ? 67108864 /* IsNeverIntersection */ : 0);
|
|
56494
56501
|
}
|
|
56495
|
-
return type.objectFlags &
|
|
56502
|
+
return type.objectFlags & 67108864 /* IsNeverIntersection */ ? neverType : type;
|
|
56496
56503
|
}
|
|
56497
56504
|
return type;
|
|
56498
56505
|
}
|
|
@@ -56522,7 +56529,7 @@ var ts;
|
|
|
56522
56529
|
return !prop.valueDeclaration && !!(ts.getCheckFlags(prop) & 1024 /* ContainsPrivate */);
|
|
56523
56530
|
}
|
|
56524
56531
|
function elaborateNeverIntersection(errorInfo, type) {
|
|
56525
|
-
if (type.flags & 2097152 /* Intersection */ && ts.getObjectFlags(type) &
|
|
56532
|
+
if (type.flags & 2097152 /* Intersection */ && ts.getObjectFlags(type) & 67108864 /* IsNeverIntersection */) {
|
|
56526
56533
|
var neverProp = ts.find(getPropertiesOfUnionOrIntersectionType(type), isDiscriminantWithNeverType);
|
|
56527
56534
|
if (neverProp) {
|
|
56528
56535
|
return ts.chainDiagnosticMessages(errorInfo, ts.Diagnostics.The_intersection_0_was_reduced_to_never_because_property_1_has_conflicting_types_in_some_constituents, typeToString(type, /*enclosingDeclaration*/ undefined, 536870912 /* NoTypeReduction */), symbolToString(neverProp));
|
|
@@ -58382,7 +58389,7 @@ var ts;
|
|
|
58382
58389
|
}
|
|
58383
58390
|
}
|
|
58384
58391
|
var objectFlags = (includes & 468598819 /* NotPrimitiveUnion */ ? 0 : 65536 /* PrimitiveUnion */) |
|
|
58385
|
-
(includes & 2097152 /* Intersection */ ?
|
|
58392
|
+
(includes & 2097152 /* Intersection */ ? 33554432 /* ContainsIntersections */ : 0);
|
|
58386
58393
|
return getUnionTypeFromSortedList(typeSet, objectFlags, aliasSymbol, aliasTypeArguments, origin);
|
|
58387
58394
|
}
|
|
58388
58395
|
function getUnionOrIntersectionTypePredicate(signatures, kind) {
|
|
@@ -59206,39 +59213,32 @@ var ts;
|
|
|
59206
59213
|
function isPatternLiteralType(type) {
|
|
59207
59214
|
return !!(type.flags & 134217728 /* TemplateLiteral */) && ts.every(type.types, isPatternLiteralPlaceholderType);
|
|
59208
59215
|
}
|
|
59216
|
+
function isGenericType(type) {
|
|
59217
|
+
return !!getGenericObjectFlags(type);
|
|
59218
|
+
}
|
|
59209
59219
|
function isGenericObjectType(type) {
|
|
59210
|
-
|
|
59211
|
-
if (!(type.objectFlags & 4194304 /* IsGenericObjectTypeComputed */)) {
|
|
59212
|
-
type.objectFlags |= 4194304 /* IsGenericObjectTypeComputed */ |
|
|
59213
|
-
(ts.some(type.types, isGenericObjectType) ? 8388608 /* IsGenericObjectType */ : 0);
|
|
59214
|
-
}
|
|
59215
|
-
return !!(type.objectFlags & 8388608 /* IsGenericObjectType */);
|
|
59216
|
-
}
|
|
59217
|
-
if (type.flags & 33554432 /* Substitution */) {
|
|
59218
|
-
if (!(type.objectFlags & 4194304 /* IsGenericObjectTypeComputed */)) {
|
|
59219
|
-
type.objectFlags |= 4194304 /* IsGenericObjectTypeComputed */ |
|
|
59220
|
-
(isGenericObjectType(type.substitute) || isGenericObjectType(type.baseType) ? 8388608 /* IsGenericObjectType */ : 0);
|
|
59221
|
-
}
|
|
59222
|
-
return !!(type.objectFlags & 8388608 /* IsGenericObjectType */);
|
|
59223
|
-
}
|
|
59224
|
-
return !!(type.flags & 58982400 /* InstantiableNonPrimitive */) || isGenericMappedType(type) || isGenericTupleType(type);
|
|
59220
|
+
return !!(getGenericObjectFlags(type) & 8388608 /* IsGenericObjectType */);
|
|
59225
59221
|
}
|
|
59226
59222
|
function isGenericIndexType(type) {
|
|
59223
|
+
return !!(getGenericObjectFlags(type) & 16777216 /* IsGenericIndexType */);
|
|
59224
|
+
}
|
|
59225
|
+
function getGenericObjectFlags(type) {
|
|
59227
59226
|
if (type.flags & 3145728 /* UnionOrIntersection */) {
|
|
59228
|
-
if (!(type.objectFlags &
|
|
59229
|
-
type.objectFlags |=
|
|
59230
|
-
|
|
59227
|
+
if (!(type.objectFlags & 4194304 /* IsGenericTypeComputed */)) {
|
|
59228
|
+
type.objectFlags |= 4194304 /* IsGenericTypeComputed */ |
|
|
59229
|
+
ts.reduceLeft(type.types, function (flags, t) { return flags | getGenericObjectFlags(t); }, 0);
|
|
59231
59230
|
}
|
|
59232
|
-
return
|
|
59231
|
+
return type.objectFlags & 25165824 /* IsGenericType */;
|
|
59233
59232
|
}
|
|
59234
59233
|
if (type.flags & 33554432 /* Substitution */) {
|
|
59235
|
-
if (!(type.objectFlags &
|
|
59236
|
-
type.objectFlags |=
|
|
59237
|
-
(
|
|
59234
|
+
if (!(type.objectFlags & 4194304 /* IsGenericTypeComputed */)) {
|
|
59235
|
+
type.objectFlags |= 4194304 /* IsGenericTypeComputed */ |
|
|
59236
|
+
getGenericObjectFlags(type.substitute) | getGenericObjectFlags(type.baseType);
|
|
59238
59237
|
}
|
|
59239
|
-
return
|
|
59238
|
+
return type.objectFlags & 25165824 /* IsGenericType */;
|
|
59240
59239
|
}
|
|
59241
|
-
return
|
|
59240
|
+
return (type.flags & 58982400 /* InstantiableNonPrimitive */ || isGenericMappedType(type) || isGenericTupleType(type) ? 8388608 /* IsGenericObjectType */ : 0) |
|
|
59241
|
+
(type.flags & (58982400 /* InstantiableNonPrimitive */ | 4194304 /* Index */ | 134217728 /* TemplateLiteral */ | 268435456 /* StringMapping */) && !isPatternLiteralType(type) ? 16777216 /* IsGenericIndexType */ : 0);
|
|
59242
59242
|
}
|
|
59243
59243
|
function isThisTypeParameter(type) {
|
|
59244
59244
|
return !!(type.flags & 262144 /* TypeParameter */ && type.isThisType);
|
|
@@ -59497,7 +59497,7 @@ var ts;
|
|
|
59497
59497
|
while (true) {
|
|
59498
59498
|
var isUnwrapped = isTypicalNondistributiveConditional(root);
|
|
59499
59499
|
var checkType = instantiateType(unwrapNondistributiveConditionalTuple(root, getActualTypeVariable(root.checkType)), mapper);
|
|
59500
|
-
var checkTypeInstantiable =
|
|
59500
|
+
var checkTypeInstantiable = isGenericType(checkType);
|
|
59501
59501
|
var extendsType = instantiateType(unwrapNondistributiveConditionalTuple(root, root.extendsType), mapper);
|
|
59502
59502
|
if (checkType === wildcardType || extendsType === wildcardType) {
|
|
59503
59503
|
return wildcardType;
|
|
@@ -59519,7 +59519,7 @@ var ts;
|
|
|
59519
59519
|
// Instantiate the extends type including inferences for 'infer T' type parameters
|
|
59520
59520
|
var inferredExtendsType = combinedMapper ? instantiateType(unwrapNondistributiveConditionalTuple(root, root.extendsType), combinedMapper) : extendsType;
|
|
59521
59521
|
// We attempt to resolve the conditional type only when the check and extends types are non-generic
|
|
59522
|
-
if (!checkTypeInstantiable && !
|
|
59522
|
+
if (!checkTypeInstantiable && !isGenericType(inferredExtendsType)) {
|
|
59523
59523
|
// Return falseType for a definitely false extends check. We check an instantiations of the two
|
|
59524
59524
|
// types with type parameters mapped to the wildcard type, the most permissive instantiations
|
|
59525
59525
|
// possible (the wildcard type is assignable to and from all types). If those are not related,
|
|
@@ -63501,8 +63501,8 @@ var ts;
|
|
|
63501
63501
|
continue;
|
|
63502
63502
|
}
|
|
63503
63503
|
if (isApplicableIndexType(getLiteralTypeFromProperty(prop, 8576 /* StringOrNumberLiteralOrUnique */), keyType)) {
|
|
63504
|
-
var propType =
|
|
63505
|
-
var type = propType.flags & 32768 /* Undefined */ || keyType === numberType || !(prop.flags & 16777216 /* Optional */)
|
|
63504
|
+
var propType = getNonMissingTypeOfSymbol(prop);
|
|
63505
|
+
var type = exactOptionalPropertyTypes || propType.flags & 32768 /* Undefined */ || keyType === numberType || !(prop.flags & 16777216 /* Optional */)
|
|
63506
63506
|
? propType
|
|
63507
63507
|
: getTypeWithFacts(propType, 524288 /* NEUndefined */);
|
|
63508
63508
|
var related = isRelatedTo(type, targetInfo.type, reportErrors);
|
|
@@ -68049,16 +68049,13 @@ var ts;
|
|
|
68049
68049
|
function isGenericTypeWithoutNullableConstraint(type) {
|
|
68050
68050
|
return !!(type.flags & 465829888 /* Instantiable */ && !maybeTypeOfKind(getBaseConstraintOrType(type), 98304 /* Nullable */));
|
|
68051
68051
|
}
|
|
68052
|
-
function containsGenericType(type) {
|
|
68053
|
-
return !!(type.flags & 465829888 /* Instantiable */ || type.flags & 3145728 /* UnionOrIntersection */ && ts.some(type.types, containsGenericType));
|
|
68054
|
-
}
|
|
68055
68052
|
function hasNonBindingPatternContextualTypeWithNoGenericTypes(node) {
|
|
68056
68053
|
// Computing the contextual type for a child of a JSX element involves resolving the type of the
|
|
68057
68054
|
// element's tag name, so we exclude that here to avoid circularities.
|
|
68058
68055
|
var contextualType = (ts.isIdentifier(node) || ts.isPropertyAccessExpression(node) || ts.isElementAccessExpression(node)) &&
|
|
68059
68056
|
!((ts.isJsxOpeningElement(node.parent) || ts.isJsxSelfClosingElement(node.parent)) && node.parent.tagName === node) &&
|
|
68060
68057
|
getContextualType(node, 8 /* SkipBindingPatterns */);
|
|
68061
|
-
return contextualType && !
|
|
68058
|
+
return contextualType && !isGenericType(contextualType);
|
|
68062
68059
|
}
|
|
68063
68060
|
function getNarrowableTypeForReference(type, reference, checkMode) {
|
|
68064
68061
|
// When the type of a reference is or contains an instantiable type with a union type constraint, and
|
|
@@ -69876,9 +69873,6 @@ var ts;
|
|
|
69876
69873
|
// but this behavior is consistent with checkIndexedAccess
|
|
69877
69874
|
return isTypeAssignableToKind(checkComputedPropertyName(name), 296 /* NumberLike */);
|
|
69878
69875
|
}
|
|
69879
|
-
function isInfinityOrNaNString(name) {
|
|
69880
|
-
return name === "Infinity" || name === "-Infinity" || name === "NaN";
|
|
69881
|
-
}
|
|
69882
69876
|
function isNumericLiteralName(name) {
|
|
69883
69877
|
// The intent of numeric names is that
|
|
69884
69878
|
// - they are names with text in a numeric form, and that
|
|
@@ -80170,8 +80164,8 @@ var ts;
|
|
|
80170
80164
|
error(member, ts.Diagnostics.This_member_cannot_have_an_override_modifier_because_it_is_not_declared_in_the_base_class_0_Did_you_mean_1, baseClassName, symbolToString(suggestion)) :
|
|
80171
80165
|
error(member, ts.Diagnostics.This_member_cannot_have_an_override_modifier_because_it_is_not_declared_in_the_base_class_0, baseClassName);
|
|
80172
80166
|
}
|
|
80173
|
-
else if (prop && (baseProp === null || baseProp === void 0 ? void 0 : baseProp.
|
|
80174
|
-
var baseHasAbstract = ts.
|
|
80167
|
+
else if (prop && (baseProp === null || baseProp === void 0 ? void 0 : baseProp.declarations) && compilerOptions.noImplicitOverride && !nodeInAmbientContext) {
|
|
80168
|
+
var baseHasAbstract = ts.some(baseProp.declarations, function (d) { return ts.hasAbstractModifier(d); });
|
|
80175
80169
|
if (hasOverride) {
|
|
80176
80170
|
return;
|
|
80177
80171
|
}
|
|
@@ -80551,7 +80545,7 @@ var ts;
|
|
|
80551
80545
|
}
|
|
80552
80546
|
else {
|
|
80553
80547
|
var text = ts.getTextOfPropertyName(member.name);
|
|
80554
|
-
if (isNumericLiteralName(text) && !isInfinityOrNaNString(text)) {
|
|
80548
|
+
if (isNumericLiteralName(text) && !ts.isInfinityOrNaNString(text)) {
|
|
80555
80549
|
error(member.name, ts.Diagnostics.An_enum_member_cannot_have_a_numeric_name);
|
|
80556
80550
|
}
|
|
80557
80551
|
}
|
|
@@ -80651,7 +80645,7 @@ var ts;
|
|
|
80651
80645
|
return evaluate(expr.expression);
|
|
80652
80646
|
case 79 /* Identifier */:
|
|
80653
80647
|
var identifier = expr;
|
|
80654
|
-
if (isInfinityOrNaNString(identifier.escapedText)) {
|
|
80648
|
+
if (ts.isInfinityOrNaNString(identifier.escapedText)) {
|
|
80655
80649
|
return +(identifier.escapedText);
|
|
80656
80650
|
}
|
|
80657
80651
|
return ts.nodeIsMissing(expr) ? 0 : evaluateEnumMember(expr, getSymbolOfNode(member.parent), identifier.escapedText);
|
|
@@ -83834,7 +83828,7 @@ var ts;
|
|
|
83834
83828
|
return grammarErrorOnNode(parameter.name, ts.Diagnostics.An_index_signature_parameter_must_have_a_type_annotation);
|
|
83835
83829
|
}
|
|
83836
83830
|
var type = getTypeFromTypeNode(parameter.type);
|
|
83837
|
-
if (someType(type, function (t) { return !!(t.flags & 8576 /* StringOrNumberLiteralOrUnique */); }) ||
|
|
83831
|
+
if (someType(type, function (t) { return !!(t.flags & 8576 /* StringOrNumberLiteralOrUnique */); }) || isGenericType(type)) {
|
|
83838
83832
|
return grammarErrorOnNode(parameter.name, ts.Diagnostics.An_index_signature_parameter_type_cannot_be_a_literal_type_or_generic_type_Consider_using_a_mapped_object_type_instead);
|
|
83839
83833
|
}
|
|
83840
83834
|
if (!everyType(type, isValidIndexKeyType)) {
|
|
@@ -118033,6 +118027,10 @@ var ts;
|
|
|
118033
118027
|
});
|
|
118034
118028
|
parsedConfigs = undefined;
|
|
118035
118029
|
}
|
|
118030
|
+
if (packageJsonMap) {
|
|
118031
|
+
ts.clearMap(packageJsonMap, ts.closeFileWatcher);
|
|
118032
|
+
packageJsonMap = undefined;
|
|
118033
|
+
}
|
|
118036
118034
|
}
|
|
118037
118035
|
function getCurrentBuilderProgram() {
|
|
118038
118036
|
return builderProgram;
|
|
@@ -121157,7 +121155,7 @@ var ts;
|
|
|
121157
121155
|
if (ts.isClassDeclaration(node)) {
|
|
121158
121156
|
// for class and function declarations, use the `default` modifier
|
|
121159
121157
|
// when the declaration is unnamed.
|
|
121160
|
-
var defaultModifier = ts.find(node.modifiers, isDefaultModifier);
|
|
121158
|
+
var defaultModifier = node.modifiers && ts.find(node.modifiers, isDefaultModifier);
|
|
121161
121159
|
if (defaultModifier)
|
|
121162
121160
|
return defaultModifier;
|
|
121163
121161
|
}
|
|
@@ -124915,7 +124913,7 @@ var ts;
|
|
|
124915
124913
|
if (ts.isJsxExpression(node)) {
|
|
124916
124914
|
inJSXElement = false;
|
|
124917
124915
|
}
|
|
124918
|
-
if (ts.isIdentifier(node) && !inJSXElement && !inImportClause(node) && !isInfinityOrNaNString(node.escapedText)) {
|
|
124916
|
+
if (ts.isIdentifier(node) && !inJSXElement && !inImportClause(node) && !ts.isInfinityOrNaNString(node.escapedText)) {
|
|
124919
124917
|
var symbol = typeChecker.getSymbolAtLocation(node);
|
|
124920
124918
|
if (symbol) {
|
|
124921
124919
|
if (symbol.flags & 2097152 /* Alias */) {
|
|
@@ -125047,9 +125045,6 @@ var ts;
|
|
|
125047
125045
|
function isRightSideOfQualifiedNameOrPropertyAccess(node) {
|
|
125048
125046
|
return (ts.isQualifiedName(node.parent) && node.parent.right === node) || (ts.isPropertyAccessExpression(node.parent) && node.parent.name === node);
|
|
125049
125047
|
}
|
|
125050
|
-
function isInfinityOrNaNString(name) {
|
|
125051
|
-
return name === "Infinity" || name === "NaN";
|
|
125052
|
-
}
|
|
125053
125048
|
var tokenFromDeclarationMapping = new ts.Map([
|
|
125054
125049
|
[252 /* VariableDeclaration */, 7 /* variable */],
|
|
125055
125050
|
[162 /* Parameter */, 6 /* parameter */],
|
|
@@ -126711,13 +126706,16 @@ var ts;
|
|
|
126711
126706
|
case 204 /* PropertyAccessExpression */:
|
|
126712
126707
|
propertyAccessToConvert = parent;
|
|
126713
126708
|
node = propertyAccessToConvert.expression;
|
|
126714
|
-
|
|
126715
|
-
|
|
126716
|
-
node.
|
|
126717
|
-
|
|
126709
|
+
var leftmostAccessExpression = ts.getLeftmostAccessExpression(propertyAccessToConvert);
|
|
126710
|
+
if (ts.nodeIsMissing(leftmostAccessExpression) ||
|
|
126711
|
+
((ts.isCallExpression(node) || ts.isFunctionLike(node)) &&
|
|
126712
|
+
node.end === contextToken.pos &&
|
|
126713
|
+
node.getChildCount(sourceFile) &&
|
|
126714
|
+
ts.last(node.getChildren(sourceFile)).kind !== 21 /* CloseParenToken */)) {
|
|
126718
126715
|
// This is likely dot from incorrectly parsed expression and user is starting to write spread
|
|
126719
126716
|
// eg: Math.min(./**/)
|
|
126720
126717
|
// const x = function (./**/) {}
|
|
126718
|
+
// ({./**/})
|
|
126721
126719
|
return undefined;
|
|
126722
126720
|
}
|
|
126723
126721
|
break;
|
|
@@ -126955,6 +126953,12 @@ var ts;
|
|
|
126955
126953
|
}
|
|
126956
126954
|
}
|
|
126957
126955
|
if (!isTypeLocation) {
|
|
126956
|
+
// GH#39946. Pulling on the type of a node inside of a function with a contextual `this` parameter can result in a circularity
|
|
126957
|
+
// if the `node` is part of the exprssion of a `yield` or `return`. This circularity doesn't exist at compile time because
|
|
126958
|
+
// we will check (and cache) the type of `this` *before* checking the type of the node.
|
|
126959
|
+
var container = ts.getThisContainer(node, /*includeArrowFunctions*/ false);
|
|
126960
|
+
if (!ts.isSourceFile(container) && container.parent)
|
|
126961
|
+
typeChecker.getTypeAtLocation(container);
|
|
126958
126962
|
var type = typeChecker.getTypeAtLocation(node).getNonOptionalType();
|
|
126959
126963
|
var insertQuestionDot = false;
|
|
126960
126964
|
if (type.isNullableType()) {
|
|
@@ -137106,7 +137110,7 @@ var ts;
|
|
|
137106
137110
|
for (var i = 0; i < args.length; ++i) {
|
|
137107
137111
|
var originalArg = args[i];
|
|
137108
137112
|
var arg = ts.skipParentheses(originalArg);
|
|
137109
|
-
if (shouldShowLiteralParameterNameHintsOnly(preferences) && !
|
|
137113
|
+
if (shouldShowLiteralParameterNameHintsOnly(preferences) && !isHintableLiteral(arg)) {
|
|
137110
137114
|
continue;
|
|
137111
137115
|
}
|
|
137112
137116
|
var identifierNameInfo = checker.getParameterIdentifierNameAtPosition(signature, i);
|
|
@@ -137144,8 +137148,22 @@ var ts;
|
|
|
137144
137148
|
var regex = leadingParameterNameCommentRegexFactory(name);
|
|
137145
137149
|
return ts.some(ranges, function (range) { return regex.test(sourceFileText.substring(range.pos, range.end)); });
|
|
137146
137150
|
}
|
|
137147
|
-
function
|
|
137148
|
-
|
|
137151
|
+
function isHintableLiteral(node) {
|
|
137152
|
+
switch (node.kind) {
|
|
137153
|
+
case 217 /* PrefixUnaryExpression */: {
|
|
137154
|
+
var operand = node.operand;
|
|
137155
|
+
return ts.isLiteralExpression(operand) || ts.isIdentifier(operand) && ts.isInfinityOrNaNString(operand.escapedText);
|
|
137156
|
+
}
|
|
137157
|
+
case 110 /* TrueKeyword */:
|
|
137158
|
+
case 95 /* FalseKeyword */:
|
|
137159
|
+
case 104 /* NullKeyword */:
|
|
137160
|
+
return true;
|
|
137161
|
+
case 79 /* Identifier */: {
|
|
137162
|
+
var name = node.escapedText;
|
|
137163
|
+
return isUndefined(name) || ts.isInfinityOrNaNString(name);
|
|
137164
|
+
}
|
|
137165
|
+
}
|
|
137166
|
+
return ts.isLiteralExpression(node);
|
|
137149
137167
|
}
|
|
137150
137168
|
function visitFunctionDeclarationLikeForReturnType(decl) {
|
|
137151
137169
|
if (ts.isArrowFunction(decl)) {
|
|
@@ -137223,6 +137241,9 @@ var ts;
|
|
|
137223
137241
|
printer.writeNode(4 /* Unspecified */, typeNode, /*sourceFile*/ file, writer);
|
|
137224
137242
|
});
|
|
137225
137243
|
}
|
|
137244
|
+
function isUndefined(name) {
|
|
137245
|
+
return name === "undefined";
|
|
137246
|
+
}
|
|
137226
137247
|
}
|
|
137227
137248
|
InlayHints.provideInlayHints = provideInlayHints;
|
|
137228
137249
|
})(InlayHints = ts.InlayHints || (ts.InlayHints = {}));
|
|
@@ -146478,6 +146499,7 @@ var ts;
|
|
|
146478
146499
|
(function (codefix) {
|
|
146479
146500
|
var fixMissingMember = "fixMissingMember";
|
|
146480
146501
|
var fixMissingProperties = "fixMissingProperties";
|
|
146502
|
+
var fixMissingAttributes = "fixMissingAttributes";
|
|
146481
146503
|
var fixMissingFunctionDeclaration = "fixMissingFunctionDeclaration";
|
|
146482
146504
|
var errorCodes = [
|
|
146483
146505
|
ts.Diagnostics.Property_0_does_not_exist_on_type_1.code,
|
|
@@ -146499,6 +146521,10 @@ var ts;
|
|
|
146499
146521
|
var changes = ts.textChanges.ChangeTracker.with(context, function (t) { return addObjectLiteralProperties(t, context, info); });
|
|
146500
146522
|
return [codefix.createCodeFixAction(fixMissingProperties, changes, ts.Diagnostics.Add_missing_properties, fixMissingProperties, ts.Diagnostics.Add_all_missing_properties)];
|
|
146501
146523
|
}
|
|
146524
|
+
if (info.kind === 4 /* JsxAttributes */) {
|
|
146525
|
+
var changes = ts.textChanges.ChangeTracker.with(context, function (t) { return addJsxAttributes(t, context, info); });
|
|
146526
|
+
return [codefix.createCodeFixAction(fixMissingAttributes, changes, ts.Diagnostics.Add_missing_attributes, fixMissingAttributes, ts.Diagnostics.Add_all_missing_attributes)];
|
|
146527
|
+
}
|
|
146502
146528
|
if (info.kind === 2 /* Function */) {
|
|
146503
146529
|
var changes = ts.textChanges.ChangeTracker.with(context, function (t) { return addFunctionDeclaration(t, context, info); });
|
|
146504
146530
|
return [codefix.createCodeFixAction(fixMissingFunctionDeclaration, changes, [ts.Diagnostics.Add_missing_function_declaration_0, info.token.text], fixMissingFunctionDeclaration, ts.Diagnostics.Add_all_missing_function_declarations)];
|
|
@@ -146509,7 +146535,7 @@ var ts;
|
|
|
146509
146535
|
}
|
|
146510
146536
|
return ts.concatenate(getActionsForMissingMethodDeclaration(context, info), getActionsForMissingMemberDeclaration(context, info));
|
|
146511
146537
|
},
|
|
146512
|
-
fixIds: [fixMissingMember, fixMissingFunctionDeclaration, fixMissingProperties],
|
|
146538
|
+
fixIds: [fixMissingMember, fixMissingFunctionDeclaration, fixMissingProperties, fixMissingAttributes],
|
|
146513
146539
|
getAllCodeActions: function (context) {
|
|
146514
146540
|
var program = context.program, fixId = context.fixId;
|
|
146515
146541
|
var checker = program.getTypeChecker();
|
|
@@ -146521,15 +146547,14 @@ var ts;
|
|
|
146521
146547
|
if (!info || !ts.addToSeen(seen, ts.getNodeId(info.parentDeclaration) + "#" + info.token.text)) {
|
|
146522
146548
|
return;
|
|
146523
146549
|
}
|
|
146524
|
-
if (fixId === fixMissingFunctionDeclaration) {
|
|
146525
|
-
|
|
146526
|
-
addFunctionDeclaration(changes, context, info);
|
|
146527
|
-
}
|
|
146550
|
+
if (fixId === fixMissingFunctionDeclaration && info.kind === 2 /* Function */) {
|
|
146551
|
+
addFunctionDeclaration(changes, context, info);
|
|
146528
146552
|
}
|
|
146529
|
-
else if (fixId === fixMissingProperties) {
|
|
146530
|
-
|
|
146531
|
-
|
|
146532
|
-
|
|
146553
|
+
else if (fixId === fixMissingProperties && info.kind === 3 /* ObjectLiteral */) {
|
|
146554
|
+
addObjectLiteralProperties(changes, context, info);
|
|
146555
|
+
}
|
|
146556
|
+
else if (fixId === fixMissingAttributes && info.kind === 4 /* JsxAttributes */) {
|
|
146557
|
+
addJsxAttributes(changes, context, info);
|
|
146533
146558
|
}
|
|
146534
146559
|
else {
|
|
146535
146560
|
if (info.kind === 0 /* Enum */) {
|
|
@@ -146585,6 +146610,7 @@ var ts;
|
|
|
146585
146610
|
InfoKind[InfoKind["ClassOrInterface"] = 1] = "ClassOrInterface";
|
|
146586
146611
|
InfoKind[InfoKind["Function"] = 2] = "Function";
|
|
146587
146612
|
InfoKind[InfoKind["ObjectLiteral"] = 3] = "ObjectLiteral";
|
|
146613
|
+
InfoKind[InfoKind["JsxAttributes"] = 4] = "JsxAttributes";
|
|
146588
146614
|
})(InfoKind || (InfoKind = {}));
|
|
146589
146615
|
function getInfo(sourceFile, tokenPos, checker, program) {
|
|
146590
146616
|
// The identifier of the missing property. eg:
|
|
@@ -146601,6 +146627,12 @@ var ts;
|
|
|
146601
146627
|
return { kind: 3 /* ObjectLiteral */, token: token, properties: properties, parentDeclaration: parent.initializer };
|
|
146602
146628
|
}
|
|
146603
146629
|
}
|
|
146630
|
+
if (ts.isIdentifier(token) && ts.isJsxOpeningLikeElement(token.parent)) {
|
|
146631
|
+
var attributes = getUnmatchedAttributes(checker, token.parent);
|
|
146632
|
+
if (ts.length(attributes)) {
|
|
146633
|
+
return { kind: 4 /* JsxAttributes */, token: token, attributes: attributes, parentDeclaration: token.parent };
|
|
146634
|
+
}
|
|
146635
|
+
}
|
|
146604
146636
|
if (ts.isIdentifier(token) && ts.isCallExpression(parent)) {
|
|
146605
146637
|
return { kind: 2 /* Function */, token: token, call: parent, sourceFile: sourceFile, modifierFlags: 0 /* None */, parentDeclaration: sourceFile };
|
|
146606
146638
|
}
|
|
@@ -146829,17 +146861,31 @@ var ts;
|
|
|
146829
146861
|
var functionDeclaration = codefix.createSignatureDeclarationFromCallExpression(254 /* FunctionDeclaration */, context, importAdder, info.call, ts.idText(info.token), info.modifierFlags, info.parentDeclaration);
|
|
146830
146862
|
changes.insertNodeAtEndOfScope(info.sourceFile, info.parentDeclaration, functionDeclaration);
|
|
146831
146863
|
}
|
|
146864
|
+
function addJsxAttributes(changes, context, info) {
|
|
146865
|
+
var importAdder = codefix.createImportAdder(context.sourceFile, context.program, context.preferences, context.host);
|
|
146866
|
+
var quotePreference = ts.getQuotePreference(context.sourceFile, context.preferences);
|
|
146867
|
+
var checker = context.program.getTypeChecker();
|
|
146868
|
+
var jsxAttributesNode = info.parentDeclaration.attributes;
|
|
146869
|
+
var hasSpreadAttribute = ts.some(jsxAttributesNode.properties, ts.isJsxSpreadAttribute);
|
|
146870
|
+
var attrs = ts.map(info.attributes, function (attr) {
|
|
146871
|
+
var value = attr.valueDeclaration ? tryGetValueFromType(context, checker, importAdder, quotePreference, checker.getTypeAtLocation(attr.valueDeclaration)) : createUndefined();
|
|
146872
|
+
return ts.factory.createJsxAttribute(ts.factory.createIdentifier(attr.name), ts.factory.createJsxExpression(/*dotDotDotToken*/ undefined, value));
|
|
146873
|
+
});
|
|
146874
|
+
var jsxAttributes = ts.factory.createJsxAttributes(hasSpreadAttribute ? __spreadArray(__spreadArray([], attrs, true), jsxAttributesNode.properties, true) : __spreadArray(__spreadArray([], jsxAttributesNode.properties, true), attrs, true));
|
|
146875
|
+
var options = { prefix: jsxAttributesNode.pos === jsxAttributesNode.end ? " " : undefined };
|
|
146876
|
+
changes.replaceNode(context.sourceFile, jsxAttributesNode, jsxAttributes, options);
|
|
146877
|
+
}
|
|
146832
146878
|
function addObjectLiteralProperties(changes, context, info) {
|
|
146833
146879
|
var importAdder = codefix.createImportAdder(context.sourceFile, context.program, context.preferences, context.host);
|
|
146834
146880
|
var quotePreference = ts.getQuotePreference(context.sourceFile, context.preferences);
|
|
146835
146881
|
var checker = context.program.getTypeChecker();
|
|
146836
146882
|
var props = ts.map(info.properties, function (prop) {
|
|
146837
|
-
var initializer = prop.valueDeclaration ?
|
|
146883
|
+
var initializer = prop.valueDeclaration ? tryGetValueFromType(context, checker, importAdder, quotePreference, checker.getTypeAtLocation(prop.valueDeclaration)) : createUndefined();
|
|
146838
146884
|
return ts.factory.createPropertyAssignment(prop.name, initializer);
|
|
146839
146885
|
});
|
|
146840
146886
|
changes.replaceNode(context.sourceFile, info.parentDeclaration, ts.factory.createObjectLiteralExpression(__spreadArray(__spreadArray([], info.parentDeclaration.properties, true), props, true), /*multiLine*/ true));
|
|
146841
146887
|
}
|
|
146842
|
-
function
|
|
146888
|
+
function tryGetValueFromType(context, checker, importAdder, quotePreference, type) {
|
|
146843
146889
|
if (type.flags & 3 /* AnyOrUnknown */) {
|
|
146844
146890
|
return createUndefined();
|
|
146845
146891
|
}
|
|
@@ -146876,7 +146922,7 @@ var ts;
|
|
|
146876
146922
|
return ts.factory.createNull();
|
|
146877
146923
|
}
|
|
146878
146924
|
if (type.flags & 1048576 /* Union */) {
|
|
146879
|
-
var expression = ts.firstDefined(type.types, function (t) { return
|
|
146925
|
+
var expression = ts.firstDefined(type.types, function (t) { return tryGetValueFromType(context, checker, importAdder, quotePreference, t); });
|
|
146880
146926
|
return expression !== null && expression !== void 0 ? expression : createUndefined();
|
|
146881
146927
|
}
|
|
146882
146928
|
if (checker.isArrayLikeType(type)) {
|
|
@@ -146884,7 +146930,7 @@ var ts;
|
|
|
146884
146930
|
}
|
|
146885
146931
|
if (isObjectLiteralType(type)) {
|
|
146886
146932
|
var props = ts.map(checker.getPropertiesOfType(type), function (prop) {
|
|
146887
|
-
var initializer = prop.valueDeclaration ?
|
|
146933
|
+
var initializer = prop.valueDeclaration ? tryGetValueFromType(context, checker, importAdder, quotePreference, checker.getTypeAtLocation(prop.valueDeclaration)) : createUndefined();
|
|
146888
146934
|
return ts.factory.createPropertyAssignment(prop.name, initializer);
|
|
146889
146935
|
});
|
|
146890
146936
|
return ts.factory.createObjectLiteralExpression(props, /*multiLine*/ true);
|
|
@@ -146917,6 +146963,31 @@ var ts;
|
|
|
146917
146963
|
return (type.flags & 524288 /* Object */) &&
|
|
146918
146964
|
((ts.getObjectFlags(type) & 128 /* ObjectLiteral */) || (type.symbol && ts.tryCast(ts.singleOrUndefined(type.symbol.declarations), ts.isTypeLiteralNode)));
|
|
146919
146965
|
}
|
|
146966
|
+
function getUnmatchedAttributes(checker, source) {
|
|
146967
|
+
var attrsType = checker.getContextualType(source.attributes);
|
|
146968
|
+
if (attrsType === undefined)
|
|
146969
|
+
return ts.emptyArray;
|
|
146970
|
+
var targetProps = attrsType.getProperties();
|
|
146971
|
+
if (!ts.length(targetProps))
|
|
146972
|
+
return ts.emptyArray;
|
|
146973
|
+
var seenNames = new ts.Set();
|
|
146974
|
+
for (var _i = 0, _a = source.attributes.properties; _i < _a.length; _i++) {
|
|
146975
|
+
var sourceProp = _a[_i];
|
|
146976
|
+
if (ts.isJsxAttribute(sourceProp)) {
|
|
146977
|
+
seenNames.add(sourceProp.name.escapedText);
|
|
146978
|
+
}
|
|
146979
|
+
if (ts.isJsxSpreadAttribute(sourceProp)) {
|
|
146980
|
+
var type = checker.getTypeAtLocation(sourceProp.expression);
|
|
146981
|
+
for (var _b = 0, _c = type.getProperties(); _b < _c.length; _b++) {
|
|
146982
|
+
var prop = _c[_b];
|
|
146983
|
+
seenNames.add(prop.escapedName);
|
|
146984
|
+
}
|
|
146985
|
+
}
|
|
146986
|
+
}
|
|
146987
|
+
return ts.filter(targetProps, function (targetProp) {
|
|
146988
|
+
return !((targetProp.flags & 16777216 /* Optional */ || ts.getCheckFlags(targetProp) & 48 /* Partial */) || seenNames.has(targetProp.escapedName));
|
|
146989
|
+
});
|
|
146990
|
+
}
|
|
146920
146991
|
})(codefix = ts.codefix || (ts.codefix = {}));
|
|
146921
146992
|
})(ts || (ts = {}));
|
|
146922
146993
|
/* @internal */
|
|
@@ -160029,12 +160100,6 @@ var ts;
|
|
|
160029
160100
|
/** Completion was re-triggered as the current completion list is incomplete. */
|
|
160030
160101
|
CompletionTriggerKind[CompletionTriggerKind["TriggerForIncompleteCompletions"] = 3] = "TriggerForIncompleteCompletions";
|
|
160031
160102
|
})(CompletionTriggerKind = protocol.CompletionTriggerKind || (protocol.CompletionTriggerKind = {}));
|
|
160032
|
-
var InlayHintKind;
|
|
160033
|
-
(function (InlayHintKind) {
|
|
160034
|
-
InlayHintKind["Type"] = "Type";
|
|
160035
|
-
InlayHintKind["Parameter"] = "Parameter";
|
|
160036
|
-
InlayHintKind["Enum"] = "Enum";
|
|
160037
|
-
})(InlayHintKind = protocol.InlayHintKind || (protocol.InlayHintKind = {}));
|
|
160038
160103
|
var IndentStyle;
|
|
160039
160104
|
(function (IndentStyle) {
|
|
160040
160105
|
IndentStyle["None"] = "None";
|
|
@@ -167833,9 +167898,9 @@ var ts;
|
|
|
167833
167898
|
});
|
|
167834
167899
|
};
|
|
167835
167900
|
Session.prototype.provideInlayHints = function (args) {
|
|
167836
|
-
var _a = this.
|
|
167901
|
+
var _a = this.getFileAndProject(args), file = _a.file, project = _a.project;
|
|
167837
167902
|
var scriptInfo = this.projectService.getScriptInfoForNormalizedPath(file);
|
|
167838
|
-
var hints =
|
|
167903
|
+
var hints = project.getLanguageService().provideInlayHints(file, args, this.getPreferences(file));
|
|
167839
167904
|
return hints.map(function (hint) { return (__assign(__assign({}, hint), { position: scriptInfo.positionToLineOffset(hint.position) })); });
|
|
167840
167905
|
};
|
|
167841
167906
|
Session.prototype.setCompilerOptionsForInferredProjects = function (args) {
|
|
@@ -169892,7 +169957,7 @@ var ts;
|
|
|
169892
169957
|
__extends(WorkerSession, _super);
|
|
169893
169958
|
function WorkerSession(host, webHost, options, logger, cancellationToken, hrtime) {
|
|
169894
169959
|
var _this = _super.call(this, __assign(__assign({ host: host, cancellationToken: cancellationToken }, options), { typingsInstaller: server.nullTypingsInstaller, byteLength: ts.notImplemented, // Formats the message text in send of Session which is overriden in this class so not needed
|
|
169895
|
-
hrtime: hrtime, logger: logger, canUseEvents:
|
|
169960
|
+
hrtime: hrtime, logger: logger, canUseEvents: true })) || this;
|
|
169896
169961
|
_this.webHost = webHost;
|
|
169897
169962
|
return _this;
|
|
169898
169963
|
}
|
package/lib/tsserverlibrary.d.ts
CHANGED
|
@@ -5886,7 +5886,7 @@ declare namespace ts {
|
|
|
5886
5886
|
interface InlayHint {
|
|
5887
5887
|
text: string;
|
|
5888
5888
|
position: number;
|
|
5889
|
-
kind
|
|
5889
|
+
kind: InlayHintKind;
|
|
5890
5890
|
whitespaceBefore?: boolean;
|
|
5891
5891
|
whitespaceAfter?: boolean;
|
|
5892
5892
|
}
|
|
@@ -8739,11 +8739,7 @@ declare namespace ts.server.protocol {
|
|
|
8739
8739
|
interface SignatureHelpResponse extends Response {
|
|
8740
8740
|
body?: SignatureHelpItems;
|
|
8741
8741
|
}
|
|
8742
|
-
|
|
8743
|
-
Type = "Type",
|
|
8744
|
-
Parameter = "Parameter",
|
|
8745
|
-
Enum = "Enum"
|
|
8746
|
-
}
|
|
8742
|
+
type InlayHintKind = "Type" | "Parameter" | "Enum";
|
|
8747
8743
|
interface InlayHintsRequestArgs extends FileRequestArgs {
|
|
8748
8744
|
/**
|
|
8749
8745
|
* Start position of the span.
|
|
@@ -8761,7 +8757,7 @@ declare namespace ts.server.protocol {
|
|
|
8761
8757
|
interface InlayHintItem {
|
|
8762
8758
|
text: string;
|
|
8763
8759
|
position: Location;
|
|
8764
|
-
kind
|
|
8760
|
+
kind: InlayHintKind;
|
|
8765
8761
|
whitespaceBefore?: boolean;
|
|
8766
8762
|
whitespaceAfter?: boolean;
|
|
8767
8763
|
}
|