typescript 5.0.0-dev.20230217 → 5.0.0-dev.20230219
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 +134 -66
- package/lib/tsserver.js +156 -73
- package/lib/tsserverlibrary.js +156 -73
- package/lib/typescript.js +156 -73
- package/lib/typingsInstaller.js +40 -44
- package/package.json +1 -1
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.0";
|
|
38
|
-
version = `${versionMajorMinor}.0-dev.
|
|
38
|
+
version = `${versionMajorMinor}.0-dev.20230219`;
|
|
39
39
|
Comparison = /* @__PURE__ */ ((Comparison3) => {
|
|
40
40
|
Comparison3[Comparison3["LessThan"] = -1] = "LessThan";
|
|
41
41
|
Comparison3[Comparison3["EqualTo"] = 0] = "EqualTo";
|
|
@@ -9616,18 +9616,18 @@ ${lanes.join("\n")}
|
|
|
9616
9616
|
return true;
|
|
9617
9617
|
}
|
|
9618
9618
|
function createScanner(languageVersion, skipTrivia2, languageVariant = 0 /* Standard */, textInitial, onError, start, length2) {
|
|
9619
|
-
|
|
9620
|
-
|
|
9621
|
-
|
|
9622
|
-
|
|
9623
|
-
|
|
9624
|
-
|
|
9625
|
-
|
|
9626
|
-
|
|
9627
|
-
|
|
9628
|
-
|
|
9619
|
+
var text = textInitial;
|
|
9620
|
+
var pos;
|
|
9621
|
+
var end;
|
|
9622
|
+
var startPos;
|
|
9623
|
+
var tokenPos;
|
|
9624
|
+
var token;
|
|
9625
|
+
var tokenValue;
|
|
9626
|
+
var tokenFlags;
|
|
9627
|
+
var commentDirectives;
|
|
9628
|
+
var inJSDocType = 0;
|
|
9629
9629
|
setText(text, start, length2);
|
|
9630
|
-
|
|
9630
|
+
var scanner2 = {
|
|
9631
9631
|
getStartPos: () => startPos,
|
|
9632
9632
|
getTextPos: () => pos,
|
|
9633
9633
|
getToken: () => token,
|
|
@@ -28464,22 +28464,22 @@ ${lanes.join("\n")}
|
|
|
28464
28464
|
[356 /* PartiallyEmittedExpression */]: forEachChildInPartiallyEmittedExpression
|
|
28465
28465
|
};
|
|
28466
28466
|
((Parser2) => {
|
|
28467
|
-
|
|
28467
|
+
var scanner2 = createScanner(
|
|
28468
28468
|
99 /* Latest */,
|
|
28469
28469
|
/*skipTrivia*/
|
|
28470
28470
|
true
|
|
28471
28471
|
);
|
|
28472
|
-
|
|
28473
|
-
|
|
28474
|
-
|
|
28475
|
-
|
|
28476
|
-
|
|
28477
|
-
|
|
28472
|
+
var disallowInAndDecoratorContext = 4096 /* DisallowInContext */ | 16384 /* DecoratorContext */;
|
|
28473
|
+
var NodeConstructor2;
|
|
28474
|
+
var TokenConstructor2;
|
|
28475
|
+
var IdentifierConstructor2;
|
|
28476
|
+
var PrivateIdentifierConstructor2;
|
|
28477
|
+
var SourceFileConstructor2;
|
|
28478
28478
|
function countNode(node) {
|
|
28479
28479
|
nodeCount++;
|
|
28480
28480
|
return node;
|
|
28481
28481
|
}
|
|
28482
|
-
|
|
28482
|
+
var baseNodeFactory = {
|
|
28483
28483
|
createBaseSourceFileNode: (kind) => countNode(new SourceFileConstructor2(
|
|
28484
28484
|
kind,
|
|
28485
28485
|
/*pos*/
|
|
@@ -28516,25 +28516,25 @@ ${lanes.join("\n")}
|
|
|
28516
28516
|
0
|
|
28517
28517
|
))
|
|
28518
28518
|
};
|
|
28519
|
-
|
|
28520
|
-
|
|
28521
|
-
|
|
28522
|
-
|
|
28523
|
-
|
|
28524
|
-
|
|
28525
|
-
|
|
28526
|
-
|
|
28527
|
-
|
|
28528
|
-
|
|
28529
|
-
|
|
28530
|
-
|
|
28531
|
-
|
|
28532
|
-
|
|
28533
|
-
|
|
28534
|
-
|
|
28535
|
-
|
|
28536
|
-
|
|
28537
|
-
|
|
28519
|
+
var factory2 = createNodeFactory(1 /* NoParenthesizerRules */ | 2 /* NoNodeConverters */ | 8 /* NoOriginalNode */, baseNodeFactory);
|
|
28520
|
+
var fileName;
|
|
28521
|
+
var sourceFlags;
|
|
28522
|
+
var sourceText;
|
|
28523
|
+
var languageVersion;
|
|
28524
|
+
var scriptKind;
|
|
28525
|
+
var languageVariant;
|
|
28526
|
+
var parseDiagnostics;
|
|
28527
|
+
var jsDocDiagnostics;
|
|
28528
|
+
var syntaxCursor;
|
|
28529
|
+
var currentToken;
|
|
28530
|
+
var nodeCount;
|
|
28531
|
+
var identifiers;
|
|
28532
|
+
var identifierCount;
|
|
28533
|
+
var parsingContext;
|
|
28534
|
+
var notParenthesizedArrow;
|
|
28535
|
+
var contextFlags;
|
|
28536
|
+
var topLevel = true;
|
|
28537
|
+
var parseErrorBeforeNextFinishedNode = false;
|
|
28538
28538
|
function parseSourceFile(fileName2, sourceText2, languageVersion2, syntaxCursor2, setParentNodes = false, scriptKind2, setExternalModuleIndicatorOverride) {
|
|
28539
28539
|
var _a2;
|
|
28540
28540
|
scriptKind2 = ensureScriptKind(fileName2, scriptKind2);
|
|
@@ -32041,13 +32041,9 @@ ${lanes.join("\n")}
|
|
|
32041
32041
|
function parseJsxClosingFragment(inExpressionContext) {
|
|
32042
32042
|
const pos = getNodePos();
|
|
32043
32043
|
parseExpected(30 /* LessThanSlashToken */);
|
|
32044
|
-
if (tokenIsIdentifierOrKeyword(token())) {
|
|
32045
|
-
parseErrorAtRange(parseJsxElementName(), Diagnostics.Expected_corresponding_closing_tag_for_JSX_fragment);
|
|
32046
|
-
}
|
|
32047
32044
|
if (parseExpected(
|
|
32048
32045
|
31 /* GreaterThanToken */,
|
|
32049
|
-
|
|
32050
|
-
void 0,
|
|
32046
|
+
Diagnostics.Expected_corresponding_closing_tag_for_JSX_fragment,
|
|
32051
32047
|
/*shouldAdvance*/
|
|
32052
32048
|
false
|
|
32053
32049
|
)) {
|
|
@@ -49707,7 +49703,7 @@ ${lanes.join("\n")}
|
|
|
49707
49703
|
return result;
|
|
49708
49704
|
}
|
|
49709
49705
|
function createAnonymousTypeNode(type2) {
|
|
49710
|
-
var _a3;
|
|
49706
|
+
var _a3, _b2;
|
|
49711
49707
|
const typeId = type2.id;
|
|
49712
49708
|
const symbol = type2.symbol;
|
|
49713
49709
|
if (symbol) {
|
|
@@ -49733,6 +49729,20 @@ ${lanes.join("\n")}
|
|
|
49733
49729
|
return visitAndTransformType(type2, createTypeNodeFromObjectType);
|
|
49734
49730
|
}
|
|
49735
49731
|
} else {
|
|
49732
|
+
const isInstantiationExpressionType = !!(getObjectFlags(type2) & 8388608 /* InstantiationExpressionType */);
|
|
49733
|
+
if (isInstantiationExpressionType) {
|
|
49734
|
+
const instantiationExpressionType = type2;
|
|
49735
|
+
if (isTypeQueryNode(instantiationExpressionType.node)) {
|
|
49736
|
+
const typeNode = serializeExistingTypeNode(context, instantiationExpressionType.node);
|
|
49737
|
+
if (typeNode) {
|
|
49738
|
+
return typeNode;
|
|
49739
|
+
}
|
|
49740
|
+
}
|
|
49741
|
+
if ((_b2 = context.visitedTypes) == null ? void 0 : _b2.has(typeId)) {
|
|
49742
|
+
return createElidedInformationPlaceholder(context);
|
|
49743
|
+
}
|
|
49744
|
+
return visitAndTransformType(type2, createTypeNodeFromObjectType);
|
|
49745
|
+
}
|
|
49736
49746
|
return createTypeNodeFromObjectType(type2);
|
|
49737
49747
|
}
|
|
49738
49748
|
function shouldWriteTypeOfFunctionSymbol() {
|
|
@@ -50241,7 +50251,7 @@ ${lanes.join("\n")}
|
|
|
50241
50251
|
);
|
|
50242
50252
|
}
|
|
50243
50253
|
function signatureToSignatureDeclarationHelper(signature, kind, context, options) {
|
|
50244
|
-
var _a2, _b, _c, _d;
|
|
50254
|
+
var _a2, _b, _c, _d, _e;
|
|
50245
50255
|
const suppressAny = context.flags & 256 /* SuppressAnyReturnType */;
|
|
50246
50256
|
if (suppressAny)
|
|
50247
50257
|
context.flags &= ~256 /* SuppressAnyReturnType */;
|
|
@@ -50258,6 +50268,39 @@ ${lanes.join("\n")}
|
|
|
50258
50268
|
/*skipUnionExpanding*/
|
|
50259
50269
|
true
|
|
50260
50270
|
)[0];
|
|
50271
|
+
let cleanup;
|
|
50272
|
+
if (context.enclosingDeclaration && signature.declaration && signature.declaration !== context.enclosingDeclaration && !isInJSFile(signature.declaration) && some(expandedParams)) {
|
|
50273
|
+
const existingFakeScope = getNodeLinks(context.enclosingDeclaration).fakeScopeForSignatureDeclaration ? context.enclosingDeclaration : void 0;
|
|
50274
|
+
Debug.assertOptionalNode(existingFakeScope, isBlock);
|
|
50275
|
+
const locals = (_a2 = existingFakeScope == null ? void 0 : existingFakeScope.locals) != null ? _a2 : createSymbolTable();
|
|
50276
|
+
let newLocals;
|
|
50277
|
+
for (const param of expandedParams) {
|
|
50278
|
+
if (!locals.has(param.escapedName)) {
|
|
50279
|
+
newLocals = append(newLocals, param.escapedName);
|
|
50280
|
+
locals.set(param.escapedName, param);
|
|
50281
|
+
}
|
|
50282
|
+
}
|
|
50283
|
+
if (newLocals) {
|
|
50284
|
+
let removeNewLocals2 = function() {
|
|
50285
|
+
forEach(newLocals, (s) => locals.delete(s));
|
|
50286
|
+
};
|
|
50287
|
+
var removeNewLocals = removeNewLocals2;
|
|
50288
|
+
if (existingFakeScope) {
|
|
50289
|
+
cleanup = removeNewLocals2;
|
|
50290
|
+
} else {
|
|
50291
|
+
const fakeScope = parseNodeFactory.createBlock(emptyArray);
|
|
50292
|
+
getNodeLinks(fakeScope).fakeScopeForSignatureDeclaration = true;
|
|
50293
|
+
fakeScope.locals = locals;
|
|
50294
|
+
const saveEnclosingDeclaration = context.enclosingDeclaration;
|
|
50295
|
+
setParent(fakeScope, saveEnclosingDeclaration);
|
|
50296
|
+
context.enclosingDeclaration = fakeScope;
|
|
50297
|
+
cleanup = () => {
|
|
50298
|
+
context.enclosingDeclaration = saveEnclosingDeclaration;
|
|
50299
|
+
removeNewLocals2();
|
|
50300
|
+
};
|
|
50301
|
+
}
|
|
50302
|
+
}
|
|
50303
|
+
}
|
|
50261
50304
|
const parameters = (some(expandedParams, (p) => p !== expandedParams[expandedParams.length - 1] && !!(getCheckFlags(p) & 32768 /* RestParameter */)) ? signature.parameters : expandedParams).map((parameter) => symbolToParameterDeclaration(parameter, context, kind === 173 /* Constructor */, options == null ? void 0 : options.privateSymbolVisitor, options == null ? void 0 : options.bundledImports));
|
|
50262
50305
|
const thisParameter = context.flags & 33554432 /* OmitThisParameter */ ? void 0 : tryGetThisParameterDeclaration(signature, context);
|
|
50263
50306
|
if (thisParameter) {
|
|
@@ -50283,11 +50326,11 @@ ${lanes.join("\n")}
|
|
|
50283
50326
|
const flags = modifiersToFlags(modifiers);
|
|
50284
50327
|
modifiers = factory.createModifiersFromModifierFlags(flags | 256 /* Abstract */);
|
|
50285
50328
|
}
|
|
50286
|
-
const node = kind === 176 /* CallSignature */ ? factory.createCallSignature(typeParameters, parameters, returnTypeNode) : kind === 177 /* ConstructSignature */ ? factory.createConstructSignature(typeParameters, parameters, returnTypeNode) : kind === 170 /* MethodSignature */ ? factory.createMethodSignature(modifiers, (
|
|
50329
|
+
const node = kind === 176 /* CallSignature */ ? factory.createCallSignature(typeParameters, parameters, returnTypeNode) : kind === 177 /* ConstructSignature */ ? factory.createConstructSignature(typeParameters, parameters, returnTypeNode) : kind === 170 /* MethodSignature */ ? factory.createMethodSignature(modifiers, (_b = options == null ? void 0 : options.name) != null ? _b : factory.createIdentifier(""), options == null ? void 0 : options.questionToken, typeParameters, parameters, returnTypeNode) : kind === 171 /* MethodDeclaration */ ? factory.createMethodDeclaration(
|
|
50287
50330
|
modifiers,
|
|
50288
50331
|
/*asteriskToken*/
|
|
50289
50332
|
void 0,
|
|
50290
|
-
(
|
|
50333
|
+
(_c = options == null ? void 0 : options.name) != null ? _c : factory.createIdentifier(""),
|
|
50291
50334
|
/*questionToken*/
|
|
50292
50335
|
void 0,
|
|
50293
50336
|
typeParameters,
|
|
@@ -50302,14 +50345,14 @@ ${lanes.join("\n")}
|
|
|
50302
50345
|
void 0
|
|
50303
50346
|
) : kind === 174 /* GetAccessor */ ? factory.createGetAccessorDeclaration(
|
|
50304
50347
|
modifiers,
|
|
50305
|
-
(
|
|
50348
|
+
(_d = options == null ? void 0 : options.name) != null ? _d : factory.createIdentifier(""),
|
|
50306
50349
|
parameters,
|
|
50307
50350
|
returnTypeNode,
|
|
50308
50351
|
/*body*/
|
|
50309
50352
|
void 0
|
|
50310
50353
|
) : kind === 175 /* SetAccessor */ ? factory.createSetAccessorDeclaration(
|
|
50311
50354
|
modifiers,
|
|
50312
|
-
(
|
|
50355
|
+
(_e = options == null ? void 0 : options.name) != null ? _e : factory.createIdentifier(""),
|
|
50313
50356
|
parameters,
|
|
50314
50357
|
/*body*/
|
|
50315
50358
|
void 0
|
|
@@ -50344,6 +50387,7 @@ ${lanes.join("\n")}
|
|
|
50344
50387
|
if (typeArguments) {
|
|
50345
50388
|
node.typeArguments = factory.createNodeArray(typeArguments);
|
|
50346
50389
|
}
|
|
50390
|
+
cleanup == null ? void 0 : cleanup();
|
|
50347
50391
|
return node;
|
|
50348
50392
|
}
|
|
50349
50393
|
function tryGetThisParameterDeclaration(signature, context) {
|
|
@@ -50958,9 +51002,12 @@ ${lanes.join("\n")}
|
|
|
50958
51002
|
function existingTypeNodeIsNotReferenceOrIsReferenceWithCompatibleTypeArgumentCount(existing, type) {
|
|
50959
51003
|
return !(getObjectFlags(type) & 4 /* Reference */) || !isTypeReferenceNode(existing) || length(existing.typeArguments) >= getMinTypeArgumentCount(type.target.typeParameters);
|
|
50960
51004
|
}
|
|
51005
|
+
function getEnclosingDeclarationIgnoringFakeScope(enclosingDeclaration) {
|
|
51006
|
+
return getNodeLinks(enclosingDeclaration).fakeScopeForSignatureDeclaration ? enclosingDeclaration.parent : enclosingDeclaration;
|
|
51007
|
+
}
|
|
50961
51008
|
function serializeTypeForDeclaration(context, type, symbol, enclosingDeclaration, includePrivateSymbol, bundled) {
|
|
50962
51009
|
if (!isErrorType(type) && enclosingDeclaration) {
|
|
50963
|
-
const declWithExistingAnnotation = getDeclarationWithTypeAnnotation(symbol, enclosingDeclaration);
|
|
51010
|
+
const declWithExistingAnnotation = getDeclarationWithTypeAnnotation(symbol, getEnclosingDeclarationIgnoringFakeScope(enclosingDeclaration));
|
|
50964
51011
|
if (declWithExistingAnnotation && !isFunctionLikeDeclaration(declWithExistingAnnotation) && !isGetAccessorDeclaration(declWithExistingAnnotation)) {
|
|
50965
51012
|
const existing = getEffectiveTypeAnnotationNode(declWithExistingAnnotation);
|
|
50966
51013
|
if (typeNodeIsEquivalentToType(existing, declWithExistingAnnotation, type) && existingTypeNodeIsNotReferenceOrIsReferenceWithCompatibleTypeArgumentCount(existing, type)) {
|
|
@@ -50992,7 +51039,8 @@ ${lanes.join("\n")}
|
|
|
50992
51039
|
function serializeReturnTypeForSignature(context, type, signature, includePrivateSymbol, bundled) {
|
|
50993
51040
|
if (!isErrorType(type) && context.enclosingDeclaration) {
|
|
50994
51041
|
const annotation = signature.declaration && getEffectiveReturnTypeNode(signature.declaration);
|
|
50995
|
-
|
|
51042
|
+
const enclosingDeclarationIgnoringFakeScope = getEnclosingDeclarationIgnoringFakeScope(context.enclosingDeclaration);
|
|
51043
|
+
if (!!findAncestor(annotation, (n) => n === enclosingDeclarationIgnoringFakeScope) && annotation) {
|
|
50996
51044
|
const annotated = getTypeFromTypeNode(annotation);
|
|
50997
51045
|
const thisInstantiated = annotated.flags & 262144 /* TypeParameter */ && annotated.isThisType ? instantiateType(annotated, signature.mapper) : annotated;
|
|
50998
51046
|
if (thisInstantiated === type && existingTypeNodeIsNotReferenceOrIsReferenceWithCompatibleTypeArgumentCount(annotation, type)) {
|
|
@@ -64294,7 +64342,7 @@ ${lanes.join("\n")}
|
|
|
64294
64342
|
const restType = getRestTypeOfTupleType(type);
|
|
64295
64343
|
return restType && createArrayType(restType);
|
|
64296
64344
|
}
|
|
64297
|
-
function getElementTypeOfSliceOfTupleType(type, index, endSkipCount = 0, writing = false) {
|
|
64345
|
+
function getElementTypeOfSliceOfTupleType(type, index, endSkipCount = 0, writing = false, noReductions = false) {
|
|
64298
64346
|
const length2 = getTypeReferenceArity(type) - endSkipCount;
|
|
64299
64347
|
if (index < length2) {
|
|
64300
64348
|
const typeArguments = getTypeArguments(type);
|
|
@@ -64303,7 +64351,7 @@ ${lanes.join("\n")}
|
|
|
64303
64351
|
const t = typeArguments[i];
|
|
64304
64352
|
elementTypes.push(type.target.elementFlags[i] & 8 /* Variadic */ ? getIndexedAccessType(t, numberType) : t);
|
|
64305
64353
|
}
|
|
64306
|
-
return writing ? getIntersectionType(elementTypes) : getUnionType(elementTypes);
|
|
64354
|
+
return writing ? getIntersectionType(elementTypes) : getUnionType(elementTypes, noReductions ? 0 /* None */ : 1 /* Literal */);
|
|
64307
64355
|
}
|
|
64308
64356
|
return void 0;
|
|
64309
64357
|
}
|
|
@@ -68890,9 +68938,18 @@ ${lanes.join("\n")}
|
|
|
68890
68938
|
if (prop) {
|
|
68891
68939
|
return isCircularMappedProperty(prop) ? void 0 : getTypeOfSymbol(prop);
|
|
68892
68940
|
}
|
|
68893
|
-
if (isTupleType(t)) {
|
|
68894
|
-
const restType =
|
|
68895
|
-
|
|
68941
|
+
if (isTupleType(t) && isNumericLiteralName(name) && +name >= 0) {
|
|
68942
|
+
const restType = getElementTypeOfSliceOfTupleType(
|
|
68943
|
+
t,
|
|
68944
|
+
t.target.fixedLength,
|
|
68945
|
+
/*endSkipCount*/
|
|
68946
|
+
0,
|
|
68947
|
+
/*writing*/
|
|
68948
|
+
false,
|
|
68949
|
+
/*noReductions*/
|
|
68950
|
+
true
|
|
68951
|
+
);
|
|
68952
|
+
if (restType) {
|
|
68896
68953
|
return restType;
|
|
68897
68954
|
}
|
|
68898
68955
|
}
|
|
@@ -68939,9 +68996,18 @@ ${lanes.join("\n")}
|
|
|
68939
68996
|
return void 0;
|
|
68940
68997
|
}
|
|
68941
68998
|
function getContextualTypeForElementExpression(arrayContextualType, index) {
|
|
68942
|
-
return arrayContextualType && (getTypeOfPropertyOfContextualType(arrayContextualType, "" + index) || mapType(
|
|
68999
|
+
return arrayContextualType && (index >= 0 && getTypeOfPropertyOfContextualType(arrayContextualType, "" + index) || mapType(
|
|
68943
69000
|
arrayContextualType,
|
|
68944
|
-
(t) =>
|
|
69001
|
+
(t) => isTupleType(t) ? getElementTypeOfSliceOfTupleType(
|
|
69002
|
+
t,
|
|
69003
|
+
0,
|
|
69004
|
+
/*endSkipCount*/
|
|
69005
|
+
0,
|
|
69006
|
+
/*writing*/
|
|
69007
|
+
false,
|
|
69008
|
+
/*noReductions*/
|
|
69009
|
+
true
|
|
69010
|
+
) : getIteratedTypeOrElementType(
|
|
68945
69011
|
1 /* Element */,
|
|
68946
69012
|
t,
|
|
68947
69013
|
undefinedType,
|
|
@@ -69094,6 +69160,7 @@ ${lanes.join("\n")}
|
|
|
69094
69160
|
return type;
|
|
69095
69161
|
}
|
|
69096
69162
|
function getContextualType2(node, contextFlags) {
|
|
69163
|
+
var _a2, _b;
|
|
69097
69164
|
if (node.flags & 33554432 /* InWithStatement */) {
|
|
69098
69165
|
return void 0;
|
|
69099
69166
|
}
|
|
@@ -69138,7 +69205,9 @@ ${lanes.join("\n")}
|
|
|
69138
69205
|
case 206 /* ArrayLiteralExpression */: {
|
|
69139
69206
|
const arrayLiteral = parent2;
|
|
69140
69207
|
const type = getApparentTypeOfContextualType(arrayLiteral, contextFlags);
|
|
69141
|
-
|
|
69208
|
+
const spreadIndex = (_b = (_a2 = getNodeLinks(arrayLiteral)).firstSpreadIndex) != null ? _b : _a2.firstSpreadIndex = findIndex(arrayLiteral.elements, isSpreadElement);
|
|
69209
|
+
const elementIndex = indexOfNode(arrayLiteral.elements, node);
|
|
69210
|
+
return getContextualTypeForElementExpression(type, spreadIndex < 0 || elementIndex < spreadIndex ? elementIndex : -1);
|
|
69142
69211
|
}
|
|
69143
69212
|
case 224 /* ConditionalExpression */:
|
|
69144
69213
|
return getContextualTypeForConditionalOperand(node, contextFlags);
|
|
@@ -80237,20 +80306,19 @@ ${lanes.join("\n")}
|
|
|
80237
80306
|
}
|
|
80238
80307
|
}
|
|
80239
80308
|
}
|
|
80240
|
-
function getMemberOverrideModifierStatus(node, member) {
|
|
80309
|
+
function getMemberOverrideModifierStatus(node, member, memberSymbol) {
|
|
80241
80310
|
if (!member.name) {
|
|
80242
80311
|
return 0 /* Ok */;
|
|
80243
80312
|
}
|
|
80244
|
-
const
|
|
80245
|
-
const type = getDeclaredTypeOfSymbol(
|
|
80313
|
+
const classSymbol = getSymbolOfDeclaration(node);
|
|
80314
|
+
const type = getDeclaredTypeOfSymbol(classSymbol);
|
|
80246
80315
|
const typeWithThis = getTypeWithThisArgument(type);
|
|
80247
|
-
const staticType = getTypeOfSymbol(
|
|
80316
|
+
const staticType = getTypeOfSymbol(classSymbol);
|
|
80248
80317
|
const baseTypeNode = getEffectiveBaseTypeNode(node);
|
|
80249
80318
|
const baseTypes = baseTypeNode && getBaseTypes(type);
|
|
80250
80319
|
const baseWithThis = (baseTypes == null ? void 0 : baseTypes.length) ? getTypeWithThisArgument(first(baseTypes), type.thisType) : void 0;
|
|
80251
80320
|
const baseStaticType = getBaseConstructorTypeOfClass(type);
|
|
80252
80321
|
const memberHasOverrideModifier = member.parent ? hasOverrideModifier(member) : hasSyntacticModifier(member, 16384 /* Override */);
|
|
80253
|
-
const memberName = unescapeLeadingUnderscores(getTextOfPropertyName(member.name));
|
|
80254
80322
|
return checkMemberForOverrideModifier(
|
|
80255
80323
|
node,
|
|
80256
80324
|
staticType,
|
|
@@ -80263,7 +80331,7 @@ ${lanes.join("\n")}
|
|
|
80263
80331
|
isStatic(member),
|
|
80264
80332
|
/* memberIsParameterProperty */
|
|
80265
80333
|
false,
|
|
80266
|
-
|
|
80334
|
+
symbolName(memberSymbol)
|
|
80267
80335
|
);
|
|
80268
80336
|
}
|
|
80269
80337
|
function getTargetSymbol(s) {
|
|
@@ -147313,7 +147381,7 @@ ${lanes.join("\n")}
|
|
|
147313
147381
|
return !!(origin && origin.kind === 32 /* ResolvedExport */);
|
|
147314
147382
|
}
|
|
147315
147383
|
function originIncludesSymbolName(origin) {
|
|
147316
|
-
return originIsExport(origin) || originIsResolvedExport(origin);
|
|
147384
|
+
return originIsExport(origin) || originIsResolvedExport(origin) || originIsComputedPropertyName(origin);
|
|
147317
147385
|
}
|
|
147318
147386
|
function originIsPackageJsonImport(origin) {
|
|
147319
147387
|
return (originIsExport(origin) || originIsResolvedExport(origin)) && !!origin.isFromPackageJson;
|
|
@@ -147333,6 +147401,9 @@ ${lanes.join("\n")}
|
|
|
147333
147401
|
function originIsIgnore(origin) {
|
|
147334
147402
|
return !!(origin && origin.kind & 256 /* Ignore */);
|
|
147335
147403
|
}
|
|
147404
|
+
function originIsComputedPropertyName(origin) {
|
|
147405
|
+
return !!(origin && origin.kind & 512 /* ComputedPropertyName */);
|
|
147406
|
+
}
|
|
147336
147407
|
function resolvingModuleSpecifiers(logPrefix, host, resolver, program, position, preferences, isForImportStatementCompletion, isValidTypeOnlyUseSite, cb) {
|
|
147337
147408
|
var _a2, _b, _c;
|
|
147338
147409
|
const start = timestamp();
|
|
@@ -148059,7 +148130,7 @@ ${lanes.join("\n")}
|
|
|
148059
148130
|
if (isAbstract) {
|
|
148060
148131
|
requiredModifiers |= 256 /* Abstract */;
|
|
148061
148132
|
}
|
|
148062
|
-
if (isClassElement(node) && checker.getMemberOverrideModifierStatus(classLikeDeclaration, node) === 1 /* NeedsOverride */) {
|
|
148133
|
+
if (isClassElement(node) && checker.getMemberOverrideModifierStatus(classLikeDeclaration, node, symbol) === 1 /* NeedsOverride */) {
|
|
148063
148134
|
requiredModifiers |= 16384 /* Override */;
|
|
148064
148135
|
}
|
|
148065
148136
|
if (!completionNodes.length) {
|
|
@@ -148653,7 +148724,8 @@ ${lanes.join("\n")}
|
|
|
148653
148724
|
case "symbol": {
|
|
148654
148725
|
const { symbol, location, contextToken: contextToken2, origin, previousToken: previousToken2 } = symbolCompletion;
|
|
148655
148726
|
const { codeActions, sourceDisplay } = getCompletionEntryCodeActionsAndSourceDisplay(name, location, contextToken2, origin, symbol, program, host, compilerOptions, sourceFile, position, previousToken2, formatContext, preferences, data, source, cancellationToken);
|
|
148656
|
-
|
|
148727
|
+
const symbolName2 = originIsComputedPropertyName(origin) ? origin.symbolName : symbol.name;
|
|
148728
|
+
return createCompletionDetailsForSymbol(symbol, symbolName2, typeChecker, sourceFile, location, cancellationToken, codeActions, sourceDisplay);
|
|
148657
148729
|
}
|
|
148658
148730
|
case "literal": {
|
|
148659
148731
|
const { literal } = symbolCompletion;
|
|
@@ -148704,12 +148776,12 @@ ${lanes.join("\n")}
|
|
|
148704
148776
|
function createSimpleDetails(name, kind, kind2) {
|
|
148705
148777
|
return createCompletionDetails(name, "" /* none */, kind, [displayPart(name, kind2)]);
|
|
148706
148778
|
}
|
|
148707
|
-
function createCompletionDetailsForSymbol(symbol, checker, sourceFile, location, cancellationToken, codeActions, sourceDisplay) {
|
|
148779
|
+
function createCompletionDetailsForSymbol(symbol, name, checker, sourceFile, location, cancellationToken, codeActions, sourceDisplay) {
|
|
148708
148780
|
const { displayParts, documentation, symbolKind, tags } = checker.runWithCancellationToken(
|
|
148709
148781
|
cancellationToken,
|
|
148710
148782
|
(checker2) => ts_SymbolDisplay_exports.getSymbolDisplayPartsDocumentationAndSymbolKind(checker2, symbol, sourceFile, location, location, 7 /* All */)
|
|
148711
148783
|
);
|
|
148712
|
-
return createCompletionDetails(
|
|
148784
|
+
return createCompletionDetails(name, ts_SymbolDisplay_exports.getSymbolModifiers(checker, symbol), symbolKind, displayParts, documentation, tags, codeActions, sourceDisplay);
|
|
148713
148785
|
}
|
|
148714
148786
|
function createCompletionDetails(name, kindModifiers, kind, displayParts, documentation, tags, codeActions, source) {
|
|
148715
148787
|
return { name, kindModifiers, kind, displayParts, documentation, tags, codeActions, source, sourceDisplay: source };
|
|
@@ -149807,6 +149879,16 @@ ${lanes.join("\n")}
|
|
|
149807
149879
|
return classElementModifierFlags & 32 /* Static */ ? (type == null ? void 0 : type.symbol) && typeChecker.getPropertiesOfType(typeChecker.getTypeOfSymbolAtLocation(type.symbol, decl)) : type && typeChecker.getPropertiesOfType(type);
|
|
149808
149880
|
});
|
|
149809
149881
|
symbols = concatenate(symbols, filterClassMembersList(baseSymbols, decl.members, classElementModifierFlags));
|
|
149882
|
+
forEach(symbols, (symbol, index) => {
|
|
149883
|
+
const declaration = symbol == null ? void 0 : symbol.valueDeclaration;
|
|
149884
|
+
if (declaration && isClassElement(declaration) && declaration.name && isComputedPropertyName(declaration.name)) {
|
|
149885
|
+
const origin = {
|
|
149886
|
+
kind: 512 /* ComputedPropertyName */,
|
|
149887
|
+
symbolName: typeChecker.symbolToString(symbol)
|
|
149888
|
+
};
|
|
149889
|
+
symbolToOriginInfoMap[index] = origin;
|
|
149890
|
+
}
|
|
149891
|
+
});
|
|
149810
149892
|
}
|
|
149811
149893
|
return 1 /* Success */;
|
|
149812
149894
|
}
|
|
@@ -150191,7 +150273,7 @@ ${lanes.join("\n")}
|
|
|
150191
150273
|
}
|
|
150192
150274
|
switch (kind) {
|
|
150193
150275
|
case 3 /* MemberLike */:
|
|
150194
|
-
return void 0;
|
|
150276
|
+
return originIsComputedPropertyName(origin) ? { name: origin.symbolName, needsConvertPropertyAccess: false } : void 0;
|
|
150195
150277
|
case 0 /* ObjectPropertyDeclaration */:
|
|
150196
150278
|
return { name: JSON.stringify(name), needsConvertPropertyAccess: false };
|
|
150197
150279
|
case 2 /* PropertyAccess */:
|
|
@@ -150699,6 +150781,7 @@ ${lanes.join("\n")}
|
|
|
150699
150781
|
SymbolOriginInfoKind2[SymbolOriginInfoKind2["TypeOnlyAlias"] = 64] = "TypeOnlyAlias";
|
|
150700
150782
|
SymbolOriginInfoKind2[SymbolOriginInfoKind2["ObjectLiteralMethod"] = 128] = "ObjectLiteralMethod";
|
|
150701
150783
|
SymbolOriginInfoKind2[SymbolOriginInfoKind2["Ignore"] = 256] = "Ignore";
|
|
150784
|
+
SymbolOriginInfoKind2[SymbolOriginInfoKind2["ComputedPropertyName"] = 512] = "ComputedPropertyName";
|
|
150702
150785
|
SymbolOriginInfoKind2[SymbolOriginInfoKind2["SymbolMemberNoExport"] = 2 /* SymbolMember */] = "SymbolMemberNoExport";
|
|
150703
150786
|
SymbolOriginInfoKind2[SymbolOriginInfoKind2["SymbolMemberExport"] = 6] = "SymbolMemberExport";
|
|
150704
150787
|
return SymbolOriginInfoKind2;
|
|
@@ -150834,7 +150917,7 @@ ${lanes.join("\n")}
|
|
|
150834
150917
|
}
|
|
150835
150918
|
case 1 /* Properties */: {
|
|
150836
150919
|
const match = find(completion.symbols, (s) => s.name === name);
|
|
150837
|
-
return match && createCompletionDetailsForSymbol(match, checker, sourceFile, location, cancellationToken);
|
|
150920
|
+
return match && createCompletionDetailsForSymbol(match, match.name, checker, sourceFile, location, cancellationToken);
|
|
150838
150921
|
}
|
|
150839
150922
|
case 2 /* Types */:
|
|
150840
150923
|
return find(completion.types, (t) => t.value === name) ? createCompletionDetails(name, "" /* none */, "string" /* string */, [textPart(name)]) : void 0;
|