typescript 5.3.0-dev.20231004 → 5.3.0-dev.20231006
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 +42 -13
- package/lib/tsserver.js +57 -20
- package/lib/typescript.js +57 -20
- package/lib/typingsInstaller.js +1 -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.3";
|
|
21
|
-
var version = `${versionMajorMinor}.0-dev.
|
|
21
|
+
var version = `${versionMajorMinor}.0-dev.20231006`;
|
|
22
22
|
|
|
23
23
|
// src/compiler/core.ts
|
|
24
24
|
var emptyArray = [];
|
|
@@ -45518,7 +45518,7 @@ function createTypeChecker(host) {
|
|
|
45518
45518
|
return resolved;
|
|
45519
45519
|
}
|
|
45520
45520
|
function isSyntacticDefault(node) {
|
|
45521
|
-
return isExportAssignment(node) && !node.isExportEquals || hasSyntacticModifier(node, 1024 /* Default */) || isExportSpecifier(node);
|
|
45521
|
+
return isExportAssignment(node) && !node.isExportEquals || hasSyntacticModifier(node, 1024 /* Default */) || isExportSpecifier(node) || isNamespaceExport(node);
|
|
45522
45522
|
}
|
|
45523
45523
|
function getUsageModeForExpression(usage) {
|
|
45524
45524
|
return isStringLiteralLike(usage) ? getModeForUsageLocation(getSourceFileOfNode(usage), usage) : void 0;
|
|
@@ -48476,6 +48476,28 @@ function createTypeChecker(host) {
|
|
|
48476
48476
|
const propertyName = getPropertyNameNodeForSymbol(propertySymbol, context);
|
|
48477
48477
|
context.enclosingDeclaration = saveEnclosingDeclaration;
|
|
48478
48478
|
context.approximateLength += symbolName(propertySymbol).length + 1;
|
|
48479
|
+
if (propertySymbol.flags & 98304 /* Accessor */) {
|
|
48480
|
+
const writeType = getWriteTypeOfSymbol(propertySymbol);
|
|
48481
|
+
if (propertyType !== writeType) {
|
|
48482
|
+
const getterDeclaration = getDeclarationOfKind(propertySymbol, 177 /* GetAccessor */);
|
|
48483
|
+
const getterSignature = getSignatureFromDeclaration(getterDeclaration);
|
|
48484
|
+
typeElements.push(
|
|
48485
|
+
setCommentRange(
|
|
48486
|
+
signatureToSignatureDeclarationHelper(getterSignature, 177 /* GetAccessor */, context, { name: propertyName }),
|
|
48487
|
+
getterDeclaration
|
|
48488
|
+
)
|
|
48489
|
+
);
|
|
48490
|
+
const setterDeclaration = getDeclarationOfKind(propertySymbol, 178 /* SetAccessor */);
|
|
48491
|
+
const setterSignature = getSignatureFromDeclaration(setterDeclaration);
|
|
48492
|
+
typeElements.push(
|
|
48493
|
+
setCommentRange(
|
|
48494
|
+
signatureToSignatureDeclarationHelper(setterSignature, 178 /* SetAccessor */, context, { name: propertyName }),
|
|
48495
|
+
setterDeclaration
|
|
48496
|
+
)
|
|
48497
|
+
);
|
|
48498
|
+
return;
|
|
48499
|
+
}
|
|
48500
|
+
}
|
|
48479
48501
|
const optionalToken = propertySymbol.flags & 16777216 /* Optional */ ? factory.createToken(58 /* QuestionToken */) : void 0;
|
|
48480
48502
|
if (propertySymbol.flags & (16 /* Function */ | 8192 /* Method */) && !getPropertiesOfObjectType(propertyType).length && !isReadonlySymbol(propertySymbol)) {
|
|
48481
48503
|
const signatures = getSignaturesOfType(filterType(propertyType, (t) => !(t.flags & 32768 /* Undefined */)), 0 /* Call */);
|
|
@@ -48513,9 +48535,9 @@ function createTypeChecker(host) {
|
|
|
48513
48535
|
typeElements.push(preserveCommentsOn(propertySignature));
|
|
48514
48536
|
function preserveCommentsOn(node) {
|
|
48515
48537
|
var _a2;
|
|
48516
|
-
|
|
48517
|
-
|
|
48518
|
-
const commentText = getTextOfJSDocComment(
|
|
48538
|
+
const jsdocPropertyTag = (_a2 = propertySymbol.declarations) == null ? void 0 : _a2.find((d) => d.kind === 355 /* JSDocPropertyTag */);
|
|
48539
|
+
if (jsdocPropertyTag) {
|
|
48540
|
+
const commentText = getTextOfJSDocComment(jsdocPropertyTag.comment);
|
|
48519
48541
|
if (commentText) {
|
|
48520
48542
|
setSyntheticLeadingComments(node, [{ kind: 3 /* MultiLineCommentTrivia */, text: "*\n * " + commentText.replace(/\n/g, "\n * ") + "\n ", pos: -1, end: -1, hasTrailingNewLine: true }]);
|
|
48521
48543
|
}
|
|
@@ -50822,7 +50844,15 @@ function createTypeChecker(host) {
|
|
|
50822
50844
|
const ctxSrc = getSourceFileOfNode(context.enclosingDeclaration);
|
|
50823
50845
|
return getObjectFlags(typeToSerialize) & (16 /* Anonymous */ | 32 /* Mapped */) && !length(getIndexInfosOfType(typeToSerialize)) && !isClassInstanceSide(typeToSerialize) && // While a class instance is potentially representable as a NS, prefer printing a reference to the instance type and serializing the class
|
|
50824
50846
|
!!(length(filter(getPropertiesOfType(typeToSerialize), isNamespaceMember)) || length(getSignaturesOfType(typeToSerialize, 0 /* Call */))) && !length(getSignaturesOfType(typeToSerialize, 1 /* Construct */)) && // TODO: could probably serialize as function + ns + class, now that that's OK
|
|
50825
|
-
!getDeclarationWithTypeAnnotation(hostSymbol, enclosingDeclaration) && !(typeToSerialize.symbol && some(typeToSerialize.symbol.declarations, (d) => getSourceFileOfNode(d) !== ctxSrc)) && !some(getPropertiesOfType(typeToSerialize), (p) => isLateBoundName(p.escapedName)) && !some(getPropertiesOfType(typeToSerialize), (p) => some(p.declarations, (d) => getSourceFileOfNode(d) !== ctxSrc)) && every(getPropertiesOfType(typeToSerialize), (p) =>
|
|
50847
|
+
!getDeclarationWithTypeAnnotation(hostSymbol, enclosingDeclaration) && !(typeToSerialize.symbol && some(typeToSerialize.symbol.declarations, (d) => getSourceFileOfNode(d) !== ctxSrc)) && !some(getPropertiesOfType(typeToSerialize), (p) => isLateBoundName(p.escapedName)) && !some(getPropertiesOfType(typeToSerialize), (p) => some(p.declarations, (d) => getSourceFileOfNode(d) !== ctxSrc)) && every(getPropertiesOfType(typeToSerialize), (p) => {
|
|
50848
|
+
if (!isIdentifierText(symbolName(p), languageVersion)) {
|
|
50849
|
+
return false;
|
|
50850
|
+
}
|
|
50851
|
+
if (!(p.flags & 98304 /* Accessor */)) {
|
|
50852
|
+
return true;
|
|
50853
|
+
}
|
|
50854
|
+
return getNonMissingTypeOfSymbol(p) === getWriteTypeOfSymbol(p);
|
|
50855
|
+
});
|
|
50826
50856
|
}
|
|
50827
50857
|
function makeSerializePropertySymbol(createProperty2, methodKind, useAccessors) {
|
|
50828
50858
|
return function serializePropertySymbol(p, isStatic2, baseType) {
|
|
@@ -68831,7 +68861,7 @@ function createTypeChecker(host) {
|
|
|
68831
68861
|
}
|
|
68832
68862
|
}
|
|
68833
68863
|
const parent = openingLikeElement.parent.kind === 284 /* JsxElement */ ? openingLikeElement.parent : void 0;
|
|
68834
|
-
if (parent && parent.openingElement === openingLikeElement && parent.children.length > 0) {
|
|
68864
|
+
if (parent && parent.openingElement === openingLikeElement && getSemanticJsxChildren(parent.children).length > 0) {
|
|
68835
68865
|
const childrenTypes = checkJsxChildren(parent, checkMode);
|
|
68836
68866
|
if (!hasSpreadAnyType && jsxChildrenPropertyName && jsxChildrenPropertyName !== "") {
|
|
68837
68867
|
if (explicitlySpecifyChildrenAttribute) {
|
|
@@ -70454,9 +70484,11 @@ function createTypeChecker(host) {
|
|
|
70454
70484
|
}
|
|
70455
70485
|
if (arg.kind === 237 /* SyntheticExpression */ && arg.tupleNameSource) {
|
|
70456
70486
|
names.push(arg.tupleNameSource);
|
|
70487
|
+
} else {
|
|
70488
|
+
names.push(void 0);
|
|
70457
70489
|
}
|
|
70458
70490
|
}
|
|
70459
|
-
return createTupleType(types, flags, inConstContext && !someType(restType, isMutableArrayLikeType),
|
|
70491
|
+
return createTupleType(types, flags, inConstContext && !someType(restType, isMutableArrayLikeType), names);
|
|
70460
70492
|
}
|
|
70461
70493
|
function checkTypeArguments(signature, typeArgumentNodes, reportErrors2, headMessage) {
|
|
70462
70494
|
const isJavascript = isInJSFile(signature.declaration);
|
|
@@ -72591,12 +72623,9 @@ function createTypeChecker(host) {
|
|
|
72591
72623
|
types.push(restType);
|
|
72592
72624
|
flags.push(8 /* Variadic */);
|
|
72593
72625
|
}
|
|
72594
|
-
|
|
72595
|
-
if (name) {
|
|
72596
|
-
names.push(name);
|
|
72597
|
-
}
|
|
72626
|
+
names.push(getNameableDeclarationAtPosition(source, i));
|
|
72598
72627
|
}
|
|
72599
|
-
return createTupleType(types, flags, readonly,
|
|
72628
|
+
return createTupleType(types, flags, readonly, names);
|
|
72600
72629
|
}
|
|
72601
72630
|
function getParameterCount(signature) {
|
|
72602
72631
|
const length2 = signature.parameters.length;
|
package/lib/tsserver.js
CHANGED
|
@@ -2328,7 +2328,7 @@ module.exports = __toCommonJS(server_exports);
|
|
|
2328
2328
|
|
|
2329
2329
|
// src/compiler/corePublic.ts
|
|
2330
2330
|
var versionMajorMinor = "5.3";
|
|
2331
|
-
var version = `${versionMajorMinor}.0-dev.
|
|
2331
|
+
var version = `${versionMajorMinor}.0-dev.20231006`;
|
|
2332
2332
|
var Comparison = /* @__PURE__ */ ((Comparison3) => {
|
|
2333
2333
|
Comparison3[Comparison3["LessThan"] = -1] = "LessThan";
|
|
2334
2334
|
Comparison3[Comparison3["EqualTo"] = 0] = "EqualTo";
|
|
@@ -50230,7 +50230,7 @@ function createTypeChecker(host) {
|
|
|
50230
50230
|
return resolved;
|
|
50231
50231
|
}
|
|
50232
50232
|
function isSyntacticDefault(node) {
|
|
50233
|
-
return isExportAssignment(node) && !node.isExportEquals || hasSyntacticModifier(node, 1024 /* Default */) || isExportSpecifier(node);
|
|
50233
|
+
return isExportAssignment(node) && !node.isExportEquals || hasSyntacticModifier(node, 1024 /* Default */) || isExportSpecifier(node) || isNamespaceExport(node);
|
|
50234
50234
|
}
|
|
50235
50235
|
function getUsageModeForExpression(usage) {
|
|
50236
50236
|
return isStringLiteralLike(usage) ? getModeForUsageLocation(getSourceFileOfNode(usage), usage) : void 0;
|
|
@@ -53188,6 +53188,28 @@ function createTypeChecker(host) {
|
|
|
53188
53188
|
const propertyName = getPropertyNameNodeForSymbol(propertySymbol, context);
|
|
53189
53189
|
context.enclosingDeclaration = saveEnclosingDeclaration;
|
|
53190
53190
|
context.approximateLength += symbolName(propertySymbol).length + 1;
|
|
53191
|
+
if (propertySymbol.flags & 98304 /* Accessor */) {
|
|
53192
|
+
const writeType = getWriteTypeOfSymbol(propertySymbol);
|
|
53193
|
+
if (propertyType !== writeType) {
|
|
53194
|
+
const getterDeclaration = getDeclarationOfKind(propertySymbol, 177 /* GetAccessor */);
|
|
53195
|
+
const getterSignature = getSignatureFromDeclaration(getterDeclaration);
|
|
53196
|
+
typeElements.push(
|
|
53197
|
+
setCommentRange(
|
|
53198
|
+
signatureToSignatureDeclarationHelper(getterSignature, 177 /* GetAccessor */, context, { name: propertyName }),
|
|
53199
|
+
getterDeclaration
|
|
53200
|
+
)
|
|
53201
|
+
);
|
|
53202
|
+
const setterDeclaration = getDeclarationOfKind(propertySymbol, 178 /* SetAccessor */);
|
|
53203
|
+
const setterSignature = getSignatureFromDeclaration(setterDeclaration);
|
|
53204
|
+
typeElements.push(
|
|
53205
|
+
setCommentRange(
|
|
53206
|
+
signatureToSignatureDeclarationHelper(setterSignature, 178 /* SetAccessor */, context, { name: propertyName }),
|
|
53207
|
+
setterDeclaration
|
|
53208
|
+
)
|
|
53209
|
+
);
|
|
53210
|
+
return;
|
|
53211
|
+
}
|
|
53212
|
+
}
|
|
53191
53213
|
const optionalToken = propertySymbol.flags & 16777216 /* Optional */ ? factory.createToken(58 /* QuestionToken */) : void 0;
|
|
53192
53214
|
if (propertySymbol.flags & (16 /* Function */ | 8192 /* Method */) && !getPropertiesOfObjectType(propertyType).length && !isReadonlySymbol(propertySymbol)) {
|
|
53193
53215
|
const signatures = getSignaturesOfType(filterType(propertyType, (t) => !(t.flags & 32768 /* Undefined */)), 0 /* Call */);
|
|
@@ -53225,9 +53247,9 @@ function createTypeChecker(host) {
|
|
|
53225
53247
|
typeElements.push(preserveCommentsOn(propertySignature));
|
|
53226
53248
|
function preserveCommentsOn(node) {
|
|
53227
53249
|
var _a2;
|
|
53228
|
-
|
|
53229
|
-
|
|
53230
|
-
const commentText = getTextOfJSDocComment(
|
|
53250
|
+
const jsdocPropertyTag = (_a2 = propertySymbol.declarations) == null ? void 0 : _a2.find((d) => d.kind === 355 /* JSDocPropertyTag */);
|
|
53251
|
+
if (jsdocPropertyTag) {
|
|
53252
|
+
const commentText = getTextOfJSDocComment(jsdocPropertyTag.comment);
|
|
53231
53253
|
if (commentText) {
|
|
53232
53254
|
setSyntheticLeadingComments(node, [{ kind: 3 /* MultiLineCommentTrivia */, text: "*\n * " + commentText.replace(/\n/g, "\n * ") + "\n ", pos: -1, end: -1, hasTrailingNewLine: true }]);
|
|
53233
53255
|
}
|
|
@@ -55534,7 +55556,15 @@ function createTypeChecker(host) {
|
|
|
55534
55556
|
const ctxSrc = getSourceFileOfNode(context.enclosingDeclaration);
|
|
55535
55557
|
return getObjectFlags(typeToSerialize) & (16 /* Anonymous */ | 32 /* Mapped */) && !length(getIndexInfosOfType(typeToSerialize)) && !isClassInstanceSide(typeToSerialize) && // While a class instance is potentially representable as a NS, prefer printing a reference to the instance type and serializing the class
|
|
55536
55558
|
!!(length(filter(getPropertiesOfType(typeToSerialize), isNamespaceMember)) || length(getSignaturesOfType(typeToSerialize, 0 /* Call */))) && !length(getSignaturesOfType(typeToSerialize, 1 /* Construct */)) && // TODO: could probably serialize as function + ns + class, now that that's OK
|
|
55537
|
-
!getDeclarationWithTypeAnnotation(hostSymbol, enclosingDeclaration) && !(typeToSerialize.symbol && some(typeToSerialize.symbol.declarations, (d) => getSourceFileOfNode(d) !== ctxSrc)) && !some(getPropertiesOfType(typeToSerialize), (p) => isLateBoundName(p.escapedName)) && !some(getPropertiesOfType(typeToSerialize), (p) => some(p.declarations, (d) => getSourceFileOfNode(d) !== ctxSrc)) && every(getPropertiesOfType(typeToSerialize), (p) =>
|
|
55559
|
+
!getDeclarationWithTypeAnnotation(hostSymbol, enclosingDeclaration) && !(typeToSerialize.symbol && some(typeToSerialize.symbol.declarations, (d) => getSourceFileOfNode(d) !== ctxSrc)) && !some(getPropertiesOfType(typeToSerialize), (p) => isLateBoundName(p.escapedName)) && !some(getPropertiesOfType(typeToSerialize), (p) => some(p.declarations, (d) => getSourceFileOfNode(d) !== ctxSrc)) && every(getPropertiesOfType(typeToSerialize), (p) => {
|
|
55560
|
+
if (!isIdentifierText(symbolName(p), languageVersion)) {
|
|
55561
|
+
return false;
|
|
55562
|
+
}
|
|
55563
|
+
if (!(p.flags & 98304 /* Accessor */)) {
|
|
55564
|
+
return true;
|
|
55565
|
+
}
|
|
55566
|
+
return getNonMissingTypeOfSymbol(p) === getWriteTypeOfSymbol(p);
|
|
55567
|
+
});
|
|
55538
55568
|
}
|
|
55539
55569
|
function makeSerializePropertySymbol(createProperty2, methodKind, useAccessors) {
|
|
55540
55570
|
return function serializePropertySymbol(p, isStatic2, baseType) {
|
|
@@ -73543,7 +73573,7 @@ function createTypeChecker(host) {
|
|
|
73543
73573
|
}
|
|
73544
73574
|
}
|
|
73545
73575
|
const parent2 = openingLikeElement.parent.kind === 284 /* JsxElement */ ? openingLikeElement.parent : void 0;
|
|
73546
|
-
if (parent2 && parent2.openingElement === openingLikeElement && parent2.children.length > 0) {
|
|
73576
|
+
if (parent2 && parent2.openingElement === openingLikeElement && getSemanticJsxChildren(parent2.children).length > 0) {
|
|
73547
73577
|
const childrenTypes = checkJsxChildren(parent2, checkMode);
|
|
73548
73578
|
if (!hasSpreadAnyType && jsxChildrenPropertyName && jsxChildrenPropertyName !== "") {
|
|
73549
73579
|
if (explicitlySpecifyChildrenAttribute) {
|
|
@@ -75166,9 +75196,11 @@ function createTypeChecker(host) {
|
|
|
75166
75196
|
}
|
|
75167
75197
|
if (arg.kind === 237 /* SyntheticExpression */ && arg.tupleNameSource) {
|
|
75168
75198
|
names.push(arg.tupleNameSource);
|
|
75199
|
+
} else {
|
|
75200
|
+
names.push(void 0);
|
|
75169
75201
|
}
|
|
75170
75202
|
}
|
|
75171
|
-
return createTupleType(types, flags, inConstContext && !someType(restType, isMutableArrayLikeType),
|
|
75203
|
+
return createTupleType(types, flags, inConstContext && !someType(restType, isMutableArrayLikeType), names);
|
|
75172
75204
|
}
|
|
75173
75205
|
function checkTypeArguments(signature, typeArgumentNodes, reportErrors2, headMessage) {
|
|
75174
75206
|
const isJavascript = isInJSFile(signature.declaration);
|
|
@@ -77303,12 +77335,9 @@ function createTypeChecker(host) {
|
|
|
77303
77335
|
types.push(restType);
|
|
77304
77336
|
flags.push(8 /* Variadic */);
|
|
77305
77337
|
}
|
|
77306
|
-
|
|
77307
|
-
if (name) {
|
|
77308
|
-
names.push(name);
|
|
77309
|
-
}
|
|
77338
|
+
names.push(getNameableDeclarationAtPosition(source, i));
|
|
77310
77339
|
}
|
|
77311
|
-
return createTupleType(types, flags, readonly,
|
|
77340
|
+
return createTupleType(types, flags, readonly, names);
|
|
77312
77341
|
}
|
|
77313
77342
|
function getParameterCount(signature) {
|
|
77314
77343
|
const length2 = signature.parameters.length;
|
|
@@ -157236,7 +157265,7 @@ function completionInfoFromData(sourceFile, host, program, compilerOptions, log,
|
|
|
157236
157265
|
);
|
|
157237
157266
|
if (keywordFilters !== 0 /* None */) {
|
|
157238
157267
|
for (const keywordEntry of getKeywordCompletions(keywordFilters, !insideJsDocTagTypeExpression && isSourceFileJS(sourceFile))) {
|
|
157239
|
-
if (isTypeOnlyLocation && isTypeKeyword(stringToToken(keywordEntry.name)) || !uniqueNames.has(keywordEntry.name)) {
|
|
157268
|
+
if (isTypeOnlyLocation && isTypeKeyword(stringToToken(keywordEntry.name)) || !isTypeOnlyLocation && isContextualKeywordInAutoImportableExpressionSpace(keywordEntry.name) || !uniqueNames.has(keywordEntry.name)) {
|
|
157240
157269
|
uniqueNames.add(keywordEntry.name);
|
|
157241
157270
|
insertSorted(
|
|
157242
157271
|
entries,
|
|
@@ -160425,6 +160454,9 @@ function toUpperCharCode(charCode) {
|
|
|
160425
160454
|
}
|
|
160426
160455
|
return charCode;
|
|
160427
160456
|
}
|
|
160457
|
+
function isContextualKeywordInAutoImportableExpressionSpace(keyword) {
|
|
160458
|
+
return keyword === "abstract" || keyword === "async" || keyword === "await" || keyword === "declare" || keyword === "module" || keyword === "namespace" || keyword === "type";
|
|
160459
|
+
}
|
|
160428
160460
|
|
|
160429
160461
|
// src/services/_namespaces/ts.Completions.StringCompletions.ts
|
|
160430
160462
|
var ts_Completions_StringCompletions_exports = {};
|
|
@@ -164306,6 +164338,7 @@ function provideInlayHints(context) {
|
|
|
164306
164338
|
const { file, program, span, cancellationToken, preferences } = context;
|
|
164307
164339
|
const sourceFileText = file.text;
|
|
164308
164340
|
const compilerOptions = program.getCompilerOptions();
|
|
164341
|
+
const quotePreference = getQuotePreference(file, preferences);
|
|
164309
164342
|
const checker = program.getTypeChecker();
|
|
164310
164343
|
const result = [];
|
|
164311
164344
|
visitor(file);
|
|
@@ -164613,6 +164646,10 @@ function provideInlayHints(context) {
|
|
|
164613
164646
|
parts.push({ text: tokenString });
|
|
164614
164647
|
return;
|
|
164615
164648
|
}
|
|
164649
|
+
if (isLiteralExpression(node)) {
|
|
164650
|
+
parts.push({ text: getLiteralText2(node) });
|
|
164651
|
+
return;
|
|
164652
|
+
}
|
|
164616
164653
|
switch (node.kind) {
|
|
164617
164654
|
case 80 /* Identifier */:
|
|
164618
164655
|
const identifier = node;
|
|
@@ -164624,12 +164661,6 @@ function provideInlayHints(context) {
|
|
|
164624
164661
|
parts.push({ text: identifierText });
|
|
164625
164662
|
}
|
|
164626
164663
|
break;
|
|
164627
|
-
case 9 /* NumericLiteral */:
|
|
164628
|
-
parts.push({ text: node.text });
|
|
164629
|
-
break;
|
|
164630
|
-
case 11 /* StringLiteral */:
|
|
164631
|
-
parts.push({ text: `"${node.text}"` });
|
|
164632
|
-
break;
|
|
164633
164664
|
case 166 /* QualifiedName */:
|
|
164634
164665
|
const qualifiedName = node;
|
|
164635
164666
|
visitForDisplayParts(qualifiedName.left);
|
|
@@ -164885,6 +164916,12 @@ function provideInlayHints(context) {
|
|
|
164885
164916
|
visitForDisplayParts(node);
|
|
164886
164917
|
});
|
|
164887
164918
|
}
|
|
164919
|
+
function getLiteralText2(node) {
|
|
164920
|
+
if (isStringLiteral(node)) {
|
|
164921
|
+
return quotePreference === 0 /* Single */ ? `'${escapeString(node.text, 39 /* singleQuote */)}'` : `"${escapeString(node.text, 34 /* doubleQuote */)}"`;
|
|
164922
|
+
}
|
|
164923
|
+
return node.text;
|
|
164924
|
+
}
|
|
164888
164925
|
}
|
|
164889
164926
|
function isUndefined(name) {
|
|
164890
164927
|
return name === "undefined";
|
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.3";
|
|
38
|
-
version = `${versionMajorMinor}.0-dev.
|
|
38
|
+
version = `${versionMajorMinor}.0-dev.20231006`;
|
|
39
39
|
Comparison = /* @__PURE__ */ ((Comparison3) => {
|
|
40
40
|
Comparison3[Comparison3["LessThan"] = -1] = "LessThan";
|
|
41
41
|
Comparison3[Comparison3["EqualTo"] = 0] = "EqualTo";
|
|
@@ -47997,7 +47997,7 @@ ${lanes.join("\n")}
|
|
|
47997
47997
|
return resolved;
|
|
47998
47998
|
}
|
|
47999
47999
|
function isSyntacticDefault(node) {
|
|
48000
|
-
return isExportAssignment(node) && !node.isExportEquals || hasSyntacticModifier(node, 1024 /* Default */) || isExportSpecifier(node);
|
|
48000
|
+
return isExportAssignment(node) && !node.isExportEquals || hasSyntacticModifier(node, 1024 /* Default */) || isExportSpecifier(node) || isNamespaceExport(node);
|
|
48001
48001
|
}
|
|
48002
48002
|
function getUsageModeForExpression(usage) {
|
|
48003
48003
|
return isStringLiteralLike(usage) ? getModeForUsageLocation(getSourceFileOfNode(usage), usage) : void 0;
|
|
@@ -50955,6 +50955,28 @@ ${lanes.join("\n")}
|
|
|
50955
50955
|
const propertyName = getPropertyNameNodeForSymbol(propertySymbol, context);
|
|
50956
50956
|
context.enclosingDeclaration = saveEnclosingDeclaration;
|
|
50957
50957
|
context.approximateLength += symbolName(propertySymbol).length + 1;
|
|
50958
|
+
if (propertySymbol.flags & 98304 /* Accessor */) {
|
|
50959
|
+
const writeType = getWriteTypeOfSymbol(propertySymbol);
|
|
50960
|
+
if (propertyType !== writeType) {
|
|
50961
|
+
const getterDeclaration = getDeclarationOfKind(propertySymbol, 177 /* GetAccessor */);
|
|
50962
|
+
const getterSignature = getSignatureFromDeclaration(getterDeclaration);
|
|
50963
|
+
typeElements.push(
|
|
50964
|
+
setCommentRange(
|
|
50965
|
+
signatureToSignatureDeclarationHelper(getterSignature, 177 /* GetAccessor */, context, { name: propertyName }),
|
|
50966
|
+
getterDeclaration
|
|
50967
|
+
)
|
|
50968
|
+
);
|
|
50969
|
+
const setterDeclaration = getDeclarationOfKind(propertySymbol, 178 /* SetAccessor */);
|
|
50970
|
+
const setterSignature = getSignatureFromDeclaration(setterDeclaration);
|
|
50971
|
+
typeElements.push(
|
|
50972
|
+
setCommentRange(
|
|
50973
|
+
signatureToSignatureDeclarationHelper(setterSignature, 178 /* SetAccessor */, context, { name: propertyName }),
|
|
50974
|
+
setterDeclaration
|
|
50975
|
+
)
|
|
50976
|
+
);
|
|
50977
|
+
return;
|
|
50978
|
+
}
|
|
50979
|
+
}
|
|
50958
50980
|
const optionalToken = propertySymbol.flags & 16777216 /* Optional */ ? factory.createToken(58 /* QuestionToken */) : void 0;
|
|
50959
50981
|
if (propertySymbol.flags & (16 /* Function */ | 8192 /* Method */) && !getPropertiesOfObjectType(propertyType).length && !isReadonlySymbol(propertySymbol)) {
|
|
50960
50982
|
const signatures = getSignaturesOfType(filterType(propertyType, (t) => !(t.flags & 32768 /* Undefined */)), 0 /* Call */);
|
|
@@ -50992,9 +51014,9 @@ ${lanes.join("\n")}
|
|
|
50992
51014
|
typeElements.push(preserveCommentsOn(propertySignature));
|
|
50993
51015
|
function preserveCommentsOn(node) {
|
|
50994
51016
|
var _a2;
|
|
50995
|
-
|
|
50996
|
-
|
|
50997
|
-
const commentText = getTextOfJSDocComment(
|
|
51017
|
+
const jsdocPropertyTag = (_a2 = propertySymbol.declarations) == null ? void 0 : _a2.find((d) => d.kind === 355 /* JSDocPropertyTag */);
|
|
51018
|
+
if (jsdocPropertyTag) {
|
|
51019
|
+
const commentText = getTextOfJSDocComment(jsdocPropertyTag.comment);
|
|
50998
51020
|
if (commentText) {
|
|
50999
51021
|
setSyntheticLeadingComments(node, [{ kind: 3 /* MultiLineCommentTrivia */, text: "*\n * " + commentText.replace(/\n/g, "\n * ") + "\n ", pos: -1, end: -1, hasTrailingNewLine: true }]);
|
|
51000
51022
|
}
|
|
@@ -53301,7 +53323,15 @@ ${lanes.join("\n")}
|
|
|
53301
53323
|
const ctxSrc = getSourceFileOfNode(context.enclosingDeclaration);
|
|
53302
53324
|
return getObjectFlags(typeToSerialize) & (16 /* Anonymous */ | 32 /* Mapped */) && !length(getIndexInfosOfType(typeToSerialize)) && !isClassInstanceSide(typeToSerialize) && // While a class instance is potentially representable as a NS, prefer printing a reference to the instance type and serializing the class
|
|
53303
53325
|
!!(length(filter(getPropertiesOfType(typeToSerialize), isNamespaceMember)) || length(getSignaturesOfType(typeToSerialize, 0 /* Call */))) && !length(getSignaturesOfType(typeToSerialize, 1 /* Construct */)) && // TODO: could probably serialize as function + ns + class, now that that's OK
|
|
53304
|
-
!getDeclarationWithTypeAnnotation(hostSymbol, enclosingDeclaration) && !(typeToSerialize.symbol && some(typeToSerialize.symbol.declarations, (d) => getSourceFileOfNode(d) !== ctxSrc)) && !some(getPropertiesOfType(typeToSerialize), (p) => isLateBoundName(p.escapedName)) && !some(getPropertiesOfType(typeToSerialize), (p) => some(p.declarations, (d) => getSourceFileOfNode(d) !== ctxSrc)) && every(getPropertiesOfType(typeToSerialize), (p) =>
|
|
53326
|
+
!getDeclarationWithTypeAnnotation(hostSymbol, enclosingDeclaration) && !(typeToSerialize.symbol && some(typeToSerialize.symbol.declarations, (d) => getSourceFileOfNode(d) !== ctxSrc)) && !some(getPropertiesOfType(typeToSerialize), (p) => isLateBoundName(p.escapedName)) && !some(getPropertiesOfType(typeToSerialize), (p) => some(p.declarations, (d) => getSourceFileOfNode(d) !== ctxSrc)) && every(getPropertiesOfType(typeToSerialize), (p) => {
|
|
53327
|
+
if (!isIdentifierText(symbolName(p), languageVersion)) {
|
|
53328
|
+
return false;
|
|
53329
|
+
}
|
|
53330
|
+
if (!(p.flags & 98304 /* Accessor */)) {
|
|
53331
|
+
return true;
|
|
53332
|
+
}
|
|
53333
|
+
return getNonMissingTypeOfSymbol(p) === getWriteTypeOfSymbol(p);
|
|
53334
|
+
});
|
|
53305
53335
|
}
|
|
53306
53336
|
function makeSerializePropertySymbol(createProperty2, methodKind, useAccessors) {
|
|
53307
53337
|
return function serializePropertySymbol(p, isStatic2, baseType) {
|
|
@@ -71310,7 +71340,7 @@ ${lanes.join("\n")}
|
|
|
71310
71340
|
}
|
|
71311
71341
|
}
|
|
71312
71342
|
const parent2 = openingLikeElement.parent.kind === 284 /* JsxElement */ ? openingLikeElement.parent : void 0;
|
|
71313
|
-
if (parent2 && parent2.openingElement === openingLikeElement && parent2.children.length > 0) {
|
|
71343
|
+
if (parent2 && parent2.openingElement === openingLikeElement && getSemanticJsxChildren(parent2.children).length > 0) {
|
|
71314
71344
|
const childrenTypes = checkJsxChildren(parent2, checkMode);
|
|
71315
71345
|
if (!hasSpreadAnyType && jsxChildrenPropertyName && jsxChildrenPropertyName !== "") {
|
|
71316
71346
|
if (explicitlySpecifyChildrenAttribute) {
|
|
@@ -72933,9 +72963,11 @@ ${lanes.join("\n")}
|
|
|
72933
72963
|
}
|
|
72934
72964
|
if (arg.kind === 237 /* SyntheticExpression */ && arg.tupleNameSource) {
|
|
72935
72965
|
names.push(arg.tupleNameSource);
|
|
72966
|
+
} else {
|
|
72967
|
+
names.push(void 0);
|
|
72936
72968
|
}
|
|
72937
72969
|
}
|
|
72938
|
-
return createTupleType(types, flags, inConstContext && !someType(restType, isMutableArrayLikeType),
|
|
72970
|
+
return createTupleType(types, flags, inConstContext && !someType(restType, isMutableArrayLikeType), names);
|
|
72939
72971
|
}
|
|
72940
72972
|
function checkTypeArguments(signature, typeArgumentNodes, reportErrors2, headMessage) {
|
|
72941
72973
|
const isJavascript = isInJSFile(signature.declaration);
|
|
@@ -75070,12 +75102,9 @@ ${lanes.join("\n")}
|
|
|
75070
75102
|
types.push(restType);
|
|
75071
75103
|
flags.push(8 /* Variadic */);
|
|
75072
75104
|
}
|
|
75073
|
-
|
|
75074
|
-
if (name) {
|
|
75075
|
-
names.push(name);
|
|
75076
|
-
}
|
|
75105
|
+
names.push(getNameableDeclarationAtPosition(source, i));
|
|
75077
75106
|
}
|
|
75078
|
-
return createTupleType(types, flags, readonly,
|
|
75107
|
+
return createTupleType(types, flags, readonly, names);
|
|
75079
75108
|
}
|
|
75080
75109
|
function getParameterCount(signature) {
|
|
75081
75110
|
const length2 = signature.parameters.length;
|
|
@@ -156460,7 +156489,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
|
|
|
156460
156489
|
);
|
|
156461
156490
|
if (keywordFilters !== 0 /* None */) {
|
|
156462
156491
|
for (const keywordEntry of getKeywordCompletions(keywordFilters, !insideJsDocTagTypeExpression && isSourceFileJS(sourceFile))) {
|
|
156463
|
-
if (isTypeOnlyLocation && isTypeKeyword(stringToToken(keywordEntry.name)) || !uniqueNames.has(keywordEntry.name)) {
|
|
156492
|
+
if (isTypeOnlyLocation && isTypeKeyword(stringToToken(keywordEntry.name)) || !isTypeOnlyLocation && isContextualKeywordInAutoImportableExpressionSpace(keywordEntry.name) || !uniqueNames.has(keywordEntry.name)) {
|
|
156464
156493
|
uniqueNames.add(keywordEntry.name);
|
|
156465
156494
|
insertSorted(
|
|
156466
156495
|
entries,
|
|
@@ -159627,6 +159656,9 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
|
|
|
159627
159656
|
}
|
|
159628
159657
|
return charCode;
|
|
159629
159658
|
}
|
|
159659
|
+
function isContextualKeywordInAutoImportableExpressionSpace(keyword) {
|
|
159660
|
+
return keyword === "abstract" || keyword === "async" || keyword === "await" || keyword === "declare" || keyword === "module" || keyword === "namespace" || keyword === "type";
|
|
159661
|
+
}
|
|
159630
159662
|
var moduleSpecifierResolutionLimit, moduleSpecifierResolutionCacheAttemptLimit, SortText, CompletionSource, SymbolOriginInfoKind, CompletionKind, _keywordCompletions, allKeywordsCompletions;
|
|
159631
159663
|
var init_completions = __esm({
|
|
159632
159664
|
"src/services/completions.ts"() {
|
|
@@ -163651,6 +163683,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
|
|
|
163651
163683
|
const { file, program, span, cancellationToken, preferences } = context;
|
|
163652
163684
|
const sourceFileText = file.text;
|
|
163653
163685
|
const compilerOptions = program.getCompilerOptions();
|
|
163686
|
+
const quotePreference = getQuotePreference(file, preferences);
|
|
163654
163687
|
const checker = program.getTypeChecker();
|
|
163655
163688
|
const result = [];
|
|
163656
163689
|
visitor(file);
|
|
@@ -163958,6 +163991,10 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
|
|
|
163958
163991
|
parts.push({ text: tokenString });
|
|
163959
163992
|
return;
|
|
163960
163993
|
}
|
|
163994
|
+
if (isLiteralExpression(node)) {
|
|
163995
|
+
parts.push({ text: getLiteralText2(node) });
|
|
163996
|
+
return;
|
|
163997
|
+
}
|
|
163961
163998
|
switch (node.kind) {
|
|
163962
163999
|
case 80 /* Identifier */:
|
|
163963
164000
|
const identifier = node;
|
|
@@ -163969,12 +164006,6 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
|
|
|
163969
164006
|
parts.push({ text: identifierText });
|
|
163970
164007
|
}
|
|
163971
164008
|
break;
|
|
163972
|
-
case 9 /* NumericLiteral */:
|
|
163973
|
-
parts.push({ text: node.text });
|
|
163974
|
-
break;
|
|
163975
|
-
case 11 /* StringLiteral */:
|
|
163976
|
-
parts.push({ text: `"${node.text}"` });
|
|
163977
|
-
break;
|
|
163978
164009
|
case 166 /* QualifiedName */:
|
|
163979
164010
|
const qualifiedName = node;
|
|
163980
164011
|
visitForDisplayParts(qualifiedName.left);
|
|
@@ -164230,6 +164261,12 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
|
|
|
164230
164261
|
visitForDisplayParts(node);
|
|
164231
164262
|
});
|
|
164232
164263
|
}
|
|
164264
|
+
function getLiteralText2(node) {
|
|
164265
|
+
if (isStringLiteral(node)) {
|
|
164266
|
+
return quotePreference === 0 /* Single */ ? `'${escapeString(node.text, 39 /* singleQuote */)}'` : `"${escapeString(node.text, 34 /* doubleQuote */)}"`;
|
|
164267
|
+
}
|
|
164268
|
+
return node.text;
|
|
164269
|
+
}
|
|
164233
164270
|
}
|
|
164234
164271
|
function isUndefined(name) {
|
|
164235
164272
|
return name === "undefined";
|
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.3";
|
|
57
|
-
var version = `${versionMajorMinor}.0-dev.
|
|
57
|
+
var version = `${versionMajorMinor}.0-dev.20231006`;
|
|
58
58
|
|
|
59
59
|
// src/compiler/core.ts
|
|
60
60
|
var emptyArray = [];
|
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "typescript",
|
|
3
3
|
"author": "Microsoft Corp.",
|
|
4
4
|
"homepage": "https://www.typescriptlang.org/",
|
|
5
|
-
"version": "5.3.0-dev.
|
|
5
|
+
"version": "5.3.0-dev.20231006",
|
|
6
6
|
"license": "Apache-2.0",
|
|
7
7
|
"description": "TypeScript is a language for application scale JavaScript development",
|
|
8
8
|
"keywords": [
|
|
@@ -113,5 +113,5 @@
|
|
|
113
113
|
"node": "20.1.0",
|
|
114
114
|
"npm": "8.19.4"
|
|
115
115
|
},
|
|
116
|
-
"gitHead": "
|
|
116
|
+
"gitHead": "2e58032f067fbe0d6efbdc970b54b6d72c349aa8"
|
|
117
117
|
}
|