@typescript-deploys/pr-build 5.2.0-pr-54477-10 → 5.2.0-pr-52899-13
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/tsc.js +28 -30
- package/lib/tsserver.js +60 -31
- package/lib/tsserverlibrary.d.ts +0 -1
- package/lib/tsserverlibrary.js +60 -31
- package/lib/typescript.d.ts +0 -1
- package/lib/typescript.js +60 -31
- package/lib/typingsInstaller.js +2 -1
- package/package.json +2 -2
package/lib/tsc.js
CHANGED
|
@@ -18,7 +18,7 @@ and limitations under the License.
|
|
|
18
18
|
|
|
19
19
|
// src/compiler/corePublic.ts
|
|
20
20
|
var versionMajorMinor = "5.2";
|
|
21
|
-
var version = `${versionMajorMinor}.0-insiders.
|
|
21
|
+
var version = `${versionMajorMinor}.0-insiders.20230621`;
|
|
22
22
|
|
|
23
23
|
// src/compiler/core.ts
|
|
24
24
|
var emptyArray = [];
|
|
@@ -7732,6 +7732,7 @@ var Diagnostics = {
|
|
|
7732
7732
|
Inline_variable: diag(95184, 3 /* Message */, "Inline_variable_95184", "Inline variable"),
|
|
7733
7733
|
Could_not_find_variable_to_inline: diag(95185, 3 /* Message */, "Could_not_find_variable_to_inline_95185", "Could not find variable to inline."),
|
|
7734
7734
|
Variables_with_multiple_declarations_cannot_be_inlined: diag(95186, 3 /* Message */, "Variables_with_multiple_declarations_cannot_be_inlined_95186", "Variables with multiple declarations cannot be inlined."),
|
|
7735
|
+
Add_missing_comma_for_an_object_member_completion_0: diag(95187, 3 /* Message */, "Add_missing_comma_for_an_object_member_completion_0_95187", "Add missing comma for an object member completion '{0}'."),
|
|
7735
7736
|
No_value_exists_in_scope_for_the_shorthand_property_0_Either_declare_one_or_provide_an_initializer: diag(18004, 1 /* 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."),
|
|
7736
7737
|
Classes_may_not_have_a_field_named_constructor: diag(18006, 1 /* Error */, "Classes_may_not_have_a_field_named_constructor_18006", "Classes may not have a field named 'constructor'."),
|
|
7737
7738
|
JSX_expressions_may_not_use_the_comma_operator_Did_you_mean_to_write_an_array: diag(18007, 1 /* 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?"),
|
|
@@ -43179,14 +43180,19 @@ function createTypeChecker(host) {
|
|
|
43179
43180
|
typeHasCallOrConstructSignatures
|
|
43180
43181
|
};
|
|
43181
43182
|
function runWithoutResolvedSignatureCaching(node, fn) {
|
|
43182
|
-
const
|
|
43183
|
-
|
|
43184
|
-
|
|
43185
|
-
|
|
43183
|
+
const cachedSignatures = [];
|
|
43184
|
+
while (node) {
|
|
43185
|
+
if (isCallLikeExpression(node)) {
|
|
43186
|
+
const nodeLinks2 = getNodeLinks(node);
|
|
43187
|
+
const resolvedSignature = nodeLinks2.resolvedSignature;
|
|
43188
|
+
cachedSignatures.push([nodeLinks2, resolvedSignature]);
|
|
43189
|
+
nodeLinks2.resolvedSignature = void 0;
|
|
43190
|
+
}
|
|
43191
|
+
node = node.parent;
|
|
43186
43192
|
}
|
|
43187
43193
|
const result = fn();
|
|
43188
|
-
|
|
43189
|
-
|
|
43194
|
+
for (const [nodeLinks2, resolvedSignature] of cachedSignatures) {
|
|
43195
|
+
nodeLinks2.resolvedSignature = resolvedSignature;
|
|
43190
43196
|
}
|
|
43191
43197
|
return result;
|
|
43192
43198
|
}
|
|
@@ -50806,15 +50812,20 @@ function createTypeChecker(host) {
|
|
|
50806
50812
|
const prop = getPropertyOfType(type, name);
|
|
50807
50813
|
return prop ? getTypeOfSymbol(prop) : void 0;
|
|
50808
50814
|
}
|
|
50809
|
-
function getTypeOfPropertyOrIndexSignature(type, name
|
|
50815
|
+
function getTypeOfPropertyOrIndexSignature(type, name) {
|
|
50816
|
+
var _a;
|
|
50817
|
+
return getTypeOfPropertyOfType(type, name) || ((_a = getApplicableIndexInfoForName(type, name)) == null ? void 0 : _a.type) || unknownType;
|
|
50818
|
+
}
|
|
50819
|
+
function getTypeOfPropertyOrIndexSignatureOfType(type, name) {
|
|
50810
50820
|
var _a;
|
|
50811
50821
|
let propType;
|
|
50812
50822
|
return getTypeOfPropertyOfType(type, name) || (propType = (_a = getApplicableIndexInfoForName(type, name)) == null ? void 0 : _a.type) && addOptionality(
|
|
50813
50823
|
propType,
|
|
50814
50824
|
/*isProperty*/
|
|
50815
50825
|
true,
|
|
50816
|
-
|
|
50817
|
-
|
|
50826
|
+
/*isOptional*/
|
|
50827
|
+
true
|
|
50828
|
+
);
|
|
50818
50829
|
}
|
|
50819
50830
|
function isTypeAny(type) {
|
|
50820
50831
|
return type && (type.flags & 1 /* Any */) !== 0;
|
|
@@ -61816,12 +61827,7 @@ function createTypeChecker(host) {
|
|
|
61816
61827
|
let matched = false;
|
|
61817
61828
|
for (let i = 0; i < types.length; i++) {
|
|
61818
61829
|
if (include[i]) {
|
|
61819
|
-
const targetType =
|
|
61820
|
-
types[i],
|
|
61821
|
-
propertyName,
|
|
61822
|
-
/*addOptionalityToIndex*/
|
|
61823
|
-
true
|
|
61824
|
-
);
|
|
61830
|
+
const targetType = getTypeOfPropertyOrIndexSignatureOfType(types[i], propertyName);
|
|
61825
61831
|
if (targetType && related(getDiscriminatingType(), targetType)) {
|
|
61826
61832
|
matched = true;
|
|
61827
61833
|
} else {
|
|
@@ -65219,12 +65225,7 @@ function createTypeChecker(host) {
|
|
|
65219
65225
|
propType = removeNullable && optionalChain ? getOptionalType(propType) : propType;
|
|
65220
65226
|
const narrowedPropType = narrowType2(propType);
|
|
65221
65227
|
return filterType(type, (t) => {
|
|
65222
|
-
const discriminantType = getTypeOfPropertyOrIndexSignature(
|
|
65223
|
-
t,
|
|
65224
|
-
propName,
|
|
65225
|
-
/*addOptionalityToIndex*/
|
|
65226
|
-
false
|
|
65227
|
-
);
|
|
65228
|
+
const discriminantType = getTypeOfPropertyOrIndexSignature(t, propName);
|
|
65228
65229
|
return !(discriminantType.flags & 131072 /* Never */) && !(narrowedPropType.flags & 131072 /* Never */) && areTypesComparable(narrowedPropType, discriminantType);
|
|
65229
65230
|
});
|
|
65230
65231
|
}
|
|
@@ -74222,19 +74223,16 @@ function createTypeChecker(host) {
|
|
|
74222
74223
|
}
|
|
74223
74224
|
}
|
|
74224
74225
|
}
|
|
74225
|
-
function
|
|
74226
|
+
function getReturnTypeOfSingleNonGenericCallSignature(funcType) {
|
|
74226
74227
|
const signature = getSingleCallSignature(funcType);
|
|
74227
|
-
if (signature) {
|
|
74228
|
-
|
|
74229
|
-
if (!signature.typeParameters || !couldContainTypeVariables(returnType)) {
|
|
74230
|
-
return returnType;
|
|
74231
|
-
}
|
|
74228
|
+
if (signature && !signature.typeParameters) {
|
|
74229
|
+
return getReturnTypeOfSignature(signature);
|
|
74232
74230
|
}
|
|
74233
74231
|
}
|
|
74234
74232
|
function getReturnTypeOfSingleNonGenericSignatureOfCallChain(expr) {
|
|
74235
74233
|
const funcType = checkExpression(expr.expression);
|
|
74236
74234
|
const nonOptionalType = getOptionalExpressionType(funcType, expr.expression);
|
|
74237
|
-
const returnType =
|
|
74235
|
+
const returnType = getReturnTypeOfSingleNonGenericCallSignature(funcType);
|
|
74238
74236
|
return returnType && propagateOptionalTypeMarker(returnType, expr, nonOptionalType !== funcType);
|
|
74239
74237
|
}
|
|
74240
74238
|
function getTypeOfExpression(node) {
|
|
@@ -74279,7 +74277,7 @@ function createTypeChecker(host) {
|
|
|
74279
74277
|
/*requireStringLiteralLikeArgument*/
|
|
74280
74278
|
true
|
|
74281
74279
|
) && !isSymbolOrSymbolForCall(expr)) {
|
|
74282
|
-
return isCallChain(expr) ? getReturnTypeOfSingleNonGenericSignatureOfCallChain(expr) :
|
|
74280
|
+
return isCallChain(expr) ? getReturnTypeOfSingleNonGenericSignatureOfCallChain(expr) : getReturnTypeOfSingleNonGenericCallSignature(checkNonNullExpression(expr.expression));
|
|
74283
74281
|
} else if (isAssertionExpression(expr) && !isConstTypeReference(expr.type)) {
|
|
74284
74282
|
return getTypeFromTypeNode(expr.type);
|
|
74285
74283
|
} else if (isLiteralExpression(node) || isBooleanLiteral(node)) {
|
package/lib/tsserver.js
CHANGED
|
@@ -2305,7 +2305,7 @@ module.exports = __toCommonJS(server_exports);
|
|
|
2305
2305
|
|
|
2306
2306
|
// src/compiler/corePublic.ts
|
|
2307
2307
|
var versionMajorMinor = "5.2";
|
|
2308
|
-
var version = `${versionMajorMinor}.0-insiders.
|
|
2308
|
+
var version = `${versionMajorMinor}.0-insiders.20230621`;
|
|
2309
2309
|
var Comparison = /* @__PURE__ */ ((Comparison3) => {
|
|
2310
2310
|
Comparison3[Comparison3["LessThan"] = -1] = "LessThan";
|
|
2311
2311
|
Comparison3[Comparison3["EqualTo"] = 0] = "EqualTo";
|
|
@@ -11230,6 +11230,7 @@ var Diagnostics = {
|
|
|
11230
11230
|
Inline_variable: diag(95184, 3 /* Message */, "Inline_variable_95184", "Inline variable"),
|
|
11231
11231
|
Could_not_find_variable_to_inline: diag(95185, 3 /* Message */, "Could_not_find_variable_to_inline_95185", "Could not find variable to inline."),
|
|
11232
11232
|
Variables_with_multiple_declarations_cannot_be_inlined: diag(95186, 3 /* Message */, "Variables_with_multiple_declarations_cannot_be_inlined_95186", "Variables with multiple declarations cannot be inlined."),
|
|
11233
|
+
Add_missing_comma_for_an_object_member_completion_0: diag(95187, 3 /* Message */, "Add_missing_comma_for_an_object_member_completion_0_95187", "Add missing comma for an object member completion '{0}'."),
|
|
11233
11234
|
No_value_exists_in_scope_for_the_shorthand_property_0_Either_declare_one_or_provide_an_initializer: diag(18004, 1 /* 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."),
|
|
11234
11235
|
Classes_may_not_have_a_field_named_constructor: diag(18006, 1 /* Error */, "Classes_may_not_have_a_field_named_constructor_18006", "Classes may not have a field named 'constructor'."),
|
|
11235
11236
|
JSX_expressions_may_not_use_the_comma_operator_Did_you_mean_to_write_an_array: diag(18007, 1 /* 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?"),
|
|
@@ -47820,14 +47821,19 @@ function createTypeChecker(host) {
|
|
|
47820
47821
|
typeHasCallOrConstructSignatures
|
|
47821
47822
|
};
|
|
47822
47823
|
function runWithoutResolvedSignatureCaching(node, fn) {
|
|
47823
|
-
const
|
|
47824
|
-
|
|
47825
|
-
|
|
47826
|
-
|
|
47824
|
+
const cachedSignatures = [];
|
|
47825
|
+
while (node) {
|
|
47826
|
+
if (isCallLikeExpression(node)) {
|
|
47827
|
+
const nodeLinks2 = getNodeLinks(node);
|
|
47828
|
+
const resolvedSignature = nodeLinks2.resolvedSignature;
|
|
47829
|
+
cachedSignatures.push([nodeLinks2, resolvedSignature]);
|
|
47830
|
+
nodeLinks2.resolvedSignature = void 0;
|
|
47831
|
+
}
|
|
47832
|
+
node = node.parent;
|
|
47827
47833
|
}
|
|
47828
47834
|
const result = fn();
|
|
47829
|
-
|
|
47830
|
-
|
|
47835
|
+
for (const [nodeLinks2, resolvedSignature] of cachedSignatures) {
|
|
47836
|
+
nodeLinks2.resolvedSignature = resolvedSignature;
|
|
47831
47837
|
}
|
|
47832
47838
|
return result;
|
|
47833
47839
|
}
|
|
@@ -55447,15 +55453,20 @@ function createTypeChecker(host) {
|
|
|
55447
55453
|
const prop = getPropertyOfType(type, name);
|
|
55448
55454
|
return prop ? getTypeOfSymbol(prop) : void 0;
|
|
55449
55455
|
}
|
|
55450
|
-
function getTypeOfPropertyOrIndexSignature(type, name
|
|
55456
|
+
function getTypeOfPropertyOrIndexSignature(type, name) {
|
|
55457
|
+
var _a;
|
|
55458
|
+
return getTypeOfPropertyOfType(type, name) || ((_a = getApplicableIndexInfoForName(type, name)) == null ? void 0 : _a.type) || unknownType;
|
|
55459
|
+
}
|
|
55460
|
+
function getTypeOfPropertyOrIndexSignatureOfType(type, name) {
|
|
55451
55461
|
var _a;
|
|
55452
55462
|
let propType;
|
|
55453
55463
|
return getTypeOfPropertyOfType(type, name) || (propType = (_a = getApplicableIndexInfoForName(type, name)) == null ? void 0 : _a.type) && addOptionality(
|
|
55454
55464
|
propType,
|
|
55455
55465
|
/*isProperty*/
|
|
55456
55466
|
true,
|
|
55457
|
-
|
|
55458
|
-
|
|
55467
|
+
/*isOptional*/
|
|
55468
|
+
true
|
|
55469
|
+
);
|
|
55459
55470
|
}
|
|
55460
55471
|
function isTypeAny(type) {
|
|
55461
55472
|
return type && (type.flags & 1 /* Any */) !== 0;
|
|
@@ -66457,12 +66468,7 @@ function createTypeChecker(host) {
|
|
|
66457
66468
|
let matched = false;
|
|
66458
66469
|
for (let i = 0; i < types.length; i++) {
|
|
66459
66470
|
if (include[i]) {
|
|
66460
|
-
const targetType =
|
|
66461
|
-
types[i],
|
|
66462
|
-
propertyName,
|
|
66463
|
-
/*addOptionalityToIndex*/
|
|
66464
|
-
true
|
|
66465
|
-
);
|
|
66471
|
+
const targetType = getTypeOfPropertyOrIndexSignatureOfType(types[i], propertyName);
|
|
66466
66472
|
if (targetType && related(getDiscriminatingType(), targetType)) {
|
|
66467
66473
|
matched = true;
|
|
66468
66474
|
} else {
|
|
@@ -69860,12 +69866,7 @@ function createTypeChecker(host) {
|
|
|
69860
69866
|
propType = removeNullable && optionalChain ? getOptionalType(propType) : propType;
|
|
69861
69867
|
const narrowedPropType = narrowType2(propType);
|
|
69862
69868
|
return filterType(type, (t) => {
|
|
69863
|
-
const discriminantType = getTypeOfPropertyOrIndexSignature(
|
|
69864
|
-
t,
|
|
69865
|
-
propName,
|
|
69866
|
-
/*addOptionalityToIndex*/
|
|
69867
|
-
false
|
|
69868
|
-
);
|
|
69869
|
+
const discriminantType = getTypeOfPropertyOrIndexSignature(t, propName);
|
|
69869
69870
|
return !(discriminantType.flags & 131072 /* Never */) && !(narrowedPropType.flags & 131072 /* Never */) && areTypesComparable(narrowedPropType, discriminantType);
|
|
69870
69871
|
});
|
|
69871
69872
|
}
|
|
@@ -78863,19 +78864,16 @@ function createTypeChecker(host) {
|
|
|
78863
78864
|
}
|
|
78864
78865
|
}
|
|
78865
78866
|
}
|
|
78866
|
-
function
|
|
78867
|
+
function getReturnTypeOfSingleNonGenericCallSignature(funcType) {
|
|
78867
78868
|
const signature = getSingleCallSignature(funcType);
|
|
78868
|
-
if (signature) {
|
|
78869
|
-
|
|
78870
|
-
if (!signature.typeParameters || !couldContainTypeVariables(returnType)) {
|
|
78871
|
-
return returnType;
|
|
78872
|
-
}
|
|
78869
|
+
if (signature && !signature.typeParameters) {
|
|
78870
|
+
return getReturnTypeOfSignature(signature);
|
|
78873
78871
|
}
|
|
78874
78872
|
}
|
|
78875
78873
|
function getReturnTypeOfSingleNonGenericSignatureOfCallChain(expr) {
|
|
78876
78874
|
const funcType = checkExpression(expr.expression);
|
|
78877
78875
|
const nonOptionalType = getOptionalExpressionType(funcType, expr.expression);
|
|
78878
|
-
const returnType =
|
|
78876
|
+
const returnType = getReturnTypeOfSingleNonGenericCallSignature(funcType);
|
|
78879
78877
|
return returnType && propagateOptionalTypeMarker(returnType, expr, nonOptionalType !== funcType);
|
|
78880
78878
|
}
|
|
78881
78879
|
function getTypeOfExpression(node) {
|
|
@@ -78920,7 +78918,7 @@ function createTypeChecker(host) {
|
|
|
78920
78918
|
/*requireStringLiteralLikeArgument*/
|
|
78921
78919
|
true
|
|
78922
78920
|
) && !isSymbolOrSymbolForCall(expr)) {
|
|
78923
|
-
return isCallChain(expr) ? getReturnTypeOfSingleNonGenericSignatureOfCallChain(expr) :
|
|
78921
|
+
return isCallChain(expr) ? getReturnTypeOfSingleNonGenericSignatureOfCallChain(expr) : getReturnTypeOfSingleNonGenericCallSignature(checkNonNullExpression(expr.expression));
|
|
78924
78922
|
} else if (isAssertionExpression(expr) && !isConstTypeReference(expr.type)) {
|
|
78925
78923
|
return getTypeFromTypeNode(expr.type);
|
|
78926
78924
|
} else if (isLiteralExpression(node) || isBooleanLiteral(node)) {
|
|
@@ -155214,6 +155212,7 @@ var CompletionSource = /* @__PURE__ */ ((CompletionSource2) => {
|
|
|
155214
155212
|
CompletionSource2["TypeOnlyAlias"] = "TypeOnlyAlias/";
|
|
155215
155213
|
CompletionSource2["ObjectLiteralMethodSnippet"] = "ObjectLiteralMethodSnippet/";
|
|
155216
155214
|
CompletionSource2["SwitchCases"] = "SwitchCases/";
|
|
155215
|
+
CompletionSource2["ObjectLiteralMemberWithComma"] = "ObjectLiteralMemberWithComma/";
|
|
155217
155216
|
return CompletionSource2;
|
|
155218
155217
|
})(CompletionSource || {});
|
|
155219
155218
|
var SymbolOriginInfoKind = /* @__PURE__ */ ((SymbolOriginInfoKind2) => {
|
|
@@ -156092,6 +156091,7 @@ function createCompletionEntryForLiteral(sourceFile, preferences, literal) {
|
|
|
156092
156091
|
return { name: completionNameForLiteral(sourceFile, preferences, literal), kind: "string" /* string */, kindModifiers: "" /* none */, sortText: SortText.LocationPriority };
|
|
156093
156092
|
}
|
|
156094
156093
|
function createCompletionEntry(symbol, sortText, replacementToken, contextToken, location, position, sourceFile, host, program, name, needsConvertPropertyAccess, origin, recommendedCompletion, propertyAccessToConvert, isJsxInitializer, importStatementCompletion, useSemicolons, options, preferences, completionKind, formatContext, isJsxIdentifierExpected, isRightOfOpenTag, includeSymbol) {
|
|
156094
|
+
var _a, _b, _c;
|
|
156095
156095
|
let insertText;
|
|
156096
156096
|
let filterText;
|
|
156097
156097
|
let replacementSpan = getReplacementSpanForContextToken(replacementToken);
|
|
@@ -156150,6 +156150,10 @@ function createCompletionEntry(symbol, sortText, replacementToken, contextToken,
|
|
|
156150
156150
|
if ((origin == null ? void 0 : origin.kind) === 64 /* TypeOnlyAlias */) {
|
|
156151
156151
|
hasAction = true;
|
|
156152
156152
|
}
|
|
156153
|
+
if (completionKind === 0 /* ObjectPropertyDeclaration */ && contextToken && ((_a = findPrecedingToken(contextToken.pos, sourceFile, contextToken)) == null ? void 0 : _a.kind) !== 28 /* CommaToken */ && ((_b = findNextToken(contextToken, contextToken.parent, sourceFile)) == null ? void 0 : _b.kind) !== 28 /* CommaToken */ && (((_c = findAncestor(contextToken.parent, (node) => isPropertyAssignment(node))) == null ? void 0 : _c.getLastToken()) === contextToken || isMethodDeclaration(contextToken.parent.parent))) {
|
|
156154
|
+
source = "ObjectLiteralMemberWithComma/" /* ObjectLiteralMemberWithComma */;
|
|
156155
|
+
hasAction = true;
|
|
156156
|
+
}
|
|
156153
156157
|
if (preferences.includeCompletionsWithClassMemberSnippets && preferences.includeCompletionsWithInsertText && completionKind === 3 /* MemberLike */ && isClassLikeMemberCompletion(symbol, location, sourceFile)) {
|
|
156154
156158
|
let importAdder;
|
|
156155
156159
|
const memberCompletionEntry = getEntryForMemberCompletion(host, program, options, preferences, name, symbol, location, position, contextToken, formatContext);
|
|
@@ -156880,7 +156884,7 @@ function getSymbolCompletionFromEntryId(program, log, sourceFile, position, entr
|
|
|
156880
156884
|
return firstDefined(symbols, (symbol, index) => {
|
|
156881
156885
|
const origin = symbolToOriginInfoMap[index];
|
|
156882
156886
|
const info = getCompletionEntryDisplayNameForSymbol(symbol, getEmitScriptTarget(compilerOptions), origin, completionKind, completionData.isJsxIdentifierExpected);
|
|
156883
|
-
return info && info.name === entryId.name && (entryId.source === "ClassMemberSnippet/" /* ClassMemberSnippet */ && symbol.flags & 106500 /* ClassMember */ || entryId.source === "ObjectLiteralMethodSnippet/" /* ObjectLiteralMethodSnippet */ && symbol.flags & (4 /* Property */ | 8192 /* Method */) || getSourceFromOrigin(origin) === entryId.source) ? { type: "symbol", symbol, location, origin, contextToken, previousToken, isJsxInitializer, isTypeOnlyLocation } : void 0;
|
|
156887
|
+
return info && info.name === entryId.name && (entryId.source === "ClassMemberSnippet/" /* ClassMemberSnippet */ && symbol.flags & 106500 /* ClassMember */ || entryId.source === "ObjectLiteralMethodSnippet/" /* ObjectLiteralMethodSnippet */ && symbol.flags & (4 /* Property */ | 8192 /* Method */) || getSourceFromOrigin(origin) === entryId.source || entryId.source === "ObjectLiteralMemberWithComma/" /* ObjectLiteralMemberWithComma */) ? { type: "symbol", symbol, location, origin, contextToken, previousToken, isJsxInitializer, isTypeOnlyLocation } : void 0;
|
|
156884
156888
|
}) || { type: "none" };
|
|
156885
156889
|
}
|
|
156886
156890
|
function getCompletionEntryDetails(program, log, sourceFile, position, entryId, host, formatContext, preferences, cancellationToken) {
|
|
@@ -157025,6 +157029,21 @@ function getCompletionEntryCodeActionsAndSourceDisplay(name, location, contextTo
|
|
|
157025
157029
|
Debug.assertIsDefined(codeAction2, "Expected to have a code action for promoting type-only alias");
|
|
157026
157030
|
return { codeActions: [codeAction2], sourceDisplay: void 0 };
|
|
157027
157031
|
}
|
|
157032
|
+
if (source === "ObjectLiteralMemberWithComma/" /* ObjectLiteralMemberWithComma */ && contextToken) {
|
|
157033
|
+
const changes = ts_textChanges_exports.ChangeTracker.with(
|
|
157034
|
+
{ host, formatContext, preferences },
|
|
157035
|
+
(tracker) => tracker.insertText(sourceFile, contextToken.end, ",")
|
|
157036
|
+
);
|
|
157037
|
+
if (changes) {
|
|
157038
|
+
return {
|
|
157039
|
+
sourceDisplay: void 0,
|
|
157040
|
+
codeActions: [{
|
|
157041
|
+
changes,
|
|
157042
|
+
description: diagnosticToString([Diagnostics.Add_missing_comma_for_an_object_member_completion_0, name])
|
|
157043
|
+
}]
|
|
157044
|
+
};
|
|
157045
|
+
}
|
|
157046
|
+
}
|
|
157028
157047
|
if (!origin || !(originIsExport(origin) || originIsResolvedExport(origin))) {
|
|
157029
157048
|
return { codeActions: void 0, sourceDisplay: void 0 };
|
|
157030
157049
|
}
|
|
@@ -158427,12 +158446,22 @@ function tryGetObjectLikeCompletionContainer(contextToken) {
|
|
|
158427
158446
|
return parent2;
|
|
158428
158447
|
}
|
|
158429
158448
|
break;
|
|
158449
|
+
case 20 /* CloseBraceToken */:
|
|
158450
|
+
if (parent2.parent && parent2.parent.parent && isMethodDeclaration(parent2.parent) && isObjectLiteralExpression(parent2.parent.parent)) {
|
|
158451
|
+
return parent2.parent.parent;
|
|
158452
|
+
}
|
|
158453
|
+
break;
|
|
158430
158454
|
case 42 /* AsteriskToken */:
|
|
158431
158455
|
return isMethodDeclaration(parent2) ? tryCast(parent2.parent, isObjectLiteralExpression) : void 0;
|
|
158432
158456
|
case 134 /* AsyncKeyword */:
|
|
158433
158457
|
return tryCast(parent2.parent, isObjectLiteralExpression);
|
|
158434
158458
|
case 80 /* Identifier */:
|
|
158435
158459
|
return contextToken.text === "async" && isShorthandPropertyAssignment(contextToken.parent) ? contextToken.parent.parent : void 0;
|
|
158460
|
+
default:
|
|
158461
|
+
const ancestorNode = findAncestor(parent2, (node) => isPropertyAssignment(node));
|
|
158462
|
+
if (contextToken.kind !== 59 /* ColonToken */ && ancestorNode && ancestorNode.getLastToken() === contextToken && isObjectLiteralExpression(ancestorNode.parent)) {
|
|
158463
|
+
return ancestorNode.parent;
|
|
158464
|
+
}
|
|
158436
158465
|
}
|
|
158437
158466
|
}
|
|
158438
158467
|
return void 0;
|
package/lib/tsserverlibrary.d.ts
CHANGED
|
@@ -5451,7 +5451,6 @@ declare namespace ts {
|
|
|
5451
5451
|
type JsxAttributeValue = StringLiteral | JsxExpression | JsxElement | JsxSelfClosingElement | JsxFragment;
|
|
5452
5452
|
interface JsxSpreadAttribute extends ObjectLiteralElement {
|
|
5453
5453
|
readonly kind: SyntaxKind.JsxSpreadAttribute;
|
|
5454
|
-
readonly name: PropertyName;
|
|
5455
5454
|
readonly parent: JsxAttributes;
|
|
5456
5455
|
readonly expression: Expression;
|
|
5457
5456
|
}
|
package/lib/tsserverlibrary.js
CHANGED
|
@@ -35,7 +35,7 @@ var ts = (() => {
|
|
|
35
35
|
"src/compiler/corePublic.ts"() {
|
|
36
36
|
"use strict";
|
|
37
37
|
versionMajorMinor = "5.2";
|
|
38
|
-
version = `${versionMajorMinor}.0-insiders.
|
|
38
|
+
version = `${versionMajorMinor}.0-insiders.20230621`;
|
|
39
39
|
Comparison = /* @__PURE__ */ ((Comparison3) => {
|
|
40
40
|
Comparison3[Comparison3["LessThan"] = -1] = "LessThan";
|
|
41
41
|
Comparison3[Comparison3["EqualTo"] = 0] = "EqualTo";
|
|
@@ -9035,6 +9035,7 @@ ${lanes.join("\n")}
|
|
|
9035
9035
|
Inline_variable: diag(95184, 3 /* Message */, "Inline_variable_95184", "Inline variable"),
|
|
9036
9036
|
Could_not_find_variable_to_inline: diag(95185, 3 /* Message */, "Could_not_find_variable_to_inline_95185", "Could not find variable to inline."),
|
|
9037
9037
|
Variables_with_multiple_declarations_cannot_be_inlined: diag(95186, 3 /* Message */, "Variables_with_multiple_declarations_cannot_be_inlined_95186", "Variables with multiple declarations cannot be inlined."),
|
|
9038
|
+
Add_missing_comma_for_an_object_member_completion_0: diag(95187, 3 /* Message */, "Add_missing_comma_for_an_object_member_completion_0_95187", "Add missing comma for an object member completion '{0}'."),
|
|
9038
9039
|
No_value_exists_in_scope_for_the_shorthand_property_0_Either_declare_one_or_provide_an_initializer: diag(18004, 1 /* 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."),
|
|
9039
9040
|
Classes_may_not_have_a_field_named_constructor: diag(18006, 1 /* Error */, "Classes_may_not_have_a_field_named_constructor_18006", "Classes may not have a field named 'constructor'."),
|
|
9040
9041
|
JSX_expressions_may_not_use_the_comma_operator_Did_you_mean_to_write_an_array: diag(18007, 1 /* 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?"),
|
|
@@ -45609,14 +45610,19 @@ ${lanes.join("\n")}
|
|
|
45609
45610
|
typeHasCallOrConstructSignatures
|
|
45610
45611
|
};
|
|
45611
45612
|
function runWithoutResolvedSignatureCaching(node, fn) {
|
|
45612
|
-
const
|
|
45613
|
-
|
|
45614
|
-
|
|
45615
|
-
|
|
45613
|
+
const cachedSignatures = [];
|
|
45614
|
+
while (node) {
|
|
45615
|
+
if (isCallLikeExpression(node)) {
|
|
45616
|
+
const nodeLinks2 = getNodeLinks(node);
|
|
45617
|
+
const resolvedSignature = nodeLinks2.resolvedSignature;
|
|
45618
|
+
cachedSignatures.push([nodeLinks2, resolvedSignature]);
|
|
45619
|
+
nodeLinks2.resolvedSignature = void 0;
|
|
45620
|
+
}
|
|
45621
|
+
node = node.parent;
|
|
45616
45622
|
}
|
|
45617
45623
|
const result = fn();
|
|
45618
|
-
|
|
45619
|
-
|
|
45624
|
+
for (const [nodeLinks2, resolvedSignature] of cachedSignatures) {
|
|
45625
|
+
nodeLinks2.resolvedSignature = resolvedSignature;
|
|
45620
45626
|
}
|
|
45621
45627
|
return result;
|
|
45622
45628
|
}
|
|
@@ -53236,15 +53242,20 @@ ${lanes.join("\n")}
|
|
|
53236
53242
|
const prop = getPropertyOfType(type, name);
|
|
53237
53243
|
return prop ? getTypeOfSymbol(prop) : void 0;
|
|
53238
53244
|
}
|
|
53239
|
-
function getTypeOfPropertyOrIndexSignature(type, name
|
|
53245
|
+
function getTypeOfPropertyOrIndexSignature(type, name) {
|
|
53246
|
+
var _a;
|
|
53247
|
+
return getTypeOfPropertyOfType(type, name) || ((_a = getApplicableIndexInfoForName(type, name)) == null ? void 0 : _a.type) || unknownType;
|
|
53248
|
+
}
|
|
53249
|
+
function getTypeOfPropertyOrIndexSignatureOfType(type, name) {
|
|
53240
53250
|
var _a;
|
|
53241
53251
|
let propType;
|
|
53242
53252
|
return getTypeOfPropertyOfType(type, name) || (propType = (_a = getApplicableIndexInfoForName(type, name)) == null ? void 0 : _a.type) && addOptionality(
|
|
53243
53253
|
propType,
|
|
53244
53254
|
/*isProperty*/
|
|
53245
53255
|
true,
|
|
53246
|
-
|
|
53247
|
-
|
|
53256
|
+
/*isOptional*/
|
|
53257
|
+
true
|
|
53258
|
+
);
|
|
53248
53259
|
}
|
|
53249
53260
|
function isTypeAny(type) {
|
|
53250
53261
|
return type && (type.flags & 1 /* Any */) !== 0;
|
|
@@ -64246,12 +64257,7 @@ ${lanes.join("\n")}
|
|
|
64246
64257
|
let matched = false;
|
|
64247
64258
|
for (let i = 0; i < types.length; i++) {
|
|
64248
64259
|
if (include[i]) {
|
|
64249
|
-
const targetType =
|
|
64250
|
-
types[i],
|
|
64251
|
-
propertyName,
|
|
64252
|
-
/*addOptionalityToIndex*/
|
|
64253
|
-
true
|
|
64254
|
-
);
|
|
64260
|
+
const targetType = getTypeOfPropertyOrIndexSignatureOfType(types[i], propertyName);
|
|
64255
64261
|
if (targetType && related(getDiscriminatingType(), targetType)) {
|
|
64256
64262
|
matched = true;
|
|
64257
64263
|
} else {
|
|
@@ -67649,12 +67655,7 @@ ${lanes.join("\n")}
|
|
|
67649
67655
|
propType = removeNullable && optionalChain ? getOptionalType(propType) : propType;
|
|
67650
67656
|
const narrowedPropType = narrowType2(propType);
|
|
67651
67657
|
return filterType(type, (t) => {
|
|
67652
|
-
const discriminantType = getTypeOfPropertyOrIndexSignature(
|
|
67653
|
-
t,
|
|
67654
|
-
propName,
|
|
67655
|
-
/*addOptionalityToIndex*/
|
|
67656
|
-
false
|
|
67657
|
-
);
|
|
67658
|
+
const discriminantType = getTypeOfPropertyOrIndexSignature(t, propName);
|
|
67658
67659
|
return !(discriminantType.flags & 131072 /* Never */) && !(narrowedPropType.flags & 131072 /* Never */) && areTypesComparable(narrowedPropType, discriminantType);
|
|
67659
67660
|
});
|
|
67660
67661
|
}
|
|
@@ -76652,19 +76653,16 @@ ${lanes.join("\n")}
|
|
|
76652
76653
|
}
|
|
76653
76654
|
}
|
|
76654
76655
|
}
|
|
76655
|
-
function
|
|
76656
|
+
function getReturnTypeOfSingleNonGenericCallSignature(funcType) {
|
|
76656
76657
|
const signature = getSingleCallSignature(funcType);
|
|
76657
|
-
if (signature) {
|
|
76658
|
-
|
|
76659
|
-
if (!signature.typeParameters || !couldContainTypeVariables(returnType)) {
|
|
76660
|
-
return returnType;
|
|
76661
|
-
}
|
|
76658
|
+
if (signature && !signature.typeParameters) {
|
|
76659
|
+
return getReturnTypeOfSignature(signature);
|
|
76662
76660
|
}
|
|
76663
76661
|
}
|
|
76664
76662
|
function getReturnTypeOfSingleNonGenericSignatureOfCallChain(expr) {
|
|
76665
76663
|
const funcType = checkExpression(expr.expression);
|
|
76666
76664
|
const nonOptionalType = getOptionalExpressionType(funcType, expr.expression);
|
|
76667
|
-
const returnType =
|
|
76665
|
+
const returnType = getReturnTypeOfSingleNonGenericCallSignature(funcType);
|
|
76668
76666
|
return returnType && propagateOptionalTypeMarker(returnType, expr, nonOptionalType !== funcType);
|
|
76669
76667
|
}
|
|
76670
76668
|
function getTypeOfExpression(node) {
|
|
@@ -76709,7 +76707,7 @@ ${lanes.join("\n")}
|
|
|
76709
76707
|
/*requireStringLiteralLikeArgument*/
|
|
76710
76708
|
true
|
|
76711
76709
|
) && !isSymbolOrSymbolForCall(expr)) {
|
|
76712
|
-
return isCallChain(expr) ? getReturnTypeOfSingleNonGenericSignatureOfCallChain(expr) :
|
|
76710
|
+
return isCallChain(expr) ? getReturnTypeOfSingleNonGenericSignatureOfCallChain(expr) : getReturnTypeOfSingleNonGenericCallSignature(checkNonNullExpression(expr.expression));
|
|
76713
76711
|
} else if (isAssertionExpression(expr) && !isConstTypeReference(expr.type)) {
|
|
76714
76712
|
return getTypeFromTypeNode(expr.type);
|
|
76715
76713
|
} else if (isLiteralExpression(node) || isBooleanLiteral(node)) {
|
|
@@ -155332,6 +155330,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
|
|
|
155332
155330
|
return { name: completionNameForLiteral(sourceFile, preferences, literal), kind: "string" /* string */, kindModifiers: "" /* none */, sortText: SortText.LocationPriority };
|
|
155333
155331
|
}
|
|
155334
155332
|
function createCompletionEntry(symbol, sortText, replacementToken, contextToken, location, position, sourceFile, host, program, name, needsConvertPropertyAccess, origin, recommendedCompletion, propertyAccessToConvert, isJsxInitializer, importStatementCompletion, useSemicolons, options, preferences, completionKind, formatContext, isJsxIdentifierExpected, isRightOfOpenTag, includeSymbol) {
|
|
155333
|
+
var _a, _b, _c;
|
|
155335
155334
|
let insertText;
|
|
155336
155335
|
let filterText;
|
|
155337
155336
|
let replacementSpan = getReplacementSpanForContextToken(replacementToken);
|
|
@@ -155390,6 +155389,10 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
|
|
|
155390
155389
|
if ((origin == null ? void 0 : origin.kind) === 64 /* TypeOnlyAlias */) {
|
|
155391
155390
|
hasAction = true;
|
|
155392
155391
|
}
|
|
155392
|
+
if (completionKind === 0 /* ObjectPropertyDeclaration */ && contextToken && ((_a = findPrecedingToken(contextToken.pos, sourceFile, contextToken)) == null ? void 0 : _a.kind) !== 28 /* CommaToken */ && ((_b = findNextToken(contextToken, contextToken.parent, sourceFile)) == null ? void 0 : _b.kind) !== 28 /* CommaToken */ && (((_c = findAncestor(contextToken.parent, (node) => isPropertyAssignment(node))) == null ? void 0 : _c.getLastToken()) === contextToken || isMethodDeclaration(contextToken.parent.parent))) {
|
|
155393
|
+
source = "ObjectLiteralMemberWithComma/" /* ObjectLiteralMemberWithComma */;
|
|
155394
|
+
hasAction = true;
|
|
155395
|
+
}
|
|
155393
155396
|
if (preferences.includeCompletionsWithClassMemberSnippets && preferences.includeCompletionsWithInsertText && completionKind === 3 /* MemberLike */ && isClassLikeMemberCompletion(symbol, location, sourceFile)) {
|
|
155394
155397
|
let importAdder;
|
|
155395
155398
|
const memberCompletionEntry = getEntryForMemberCompletion(host, program, options, preferences, name, symbol, location, position, contextToken, formatContext);
|
|
@@ -156120,7 +156123,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
|
|
|
156120
156123
|
return firstDefined(symbols, (symbol, index) => {
|
|
156121
156124
|
const origin = symbolToOriginInfoMap[index];
|
|
156122
156125
|
const info = getCompletionEntryDisplayNameForSymbol(symbol, getEmitScriptTarget(compilerOptions), origin, completionKind, completionData.isJsxIdentifierExpected);
|
|
156123
|
-
return info && info.name === entryId.name && (entryId.source === "ClassMemberSnippet/" /* ClassMemberSnippet */ && symbol.flags & 106500 /* ClassMember */ || entryId.source === "ObjectLiteralMethodSnippet/" /* ObjectLiteralMethodSnippet */ && symbol.flags & (4 /* Property */ | 8192 /* Method */) || getSourceFromOrigin(origin) === entryId.source) ? { type: "symbol", symbol, location, origin, contextToken, previousToken, isJsxInitializer, isTypeOnlyLocation } : void 0;
|
|
156126
|
+
return info && info.name === entryId.name && (entryId.source === "ClassMemberSnippet/" /* ClassMemberSnippet */ && symbol.flags & 106500 /* ClassMember */ || entryId.source === "ObjectLiteralMethodSnippet/" /* ObjectLiteralMethodSnippet */ && symbol.flags & (4 /* Property */ | 8192 /* Method */) || getSourceFromOrigin(origin) === entryId.source || entryId.source === "ObjectLiteralMemberWithComma/" /* ObjectLiteralMemberWithComma */) ? { type: "symbol", symbol, location, origin, contextToken, previousToken, isJsxInitializer, isTypeOnlyLocation } : void 0;
|
|
156124
156127
|
}) || { type: "none" };
|
|
156125
156128
|
}
|
|
156126
156129
|
function getCompletionEntryDetails(program, log, sourceFile, position, entryId, host, formatContext, preferences, cancellationToken) {
|
|
@@ -156265,6 +156268,21 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
|
|
|
156265
156268
|
Debug.assertIsDefined(codeAction2, "Expected to have a code action for promoting type-only alias");
|
|
156266
156269
|
return { codeActions: [codeAction2], sourceDisplay: void 0 };
|
|
156267
156270
|
}
|
|
156271
|
+
if (source === "ObjectLiteralMemberWithComma/" /* ObjectLiteralMemberWithComma */ && contextToken) {
|
|
156272
|
+
const changes = ts_textChanges_exports.ChangeTracker.with(
|
|
156273
|
+
{ host, formatContext, preferences },
|
|
156274
|
+
(tracker) => tracker.insertText(sourceFile, contextToken.end, ",")
|
|
156275
|
+
);
|
|
156276
|
+
if (changes) {
|
|
156277
|
+
return {
|
|
156278
|
+
sourceDisplay: void 0,
|
|
156279
|
+
codeActions: [{
|
|
156280
|
+
changes,
|
|
156281
|
+
description: diagnosticToString([Diagnostics.Add_missing_comma_for_an_object_member_completion_0, name])
|
|
156282
|
+
}]
|
|
156283
|
+
};
|
|
156284
|
+
}
|
|
156285
|
+
}
|
|
156268
156286
|
if (!origin || !(originIsExport(origin) || originIsResolvedExport(origin))) {
|
|
156269
156287
|
return { codeActions: void 0, sourceDisplay: void 0 };
|
|
156270
156288
|
}
|
|
@@ -157658,12 +157676,22 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
|
|
|
157658
157676
|
return parent2;
|
|
157659
157677
|
}
|
|
157660
157678
|
break;
|
|
157679
|
+
case 20 /* CloseBraceToken */:
|
|
157680
|
+
if (parent2.parent && parent2.parent.parent && isMethodDeclaration(parent2.parent) && isObjectLiteralExpression(parent2.parent.parent)) {
|
|
157681
|
+
return parent2.parent.parent;
|
|
157682
|
+
}
|
|
157683
|
+
break;
|
|
157661
157684
|
case 42 /* AsteriskToken */:
|
|
157662
157685
|
return isMethodDeclaration(parent2) ? tryCast(parent2.parent, isObjectLiteralExpression) : void 0;
|
|
157663
157686
|
case 134 /* AsyncKeyword */:
|
|
157664
157687
|
return tryCast(parent2.parent, isObjectLiteralExpression);
|
|
157665
157688
|
case 80 /* Identifier */:
|
|
157666
157689
|
return contextToken.text === "async" && isShorthandPropertyAssignment(contextToken.parent) ? contextToken.parent.parent : void 0;
|
|
157690
|
+
default:
|
|
157691
|
+
const ancestorNode = findAncestor(parent2, (node) => isPropertyAssignment(node));
|
|
157692
|
+
if (contextToken.kind !== 59 /* ColonToken */ && ancestorNode && ancestorNode.getLastToken() === contextToken && isObjectLiteralExpression(ancestorNode.parent)) {
|
|
157693
|
+
return ancestorNode.parent;
|
|
157694
|
+
}
|
|
157667
157695
|
}
|
|
157668
157696
|
}
|
|
157669
157697
|
return void 0;
|
|
@@ -158205,6 +158233,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
|
|
|
158205
158233
|
CompletionSource2["TypeOnlyAlias"] = "TypeOnlyAlias/";
|
|
158206
158234
|
CompletionSource2["ObjectLiteralMethodSnippet"] = "ObjectLiteralMethodSnippet/";
|
|
158207
158235
|
CompletionSource2["SwitchCases"] = "SwitchCases/";
|
|
158236
|
+
CompletionSource2["ObjectLiteralMemberWithComma"] = "ObjectLiteralMemberWithComma/";
|
|
158208
158237
|
return CompletionSource2;
|
|
158209
158238
|
})(CompletionSource || {});
|
|
158210
158239
|
SymbolOriginInfoKind = /* @__PURE__ */ ((SymbolOriginInfoKind2) => {
|
package/lib/typescript.d.ts
CHANGED
|
@@ -1398,7 +1398,6 @@ declare namespace ts {
|
|
|
1398
1398
|
type JsxAttributeValue = StringLiteral | JsxExpression | JsxElement | JsxSelfClosingElement | JsxFragment;
|
|
1399
1399
|
interface JsxSpreadAttribute extends ObjectLiteralElement {
|
|
1400
1400
|
readonly kind: SyntaxKind.JsxSpreadAttribute;
|
|
1401
|
-
readonly name: PropertyName;
|
|
1402
1401
|
readonly parent: JsxAttributes;
|
|
1403
1402
|
readonly expression: Expression;
|
|
1404
1403
|
}
|
package/lib/typescript.js
CHANGED
|
@@ -35,7 +35,7 @@ var ts = (() => {
|
|
|
35
35
|
"src/compiler/corePublic.ts"() {
|
|
36
36
|
"use strict";
|
|
37
37
|
versionMajorMinor = "5.2";
|
|
38
|
-
version = `${versionMajorMinor}.0-insiders.
|
|
38
|
+
version = `${versionMajorMinor}.0-insiders.20230621`;
|
|
39
39
|
Comparison = /* @__PURE__ */ ((Comparison3) => {
|
|
40
40
|
Comparison3[Comparison3["LessThan"] = -1] = "LessThan";
|
|
41
41
|
Comparison3[Comparison3["EqualTo"] = 0] = "EqualTo";
|
|
@@ -9035,6 +9035,7 @@ ${lanes.join("\n")}
|
|
|
9035
9035
|
Inline_variable: diag(95184, 3 /* Message */, "Inline_variable_95184", "Inline variable"),
|
|
9036
9036
|
Could_not_find_variable_to_inline: diag(95185, 3 /* Message */, "Could_not_find_variable_to_inline_95185", "Could not find variable to inline."),
|
|
9037
9037
|
Variables_with_multiple_declarations_cannot_be_inlined: diag(95186, 3 /* Message */, "Variables_with_multiple_declarations_cannot_be_inlined_95186", "Variables with multiple declarations cannot be inlined."),
|
|
9038
|
+
Add_missing_comma_for_an_object_member_completion_0: diag(95187, 3 /* Message */, "Add_missing_comma_for_an_object_member_completion_0_95187", "Add missing comma for an object member completion '{0}'."),
|
|
9038
9039
|
No_value_exists_in_scope_for_the_shorthand_property_0_Either_declare_one_or_provide_an_initializer: diag(18004, 1 /* 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."),
|
|
9039
9040
|
Classes_may_not_have_a_field_named_constructor: diag(18006, 1 /* Error */, "Classes_may_not_have_a_field_named_constructor_18006", "Classes may not have a field named 'constructor'."),
|
|
9040
9041
|
JSX_expressions_may_not_use_the_comma_operator_Did_you_mean_to_write_an_array: diag(18007, 1 /* 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?"),
|
|
@@ -45609,14 +45610,19 @@ ${lanes.join("\n")}
|
|
|
45609
45610
|
typeHasCallOrConstructSignatures
|
|
45610
45611
|
};
|
|
45611
45612
|
function runWithoutResolvedSignatureCaching(node, fn) {
|
|
45612
|
-
const
|
|
45613
|
-
|
|
45614
|
-
|
|
45615
|
-
|
|
45613
|
+
const cachedSignatures = [];
|
|
45614
|
+
while (node) {
|
|
45615
|
+
if (isCallLikeExpression(node)) {
|
|
45616
|
+
const nodeLinks2 = getNodeLinks(node);
|
|
45617
|
+
const resolvedSignature = nodeLinks2.resolvedSignature;
|
|
45618
|
+
cachedSignatures.push([nodeLinks2, resolvedSignature]);
|
|
45619
|
+
nodeLinks2.resolvedSignature = void 0;
|
|
45620
|
+
}
|
|
45621
|
+
node = node.parent;
|
|
45616
45622
|
}
|
|
45617
45623
|
const result = fn();
|
|
45618
|
-
|
|
45619
|
-
|
|
45624
|
+
for (const [nodeLinks2, resolvedSignature] of cachedSignatures) {
|
|
45625
|
+
nodeLinks2.resolvedSignature = resolvedSignature;
|
|
45620
45626
|
}
|
|
45621
45627
|
return result;
|
|
45622
45628
|
}
|
|
@@ -53236,15 +53242,20 @@ ${lanes.join("\n")}
|
|
|
53236
53242
|
const prop = getPropertyOfType(type, name);
|
|
53237
53243
|
return prop ? getTypeOfSymbol(prop) : void 0;
|
|
53238
53244
|
}
|
|
53239
|
-
function getTypeOfPropertyOrIndexSignature(type, name
|
|
53245
|
+
function getTypeOfPropertyOrIndexSignature(type, name) {
|
|
53246
|
+
var _a;
|
|
53247
|
+
return getTypeOfPropertyOfType(type, name) || ((_a = getApplicableIndexInfoForName(type, name)) == null ? void 0 : _a.type) || unknownType;
|
|
53248
|
+
}
|
|
53249
|
+
function getTypeOfPropertyOrIndexSignatureOfType(type, name) {
|
|
53240
53250
|
var _a;
|
|
53241
53251
|
let propType;
|
|
53242
53252
|
return getTypeOfPropertyOfType(type, name) || (propType = (_a = getApplicableIndexInfoForName(type, name)) == null ? void 0 : _a.type) && addOptionality(
|
|
53243
53253
|
propType,
|
|
53244
53254
|
/*isProperty*/
|
|
53245
53255
|
true,
|
|
53246
|
-
|
|
53247
|
-
|
|
53256
|
+
/*isOptional*/
|
|
53257
|
+
true
|
|
53258
|
+
);
|
|
53248
53259
|
}
|
|
53249
53260
|
function isTypeAny(type) {
|
|
53250
53261
|
return type && (type.flags & 1 /* Any */) !== 0;
|
|
@@ -64246,12 +64257,7 @@ ${lanes.join("\n")}
|
|
|
64246
64257
|
let matched = false;
|
|
64247
64258
|
for (let i = 0; i < types.length; i++) {
|
|
64248
64259
|
if (include[i]) {
|
|
64249
|
-
const targetType =
|
|
64250
|
-
types[i],
|
|
64251
|
-
propertyName,
|
|
64252
|
-
/*addOptionalityToIndex*/
|
|
64253
|
-
true
|
|
64254
|
-
);
|
|
64260
|
+
const targetType = getTypeOfPropertyOrIndexSignatureOfType(types[i], propertyName);
|
|
64255
64261
|
if (targetType && related(getDiscriminatingType(), targetType)) {
|
|
64256
64262
|
matched = true;
|
|
64257
64263
|
} else {
|
|
@@ -67649,12 +67655,7 @@ ${lanes.join("\n")}
|
|
|
67649
67655
|
propType = removeNullable && optionalChain ? getOptionalType(propType) : propType;
|
|
67650
67656
|
const narrowedPropType = narrowType2(propType);
|
|
67651
67657
|
return filterType(type, (t) => {
|
|
67652
|
-
const discriminantType = getTypeOfPropertyOrIndexSignature(
|
|
67653
|
-
t,
|
|
67654
|
-
propName,
|
|
67655
|
-
/*addOptionalityToIndex*/
|
|
67656
|
-
false
|
|
67657
|
-
);
|
|
67658
|
+
const discriminantType = getTypeOfPropertyOrIndexSignature(t, propName);
|
|
67658
67659
|
return !(discriminantType.flags & 131072 /* Never */) && !(narrowedPropType.flags & 131072 /* Never */) && areTypesComparable(narrowedPropType, discriminantType);
|
|
67659
67660
|
});
|
|
67660
67661
|
}
|
|
@@ -76652,19 +76653,16 @@ ${lanes.join("\n")}
|
|
|
76652
76653
|
}
|
|
76653
76654
|
}
|
|
76654
76655
|
}
|
|
76655
|
-
function
|
|
76656
|
+
function getReturnTypeOfSingleNonGenericCallSignature(funcType) {
|
|
76656
76657
|
const signature = getSingleCallSignature(funcType);
|
|
76657
|
-
if (signature) {
|
|
76658
|
-
|
|
76659
|
-
if (!signature.typeParameters || !couldContainTypeVariables(returnType)) {
|
|
76660
|
-
return returnType;
|
|
76661
|
-
}
|
|
76658
|
+
if (signature && !signature.typeParameters) {
|
|
76659
|
+
return getReturnTypeOfSignature(signature);
|
|
76662
76660
|
}
|
|
76663
76661
|
}
|
|
76664
76662
|
function getReturnTypeOfSingleNonGenericSignatureOfCallChain(expr) {
|
|
76665
76663
|
const funcType = checkExpression(expr.expression);
|
|
76666
76664
|
const nonOptionalType = getOptionalExpressionType(funcType, expr.expression);
|
|
76667
|
-
const returnType =
|
|
76665
|
+
const returnType = getReturnTypeOfSingleNonGenericCallSignature(funcType);
|
|
76668
76666
|
return returnType && propagateOptionalTypeMarker(returnType, expr, nonOptionalType !== funcType);
|
|
76669
76667
|
}
|
|
76670
76668
|
function getTypeOfExpression(node) {
|
|
@@ -76709,7 +76707,7 @@ ${lanes.join("\n")}
|
|
|
76709
76707
|
/*requireStringLiteralLikeArgument*/
|
|
76710
76708
|
true
|
|
76711
76709
|
) && !isSymbolOrSymbolForCall(expr)) {
|
|
76712
|
-
return isCallChain(expr) ? getReturnTypeOfSingleNonGenericSignatureOfCallChain(expr) :
|
|
76710
|
+
return isCallChain(expr) ? getReturnTypeOfSingleNonGenericSignatureOfCallChain(expr) : getReturnTypeOfSingleNonGenericCallSignature(checkNonNullExpression(expr.expression));
|
|
76713
76711
|
} else if (isAssertionExpression(expr) && !isConstTypeReference(expr.type)) {
|
|
76714
76712
|
return getTypeFromTypeNode(expr.type);
|
|
76715
76713
|
} else if (isLiteralExpression(node) || isBooleanLiteral(node)) {
|
|
@@ -155347,6 +155345,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
|
|
|
155347
155345
|
return { name: completionNameForLiteral(sourceFile, preferences, literal), kind: "string" /* string */, kindModifiers: "" /* none */, sortText: SortText.LocationPriority };
|
|
155348
155346
|
}
|
|
155349
155347
|
function createCompletionEntry(symbol, sortText, replacementToken, contextToken, location, position, sourceFile, host, program, name, needsConvertPropertyAccess, origin, recommendedCompletion, propertyAccessToConvert, isJsxInitializer, importStatementCompletion, useSemicolons, options, preferences, completionKind, formatContext, isJsxIdentifierExpected, isRightOfOpenTag, includeSymbol) {
|
|
155348
|
+
var _a, _b, _c;
|
|
155350
155349
|
let insertText;
|
|
155351
155350
|
let filterText;
|
|
155352
155351
|
let replacementSpan = getReplacementSpanForContextToken(replacementToken);
|
|
@@ -155405,6 +155404,10 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
|
|
|
155405
155404
|
if ((origin == null ? void 0 : origin.kind) === 64 /* TypeOnlyAlias */) {
|
|
155406
155405
|
hasAction = true;
|
|
155407
155406
|
}
|
|
155407
|
+
if (completionKind === 0 /* ObjectPropertyDeclaration */ && contextToken && ((_a = findPrecedingToken(contextToken.pos, sourceFile, contextToken)) == null ? void 0 : _a.kind) !== 28 /* CommaToken */ && ((_b = findNextToken(contextToken, contextToken.parent, sourceFile)) == null ? void 0 : _b.kind) !== 28 /* CommaToken */ && (((_c = findAncestor(contextToken.parent, (node) => isPropertyAssignment(node))) == null ? void 0 : _c.getLastToken()) === contextToken || isMethodDeclaration(contextToken.parent.parent))) {
|
|
155408
|
+
source = "ObjectLiteralMemberWithComma/" /* ObjectLiteralMemberWithComma */;
|
|
155409
|
+
hasAction = true;
|
|
155410
|
+
}
|
|
155408
155411
|
if (preferences.includeCompletionsWithClassMemberSnippets && preferences.includeCompletionsWithInsertText && completionKind === 3 /* MemberLike */ && isClassLikeMemberCompletion(symbol, location, sourceFile)) {
|
|
155409
155412
|
let importAdder;
|
|
155410
155413
|
const memberCompletionEntry = getEntryForMemberCompletion(host, program, options, preferences, name, symbol, location, position, contextToken, formatContext);
|
|
@@ -156135,7 +156138,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
|
|
|
156135
156138
|
return firstDefined(symbols, (symbol, index) => {
|
|
156136
156139
|
const origin = symbolToOriginInfoMap[index];
|
|
156137
156140
|
const info = getCompletionEntryDisplayNameForSymbol(symbol, getEmitScriptTarget(compilerOptions), origin, completionKind, completionData.isJsxIdentifierExpected);
|
|
156138
|
-
return info && info.name === entryId.name && (entryId.source === "ClassMemberSnippet/" /* ClassMemberSnippet */ && symbol.flags & 106500 /* ClassMember */ || entryId.source === "ObjectLiteralMethodSnippet/" /* ObjectLiteralMethodSnippet */ && symbol.flags & (4 /* Property */ | 8192 /* Method */) || getSourceFromOrigin(origin) === entryId.source) ? { type: "symbol", symbol, location, origin, contextToken, previousToken, isJsxInitializer, isTypeOnlyLocation } : void 0;
|
|
156141
|
+
return info && info.name === entryId.name && (entryId.source === "ClassMemberSnippet/" /* ClassMemberSnippet */ && symbol.flags & 106500 /* ClassMember */ || entryId.source === "ObjectLiteralMethodSnippet/" /* ObjectLiteralMethodSnippet */ && symbol.flags & (4 /* Property */ | 8192 /* Method */) || getSourceFromOrigin(origin) === entryId.source || entryId.source === "ObjectLiteralMemberWithComma/" /* ObjectLiteralMemberWithComma */) ? { type: "symbol", symbol, location, origin, contextToken, previousToken, isJsxInitializer, isTypeOnlyLocation } : void 0;
|
|
156139
156142
|
}) || { type: "none" };
|
|
156140
156143
|
}
|
|
156141
156144
|
function getCompletionEntryDetails(program, log, sourceFile, position, entryId, host, formatContext, preferences, cancellationToken) {
|
|
@@ -156280,6 +156283,21 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
|
|
|
156280
156283
|
Debug.assertIsDefined(codeAction2, "Expected to have a code action for promoting type-only alias");
|
|
156281
156284
|
return { codeActions: [codeAction2], sourceDisplay: void 0 };
|
|
156282
156285
|
}
|
|
156286
|
+
if (source === "ObjectLiteralMemberWithComma/" /* ObjectLiteralMemberWithComma */ && contextToken) {
|
|
156287
|
+
const changes = ts_textChanges_exports.ChangeTracker.with(
|
|
156288
|
+
{ host, formatContext, preferences },
|
|
156289
|
+
(tracker) => tracker.insertText(sourceFile, contextToken.end, ",")
|
|
156290
|
+
);
|
|
156291
|
+
if (changes) {
|
|
156292
|
+
return {
|
|
156293
|
+
sourceDisplay: void 0,
|
|
156294
|
+
codeActions: [{
|
|
156295
|
+
changes,
|
|
156296
|
+
description: diagnosticToString([Diagnostics.Add_missing_comma_for_an_object_member_completion_0, name])
|
|
156297
|
+
}]
|
|
156298
|
+
};
|
|
156299
|
+
}
|
|
156300
|
+
}
|
|
156283
156301
|
if (!origin || !(originIsExport(origin) || originIsResolvedExport(origin))) {
|
|
156284
156302
|
return { codeActions: void 0, sourceDisplay: void 0 };
|
|
156285
156303
|
}
|
|
@@ -157673,12 +157691,22 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
|
|
|
157673
157691
|
return parent2;
|
|
157674
157692
|
}
|
|
157675
157693
|
break;
|
|
157694
|
+
case 20 /* CloseBraceToken */:
|
|
157695
|
+
if (parent2.parent && parent2.parent.parent && isMethodDeclaration(parent2.parent) && isObjectLiteralExpression(parent2.parent.parent)) {
|
|
157696
|
+
return parent2.parent.parent;
|
|
157697
|
+
}
|
|
157698
|
+
break;
|
|
157676
157699
|
case 42 /* AsteriskToken */:
|
|
157677
157700
|
return isMethodDeclaration(parent2) ? tryCast(parent2.parent, isObjectLiteralExpression) : void 0;
|
|
157678
157701
|
case 134 /* AsyncKeyword */:
|
|
157679
157702
|
return tryCast(parent2.parent, isObjectLiteralExpression);
|
|
157680
157703
|
case 80 /* Identifier */:
|
|
157681
157704
|
return contextToken.text === "async" && isShorthandPropertyAssignment(contextToken.parent) ? contextToken.parent.parent : void 0;
|
|
157705
|
+
default:
|
|
157706
|
+
const ancestorNode = findAncestor(parent2, (node) => isPropertyAssignment(node));
|
|
157707
|
+
if (contextToken.kind !== 59 /* ColonToken */ && ancestorNode && ancestorNode.getLastToken() === contextToken && isObjectLiteralExpression(ancestorNode.parent)) {
|
|
157708
|
+
return ancestorNode.parent;
|
|
157709
|
+
}
|
|
157682
157710
|
}
|
|
157683
157711
|
}
|
|
157684
157712
|
return void 0;
|
|
@@ -158220,6 +158248,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
|
|
|
158220
158248
|
CompletionSource2["TypeOnlyAlias"] = "TypeOnlyAlias/";
|
|
158221
158249
|
CompletionSource2["ObjectLiteralMethodSnippet"] = "ObjectLiteralMethodSnippet/";
|
|
158222
158250
|
CompletionSource2["SwitchCases"] = "SwitchCases/";
|
|
158251
|
+
CompletionSource2["ObjectLiteralMemberWithComma"] = "ObjectLiteralMemberWithComma/";
|
|
158223
158252
|
return CompletionSource2;
|
|
158224
158253
|
})(CompletionSource || {});
|
|
158225
158254
|
SymbolOriginInfoKind = /* @__PURE__ */ ((SymbolOriginInfoKind2) => {
|
package/lib/typingsInstaller.js
CHANGED
|
@@ -54,7 +54,7 @@ var path = __toESM(require("path"));
|
|
|
54
54
|
|
|
55
55
|
// src/compiler/corePublic.ts
|
|
56
56
|
var versionMajorMinor = "5.2";
|
|
57
|
-
var version = `${versionMajorMinor}.0-insiders.
|
|
57
|
+
var version = `${versionMajorMinor}.0-insiders.20230621`;
|
|
58
58
|
|
|
59
59
|
// src/compiler/core.ts
|
|
60
60
|
var emptyArray = [];
|
|
@@ -7106,6 +7106,7 @@ var Diagnostics = {
|
|
|
7106
7106
|
Inline_variable: diag(95184, 3 /* Message */, "Inline_variable_95184", "Inline variable"),
|
|
7107
7107
|
Could_not_find_variable_to_inline: diag(95185, 3 /* Message */, "Could_not_find_variable_to_inline_95185", "Could not find variable to inline."),
|
|
7108
7108
|
Variables_with_multiple_declarations_cannot_be_inlined: diag(95186, 3 /* Message */, "Variables_with_multiple_declarations_cannot_be_inlined_95186", "Variables with multiple declarations cannot be inlined."),
|
|
7109
|
+
Add_missing_comma_for_an_object_member_completion_0: diag(95187, 3 /* Message */, "Add_missing_comma_for_an_object_member_completion_0_95187", "Add missing comma for an object member completion '{0}'."),
|
|
7109
7110
|
No_value_exists_in_scope_for_the_shorthand_property_0_Either_declare_one_or_provide_an_initializer: diag(18004, 1 /* 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."),
|
|
7110
7111
|
Classes_may_not_have_a_field_named_constructor: diag(18006, 1 /* Error */, "Classes_may_not_have_a_field_named_constructor_18006", "Classes may not have a field named 'constructor'."),
|
|
7111
7112
|
JSX_expressions_may_not_use_the_comma_operator_Did_you_mean_to_write_an_array: diag(18007, 1 /* 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?"),
|
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "@typescript-deploys/pr-build",
|
|
3
3
|
"author": "Microsoft Corp.",
|
|
4
4
|
"homepage": "https://www.typescriptlang.org/",
|
|
5
|
-
"version": "5.2.0-pr-
|
|
5
|
+
"version": "5.2.0-pr-52899-13",
|
|
6
6
|
"license": "Apache-2.0",
|
|
7
7
|
"description": "TypeScript is a language for application scale JavaScript development",
|
|
8
8
|
"keywords": [
|
|
@@ -115,5 +115,5 @@
|
|
|
115
115
|
"node": "20.1.0",
|
|
116
116
|
"npm": "8.19.4"
|
|
117
117
|
},
|
|
118
|
-
"gitHead": "
|
|
118
|
+
"gitHead": "125466225f3ce8d2ae30073da465e3094a93247f"
|
|
119
119
|
}
|