@typescript-deploys/pr-build 5.0.0-pr-50431-13 → 5.0.0-pr-52836-22
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 +163 -122
- package/lib/tsserver.js +185 -138
- package/lib/tsserverlibrary.js +185 -136
- package/lib/typescript.js +185 -134
- package/lib/typingsInstaller.js +40 -44
- package/package.json +1 -1
package/lib/tsserver.js
CHANGED
|
@@ -1797,8 +1797,6 @@ __export(server_exports, {
|
|
|
1797
1797
|
isWithStatement: () => isWithStatement,
|
|
1798
1798
|
isWriteAccess: () => isWriteAccess,
|
|
1799
1799
|
isWriteOnlyAccess: () => isWriteOnlyAccess,
|
|
1800
|
-
isWriteOnlyUsage: () => isWriteOnlyUsage,
|
|
1801
|
-
isWriteUsage: () => isWriteUsage,
|
|
1802
1800
|
isYieldExpression: () => isYieldExpression,
|
|
1803
1801
|
jsxModeNeedsExplicitImport: () => jsxModeNeedsExplicitImport,
|
|
1804
1802
|
keywordPart: () => keywordPart,
|
|
@@ -2290,7 +2288,7 @@ module.exports = __toCommonJS(server_exports);
|
|
|
2290
2288
|
|
|
2291
2289
|
// src/compiler/corePublic.ts
|
|
2292
2290
|
var versionMajorMinor = "5.0";
|
|
2293
|
-
var version = `${versionMajorMinor}.0-insiders.
|
|
2291
|
+
var version = `${versionMajorMinor}.0-insiders.20230218`;
|
|
2294
2292
|
var Comparison = /* @__PURE__ */ ((Comparison3) => {
|
|
2295
2293
|
Comparison3[Comparison3["LessThan"] = -1] = "LessThan";
|
|
2296
2294
|
Comparison3[Comparison3["EqualTo"] = 0] = "EqualTo";
|
|
@@ -11954,18 +11952,18 @@ function isIdentifierText(name, languageVersion, identifierVariant) {
|
|
|
11954
11952
|
return true;
|
|
11955
11953
|
}
|
|
11956
11954
|
function createScanner(languageVersion, skipTrivia2, languageVariant = 0 /* Standard */, textInitial, onError, start2, length2) {
|
|
11957
|
-
|
|
11958
|
-
|
|
11959
|
-
|
|
11960
|
-
|
|
11961
|
-
|
|
11962
|
-
|
|
11963
|
-
|
|
11964
|
-
|
|
11965
|
-
|
|
11966
|
-
|
|
11955
|
+
var text = textInitial;
|
|
11956
|
+
var pos;
|
|
11957
|
+
var end;
|
|
11958
|
+
var startPos;
|
|
11959
|
+
var tokenPos;
|
|
11960
|
+
var token;
|
|
11961
|
+
var tokenValue;
|
|
11962
|
+
var tokenFlags;
|
|
11963
|
+
var commentDirectives;
|
|
11964
|
+
var inJSDocType = 0;
|
|
11967
11965
|
setText(text, start2, length2);
|
|
11968
|
-
|
|
11966
|
+
var scanner2 = {
|
|
11969
11967
|
getStartPos: () => startPos,
|
|
11970
11968
|
getTextPos: () => pos,
|
|
11971
11969
|
getToken: () => token,
|
|
@@ -19654,39 +19652,20 @@ function isWriteOnlyAccess(node) {
|
|
|
19654
19652
|
function isWriteAccess(node) {
|
|
19655
19653
|
return accessKind(node) !== 0 /* Read */;
|
|
19656
19654
|
}
|
|
19657
|
-
function isWriteOnlyUsage(node) {
|
|
19658
|
-
return accessKindForUsageChecks(node) === 1 /* Write */;
|
|
19659
|
-
}
|
|
19660
|
-
function isWriteUsage(node) {
|
|
19661
|
-
return accessKindForUsageChecks(node) !== 0 /* Read */;
|
|
19662
|
-
}
|
|
19663
|
-
function accessKindForUsageChecks(node) {
|
|
19664
|
-
const kind = accessKind(node);
|
|
19665
|
-
const { parent: parent2 } = node;
|
|
19666
|
-
switch (parent2 == null ? void 0 : parent2.kind) {
|
|
19667
|
-
case 222 /* PostfixUnaryExpression */:
|
|
19668
|
-
case 221 /* PrefixUnaryExpression */:
|
|
19669
|
-
case 223 /* BinaryExpression */:
|
|
19670
|
-
return kind === 2 /* ReadWrite */ ? writeOrReadWrite() : kind;
|
|
19671
|
-
default:
|
|
19672
|
-
return kind;
|
|
19673
|
-
}
|
|
19674
|
-
function writeOrReadWrite() {
|
|
19675
|
-
return parent2.parent && walkUpParenthesizedExpressions(parent2.parent).kind === 241 /* ExpressionStatement */ ? 1 /* Write */ : 2 /* ReadWrite */;
|
|
19676
|
-
}
|
|
19677
|
-
}
|
|
19678
19655
|
function accessKind(node) {
|
|
19679
19656
|
const { parent: parent2 } = node;
|
|
19680
|
-
|
|
19657
|
+
if (!parent2)
|
|
19658
|
+
return 0 /* Read */;
|
|
19659
|
+
switch (parent2.kind) {
|
|
19681
19660
|
case 214 /* ParenthesizedExpression */:
|
|
19682
19661
|
return accessKind(parent2);
|
|
19683
19662
|
case 222 /* PostfixUnaryExpression */:
|
|
19684
19663
|
case 221 /* PrefixUnaryExpression */:
|
|
19685
19664
|
const { operator } = parent2;
|
|
19686
|
-
return operator === 45 /* PlusPlusToken */ || operator === 46 /* MinusMinusToken */ ?
|
|
19665
|
+
return operator === 45 /* PlusPlusToken */ || operator === 46 /* MinusMinusToken */ ? writeOrReadWrite() : 0 /* Read */;
|
|
19687
19666
|
case 223 /* BinaryExpression */:
|
|
19688
19667
|
const { left, operatorToken } = parent2;
|
|
19689
|
-
return left === node && isAssignmentOperator(operatorToken.kind) ? operatorToken.kind === 63 /* EqualsToken */ ? 1 /* Write */ :
|
|
19668
|
+
return left === node && isAssignmentOperator(operatorToken.kind) ? operatorToken.kind === 63 /* EqualsToken */ ? 1 /* Write */ : writeOrReadWrite() : 0 /* Read */;
|
|
19690
19669
|
case 208 /* PropertyAccessExpression */:
|
|
19691
19670
|
return parent2.name !== node ? 0 /* Read */ : accessKind(parent2);
|
|
19692
19671
|
case 299 /* PropertyAssignment */: {
|
|
@@ -19700,6 +19679,9 @@ function accessKind(node) {
|
|
|
19700
19679
|
default:
|
|
19701
19680
|
return 0 /* Read */;
|
|
19702
19681
|
}
|
|
19682
|
+
function writeOrReadWrite() {
|
|
19683
|
+
return parent2.parent && walkUpParenthesizedExpressions(parent2.parent).kind === 241 /* ExpressionStatement */ ? 1 /* Write */ : 2 /* ReadWrite */;
|
|
19684
|
+
}
|
|
19703
19685
|
}
|
|
19704
19686
|
function reverseAccessKind(a) {
|
|
19705
19687
|
switch (a) {
|
|
@@ -30372,22 +30354,22 @@ function parseJSDocTypeExpressionForTests(content, start2, length2) {
|
|
|
30372
30354
|
}
|
|
30373
30355
|
var Parser;
|
|
30374
30356
|
((Parser2) => {
|
|
30375
|
-
|
|
30357
|
+
var scanner2 = createScanner(
|
|
30376
30358
|
99 /* Latest */,
|
|
30377
30359
|
/*skipTrivia*/
|
|
30378
30360
|
true
|
|
30379
30361
|
);
|
|
30380
|
-
|
|
30381
|
-
|
|
30382
|
-
|
|
30383
|
-
|
|
30384
|
-
|
|
30385
|
-
|
|
30362
|
+
var disallowInAndDecoratorContext = 4096 /* DisallowInContext */ | 16384 /* DecoratorContext */;
|
|
30363
|
+
var NodeConstructor2;
|
|
30364
|
+
var TokenConstructor2;
|
|
30365
|
+
var IdentifierConstructor2;
|
|
30366
|
+
var PrivateIdentifierConstructor2;
|
|
30367
|
+
var SourceFileConstructor2;
|
|
30386
30368
|
function countNode(node) {
|
|
30387
30369
|
nodeCount++;
|
|
30388
30370
|
return node;
|
|
30389
30371
|
}
|
|
30390
|
-
|
|
30372
|
+
var baseNodeFactory = {
|
|
30391
30373
|
createBaseSourceFileNode: (kind) => countNode(new SourceFileConstructor2(
|
|
30392
30374
|
kind,
|
|
30393
30375
|
/*pos*/
|
|
@@ -30424,25 +30406,25 @@ var Parser;
|
|
|
30424
30406
|
0
|
|
30425
30407
|
))
|
|
30426
30408
|
};
|
|
30427
|
-
|
|
30428
|
-
|
|
30429
|
-
|
|
30430
|
-
|
|
30431
|
-
|
|
30432
|
-
|
|
30433
|
-
|
|
30434
|
-
|
|
30435
|
-
|
|
30436
|
-
|
|
30437
|
-
|
|
30438
|
-
|
|
30439
|
-
|
|
30440
|
-
|
|
30441
|
-
|
|
30442
|
-
|
|
30443
|
-
|
|
30444
|
-
|
|
30445
|
-
|
|
30409
|
+
var factory2 = createNodeFactory(1 /* NoParenthesizerRules */ | 2 /* NoNodeConverters */ | 8 /* NoOriginalNode */, baseNodeFactory);
|
|
30410
|
+
var fileName;
|
|
30411
|
+
var sourceFlags;
|
|
30412
|
+
var sourceText;
|
|
30413
|
+
var languageVersion;
|
|
30414
|
+
var scriptKind;
|
|
30415
|
+
var languageVariant;
|
|
30416
|
+
var parseDiagnostics;
|
|
30417
|
+
var jsDocDiagnostics;
|
|
30418
|
+
var syntaxCursor;
|
|
30419
|
+
var currentToken;
|
|
30420
|
+
var nodeCount;
|
|
30421
|
+
var identifiers;
|
|
30422
|
+
var identifierCount;
|
|
30423
|
+
var parsingContext;
|
|
30424
|
+
var notParenthesizedArrow;
|
|
30425
|
+
var contextFlags;
|
|
30426
|
+
var topLevel = true;
|
|
30427
|
+
var parseErrorBeforeNextFinishedNode = false;
|
|
30446
30428
|
function parseSourceFile(fileName2, sourceText2, languageVersion2, syntaxCursor2, setParentNodes = false, scriptKind2, setExternalModuleIndicatorOverride) {
|
|
30447
30429
|
var _a2;
|
|
30448
30430
|
scriptKind2 = ensureScriptKind(fileName2, scriptKind2);
|
|
@@ -33949,13 +33931,9 @@ var Parser;
|
|
|
33949
33931
|
function parseJsxClosingFragment(inExpressionContext) {
|
|
33950
33932
|
const pos = getNodePos();
|
|
33951
33933
|
parseExpected(30 /* LessThanSlashToken */);
|
|
33952
|
-
if (tokenIsIdentifierOrKeyword(token())) {
|
|
33953
|
-
parseErrorAtRange(parseJsxElementName(), Diagnostics.Expected_corresponding_closing_tag_for_JSX_fragment);
|
|
33954
|
-
}
|
|
33955
33934
|
if (parseExpected(
|
|
33956
33935
|
31 /* GreaterThanToken */,
|
|
33957
|
-
|
|
33958
|
-
void 0,
|
|
33936
|
+
Diagnostics.Expected_corresponding_closing_tag_for_JSX_fragment,
|
|
33959
33937
|
/*shouldAdvance*/
|
|
33960
33938
|
false
|
|
33961
33939
|
)) {
|
|
@@ -51917,7 +51895,7 @@ function createTypeChecker(host) {
|
|
|
51917
51895
|
return result;
|
|
51918
51896
|
}
|
|
51919
51897
|
function createAnonymousTypeNode(type2) {
|
|
51920
|
-
var _a3;
|
|
51898
|
+
var _a3, _b2;
|
|
51921
51899
|
const typeId = type2.id;
|
|
51922
51900
|
const symbol = type2.symbol;
|
|
51923
51901
|
if (symbol) {
|
|
@@ -51943,6 +51921,20 @@ function createTypeChecker(host) {
|
|
|
51943
51921
|
return visitAndTransformType(type2, createTypeNodeFromObjectType);
|
|
51944
51922
|
}
|
|
51945
51923
|
} else {
|
|
51924
|
+
const isInstantiationExpressionType = !!(getObjectFlags(type2) & 8388608 /* InstantiationExpressionType */);
|
|
51925
|
+
if (isInstantiationExpressionType) {
|
|
51926
|
+
const instantiationExpressionType = type2;
|
|
51927
|
+
if (isTypeQueryNode(instantiationExpressionType.node)) {
|
|
51928
|
+
const typeNode = serializeExistingTypeNode(context, instantiationExpressionType.node);
|
|
51929
|
+
if (typeNode) {
|
|
51930
|
+
return typeNode;
|
|
51931
|
+
}
|
|
51932
|
+
}
|
|
51933
|
+
if ((_b2 = context.visitedTypes) == null ? void 0 : _b2.has(typeId)) {
|
|
51934
|
+
return createElidedInformationPlaceholder(context);
|
|
51935
|
+
}
|
|
51936
|
+
return visitAndTransformType(type2, createTypeNodeFromObjectType);
|
|
51937
|
+
}
|
|
51946
51938
|
return createTypeNodeFromObjectType(type2);
|
|
51947
51939
|
}
|
|
51948
51940
|
function shouldWriteTypeOfFunctionSymbol() {
|
|
@@ -52451,7 +52443,7 @@ function createTypeChecker(host) {
|
|
|
52451
52443
|
);
|
|
52452
52444
|
}
|
|
52453
52445
|
function signatureToSignatureDeclarationHelper(signature, kind, context, options) {
|
|
52454
|
-
var _a2, _b, _c, _d;
|
|
52446
|
+
var _a2, _b, _c, _d, _e;
|
|
52455
52447
|
const suppressAny = context.flags & 256 /* SuppressAnyReturnType */;
|
|
52456
52448
|
if (suppressAny)
|
|
52457
52449
|
context.flags &= ~256 /* SuppressAnyReturnType */;
|
|
@@ -52468,6 +52460,39 @@ function createTypeChecker(host) {
|
|
|
52468
52460
|
/*skipUnionExpanding*/
|
|
52469
52461
|
true
|
|
52470
52462
|
)[0];
|
|
52463
|
+
let cleanup;
|
|
52464
|
+
if (context.enclosingDeclaration && signature.declaration && signature.declaration !== context.enclosingDeclaration && !isInJSFile(signature.declaration) && some(expandedParams)) {
|
|
52465
|
+
const existingFakeScope = getNodeLinks(context.enclosingDeclaration).fakeScopeForSignatureDeclaration ? context.enclosingDeclaration : void 0;
|
|
52466
|
+
Debug.assertOptionalNode(existingFakeScope, isBlock);
|
|
52467
|
+
const locals = (_a2 = existingFakeScope == null ? void 0 : existingFakeScope.locals) != null ? _a2 : createSymbolTable();
|
|
52468
|
+
let newLocals;
|
|
52469
|
+
for (const param of expandedParams) {
|
|
52470
|
+
if (!locals.has(param.escapedName)) {
|
|
52471
|
+
newLocals = append(newLocals, param.escapedName);
|
|
52472
|
+
locals.set(param.escapedName, param);
|
|
52473
|
+
}
|
|
52474
|
+
}
|
|
52475
|
+
if (newLocals) {
|
|
52476
|
+
let removeNewLocals2 = function() {
|
|
52477
|
+
forEach(newLocals, (s) => locals.delete(s));
|
|
52478
|
+
};
|
|
52479
|
+
var removeNewLocals = removeNewLocals2;
|
|
52480
|
+
if (existingFakeScope) {
|
|
52481
|
+
cleanup = removeNewLocals2;
|
|
52482
|
+
} else {
|
|
52483
|
+
const fakeScope = parseNodeFactory.createBlock(emptyArray);
|
|
52484
|
+
getNodeLinks(fakeScope).fakeScopeForSignatureDeclaration = true;
|
|
52485
|
+
fakeScope.locals = locals;
|
|
52486
|
+
const saveEnclosingDeclaration = context.enclosingDeclaration;
|
|
52487
|
+
setParent(fakeScope, saveEnclosingDeclaration);
|
|
52488
|
+
context.enclosingDeclaration = fakeScope;
|
|
52489
|
+
cleanup = () => {
|
|
52490
|
+
context.enclosingDeclaration = saveEnclosingDeclaration;
|
|
52491
|
+
removeNewLocals2();
|
|
52492
|
+
};
|
|
52493
|
+
}
|
|
52494
|
+
}
|
|
52495
|
+
}
|
|
52471
52496
|
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));
|
|
52472
52497
|
const thisParameter = context.flags & 33554432 /* OmitThisParameter */ ? void 0 : tryGetThisParameterDeclaration(signature, context);
|
|
52473
52498
|
if (thisParameter) {
|
|
@@ -52493,11 +52518,11 @@ function createTypeChecker(host) {
|
|
|
52493
52518
|
const flags = modifiersToFlags(modifiers);
|
|
52494
52519
|
modifiers = factory.createModifiersFromModifierFlags(flags | 256 /* Abstract */);
|
|
52495
52520
|
}
|
|
52496
|
-
const node = kind === 176 /* CallSignature */ ? factory.createCallSignature(typeParameters, parameters, returnTypeNode) : kind === 177 /* ConstructSignature */ ? factory.createConstructSignature(typeParameters, parameters, returnTypeNode) : kind === 170 /* MethodSignature */ ? factory.createMethodSignature(modifiers, (
|
|
52521
|
+
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(
|
|
52497
52522
|
modifiers,
|
|
52498
52523
|
/*asteriskToken*/
|
|
52499
52524
|
void 0,
|
|
52500
|
-
(
|
|
52525
|
+
(_c = options == null ? void 0 : options.name) != null ? _c : factory.createIdentifier(""),
|
|
52501
52526
|
/*questionToken*/
|
|
52502
52527
|
void 0,
|
|
52503
52528
|
typeParameters,
|
|
@@ -52512,14 +52537,14 @@ function createTypeChecker(host) {
|
|
|
52512
52537
|
void 0
|
|
52513
52538
|
) : kind === 174 /* GetAccessor */ ? factory.createGetAccessorDeclaration(
|
|
52514
52539
|
modifiers,
|
|
52515
|
-
(
|
|
52540
|
+
(_d = options == null ? void 0 : options.name) != null ? _d : factory.createIdentifier(""),
|
|
52516
52541
|
parameters,
|
|
52517
52542
|
returnTypeNode,
|
|
52518
52543
|
/*body*/
|
|
52519
52544
|
void 0
|
|
52520
52545
|
) : kind === 175 /* SetAccessor */ ? factory.createSetAccessorDeclaration(
|
|
52521
52546
|
modifiers,
|
|
52522
|
-
(
|
|
52547
|
+
(_e = options == null ? void 0 : options.name) != null ? _e : factory.createIdentifier(""),
|
|
52523
52548
|
parameters,
|
|
52524
52549
|
/*body*/
|
|
52525
52550
|
void 0
|
|
@@ -52554,6 +52579,7 @@ function createTypeChecker(host) {
|
|
|
52554
52579
|
if (typeArguments) {
|
|
52555
52580
|
node.typeArguments = factory.createNodeArray(typeArguments);
|
|
52556
52581
|
}
|
|
52582
|
+
cleanup == null ? void 0 : cleanup();
|
|
52557
52583
|
return node;
|
|
52558
52584
|
}
|
|
52559
52585
|
function tryGetThisParameterDeclaration(signature, context) {
|
|
@@ -53168,9 +53194,12 @@ function createTypeChecker(host) {
|
|
|
53168
53194
|
function existingTypeNodeIsNotReferenceOrIsReferenceWithCompatibleTypeArgumentCount(existing, type) {
|
|
53169
53195
|
return !(getObjectFlags(type) & 4 /* Reference */) || !isTypeReferenceNode(existing) || length(existing.typeArguments) >= getMinTypeArgumentCount(type.target.typeParameters);
|
|
53170
53196
|
}
|
|
53197
|
+
function getEnclosingDeclarationIgnoringFakeScope(enclosingDeclaration) {
|
|
53198
|
+
return getNodeLinks(enclosingDeclaration).fakeScopeForSignatureDeclaration ? enclosingDeclaration.parent : enclosingDeclaration;
|
|
53199
|
+
}
|
|
53171
53200
|
function serializeTypeForDeclaration(context, type, symbol, enclosingDeclaration, includePrivateSymbol, bundled) {
|
|
53172
53201
|
if (!isErrorType(type) && enclosingDeclaration) {
|
|
53173
|
-
const declWithExistingAnnotation = getDeclarationWithTypeAnnotation(symbol, enclosingDeclaration);
|
|
53202
|
+
const declWithExistingAnnotation = getDeclarationWithTypeAnnotation(symbol, getEnclosingDeclarationIgnoringFakeScope(enclosingDeclaration));
|
|
53174
53203
|
if (declWithExistingAnnotation && !isFunctionLikeDeclaration(declWithExistingAnnotation) && !isGetAccessorDeclaration(declWithExistingAnnotation)) {
|
|
53175
53204
|
const existing = getEffectiveTypeAnnotationNode(declWithExistingAnnotation);
|
|
53176
53205
|
if (typeNodeIsEquivalentToType(existing, declWithExistingAnnotation, type) && existingTypeNodeIsNotReferenceOrIsReferenceWithCompatibleTypeArgumentCount(existing, type)) {
|
|
@@ -53202,7 +53231,8 @@ function createTypeChecker(host) {
|
|
|
53202
53231
|
function serializeReturnTypeForSignature(context, type, signature, includePrivateSymbol, bundled) {
|
|
53203
53232
|
if (!isErrorType(type) && context.enclosingDeclaration) {
|
|
53204
53233
|
const annotation = signature.declaration && getEffectiveReturnTypeNode(signature.declaration);
|
|
53205
|
-
|
|
53234
|
+
const enclosingDeclarationIgnoringFakeScope = getEnclosingDeclarationIgnoringFakeScope(context.enclosingDeclaration);
|
|
53235
|
+
if (!!findAncestor(annotation, (n) => n === enclosingDeclarationIgnoringFakeScope) && annotation) {
|
|
53206
53236
|
const annotated = getTypeFromTypeNode(annotation);
|
|
53207
53237
|
const thisInstantiated = annotated.flags & 262144 /* TypeParameter */ && annotated.isThisType ? instantiateType(annotated, signature.mapper) : annotated;
|
|
53208
53238
|
if (thisInstantiated === type && existingTypeNodeIsNotReferenceOrIsReferenceWithCompatibleTypeArgumentCount(annotation, type)) {
|
|
@@ -60964,31 +60994,21 @@ function createTypeChecker(host) {
|
|
|
60964
60994
|
}
|
|
60965
60995
|
return type;
|
|
60966
60996
|
function addSpans(texts2, types2) {
|
|
60967
|
-
const isTextsArray = isArray(texts2);
|
|
60968
60997
|
for (let i = 0; i < types2.length; i++) {
|
|
60969
60998
|
const t = types2[i];
|
|
60970
|
-
const addText = isTextsArray ? texts2[i + 1] : texts2;
|
|
60971
60999
|
if (t.flags & (2944 /* Literal */ | 65536 /* Null */ | 32768 /* Undefined */)) {
|
|
60972
61000
|
text += getTemplateStringForType(t) || "";
|
|
60973
|
-
text +=
|
|
60974
|
-
if (!isTextsArray)
|
|
60975
|
-
return true;
|
|
61001
|
+
text += texts2[i + 1];
|
|
60976
61002
|
} else if (t.flags & 134217728 /* TemplateLiteral */) {
|
|
60977
61003
|
text += t.texts[0];
|
|
60978
61004
|
if (!addSpans(t.texts, t.types))
|
|
60979
61005
|
return false;
|
|
60980
|
-
text +=
|
|
60981
|
-
|
|
60982
|
-
return true;
|
|
60983
|
-
} else if (isGenericIndexType(t) || isPatternLiteralPlaceholderType(t)) {
|
|
61006
|
+
text += texts2[i + 1];
|
|
61007
|
+
} else if (isGenericIndexType(t) || isPatternLiteralPlaceholderType(t) || t.flags & 2097152 /* Intersection */) {
|
|
60984
61008
|
newTypes.push(t);
|
|
60985
61009
|
newTexts.push(text);
|
|
60986
|
-
text =
|
|
60987
|
-
} else
|
|
60988
|
-
const added = addSpans(texts2[i + 1], t.types);
|
|
60989
|
-
if (!added)
|
|
60990
|
-
return false;
|
|
60991
|
-
} else if (isTextsArray) {
|
|
61010
|
+
text = texts2[i + 1];
|
|
61011
|
+
} else {
|
|
60992
61012
|
return false;
|
|
60993
61013
|
}
|
|
60994
61014
|
}
|
|
@@ -61000,6 +61020,11 @@ function createTypeChecker(host) {
|
|
|
61000
61020
|
}
|
|
61001
61021
|
function createTemplateLiteralType(texts, types) {
|
|
61002
61022
|
const type = createType(134217728 /* TemplateLiteral */);
|
|
61023
|
+
type.objectFlags = getPropagatingFlagsOfTypes(
|
|
61024
|
+
types,
|
|
61025
|
+
/*excludeKinds*/
|
|
61026
|
+
98304 /* Nullable */
|
|
61027
|
+
);
|
|
61003
61028
|
type.texts = texts;
|
|
61004
61029
|
type.types = types;
|
|
61005
61030
|
return type;
|
|
@@ -61314,7 +61339,7 @@ function createTypeChecker(host) {
|
|
|
61314
61339
|
return !!(getGenericObjectFlags(type) & 8388608 /* IsGenericIndexType */);
|
|
61315
61340
|
}
|
|
61316
61341
|
function getGenericObjectFlags(type) {
|
|
61317
|
-
if (type.flags & 3145728 /* UnionOrIntersection */) {
|
|
61342
|
+
if (type.flags & (3145728 /* UnionOrIntersection */ | 134217728 /* TemplateLiteral */)) {
|
|
61318
61343
|
if (!(type.objectFlags & 2097152 /* IsGenericTypeComputed */)) {
|
|
61319
61344
|
type.objectFlags |= 2097152 /* IsGenericTypeComputed */ | reduceLeft(type.types, (flags, t) => flags | getGenericObjectFlags(t), 0);
|
|
61320
61345
|
}
|
|
@@ -61326,7 +61351,7 @@ function createTypeChecker(host) {
|
|
|
61326
61351
|
}
|
|
61327
61352
|
return type.objectFlags & 12582912 /* IsGenericType */;
|
|
61328
61353
|
}
|
|
61329
|
-
return (type.flags & 58982400 /* InstantiableNonPrimitive */ || isGenericMappedType(type) || isGenericTupleType(type) ? 4194304 /* IsGenericObjectType */ : 0) | (type.flags & (58982400 /* InstantiableNonPrimitive */ | 4194304 /* Index */ |
|
|
61354
|
+
return (type.flags & 58982400 /* InstantiableNonPrimitive */ || isGenericMappedType(type) || isGenericTupleType(type) ? 4194304 /* IsGenericObjectType */ : 0) | (type.flags & (58982400 /* InstantiableNonPrimitive */ | 4194304 /* Index */ | 268435456 /* StringMapping */) && !isPatternLiteralType(type) ? 8388608 /* IsGenericIndexType */ : 0);
|
|
61330
61355
|
}
|
|
61331
61356
|
function getSimplifiedType(type, writing) {
|
|
61332
61357
|
return type.flags & 8388608 /* IndexedAccess */ ? getSimplifiedIndexedAccessType(type, writing) : type.flags & 16777216 /* Conditional */ ? getSimplifiedConditionalType(type, writing) : type;
|
|
@@ -66504,7 +66529,7 @@ function createTypeChecker(host) {
|
|
|
66504
66529
|
const restType = getRestTypeOfTupleType(type);
|
|
66505
66530
|
return restType && createArrayType(restType);
|
|
66506
66531
|
}
|
|
66507
|
-
function getElementTypeOfSliceOfTupleType(type, index, endSkipCount = 0, writing = false) {
|
|
66532
|
+
function getElementTypeOfSliceOfTupleType(type, index, endSkipCount = 0, writing = false, noReductions = false) {
|
|
66508
66533
|
const length2 = getTypeReferenceArity(type) - endSkipCount;
|
|
66509
66534
|
if (index < length2) {
|
|
66510
66535
|
const typeArguments = getTypeArguments(type);
|
|
@@ -66513,7 +66538,7 @@ function createTypeChecker(host) {
|
|
|
66513
66538
|
const t = typeArguments[i];
|
|
66514
66539
|
elementTypes.push(type.target.elementFlags[i] & 8 /* Variadic */ ? getIndexedAccessType(t, numberType) : t);
|
|
66515
66540
|
}
|
|
66516
|
-
return writing ? getIntersectionType(elementTypes) : getUnionType(elementTypes);
|
|
66541
|
+
return writing ? getIntersectionType(elementTypes) : getUnionType(elementTypes, noReductions ? 0 /* None */ : 1 /* Literal */);
|
|
66517
66542
|
}
|
|
66518
66543
|
return void 0;
|
|
66519
66544
|
}
|
|
@@ -67980,7 +68005,7 @@ function createTypeChecker(host) {
|
|
|
67980
68005
|
111551 /* Value */ | 1048576 /* ExportValue */,
|
|
67981
68006
|
getCannotFindNameDiagnosticForName(node),
|
|
67982
68007
|
node,
|
|
67983
|
-
!
|
|
68008
|
+
!isWriteOnlyAccess(node),
|
|
67984
68009
|
/*excludeGlobals*/
|
|
67985
68010
|
false
|
|
67986
68011
|
) || unknownSymbol;
|
|
@@ -71100,9 +71125,18 @@ function createTypeChecker(host) {
|
|
|
71100
71125
|
if (prop) {
|
|
71101
71126
|
return isCircularMappedProperty(prop) ? void 0 : getTypeOfSymbol(prop);
|
|
71102
71127
|
}
|
|
71103
|
-
if (isTupleType(t)) {
|
|
71104
|
-
const restType =
|
|
71105
|
-
|
|
71128
|
+
if (isTupleType(t) && isNumericLiteralName(name) && +name >= 0) {
|
|
71129
|
+
const restType = getElementTypeOfSliceOfTupleType(
|
|
71130
|
+
t,
|
|
71131
|
+
t.target.fixedLength,
|
|
71132
|
+
/*endSkipCount*/
|
|
71133
|
+
0,
|
|
71134
|
+
/*writing*/
|
|
71135
|
+
false,
|
|
71136
|
+
/*noReductions*/
|
|
71137
|
+
true
|
|
71138
|
+
);
|
|
71139
|
+
if (restType) {
|
|
71106
71140
|
return restType;
|
|
71107
71141
|
}
|
|
71108
71142
|
}
|
|
@@ -71149,9 +71183,18 @@ function createTypeChecker(host) {
|
|
|
71149
71183
|
return void 0;
|
|
71150
71184
|
}
|
|
71151
71185
|
function getContextualTypeForElementExpression(arrayContextualType, index) {
|
|
71152
|
-
return arrayContextualType && (getTypeOfPropertyOfContextualType(arrayContextualType, "" + index) || mapType(
|
|
71186
|
+
return arrayContextualType && (index >= 0 && getTypeOfPropertyOfContextualType(arrayContextualType, "" + index) || mapType(
|
|
71153
71187
|
arrayContextualType,
|
|
71154
|
-
(t) =>
|
|
71188
|
+
(t) => isTupleType(t) ? getElementTypeOfSliceOfTupleType(
|
|
71189
|
+
t,
|
|
71190
|
+
0,
|
|
71191
|
+
/*endSkipCount*/
|
|
71192
|
+
0,
|
|
71193
|
+
/*writing*/
|
|
71194
|
+
false,
|
|
71195
|
+
/*noReductions*/
|
|
71196
|
+
true
|
|
71197
|
+
) : getIteratedTypeOrElementType(
|
|
71155
71198
|
1 /* Element */,
|
|
71156
71199
|
t,
|
|
71157
71200
|
undefinedType,
|
|
@@ -71304,6 +71347,7 @@ function createTypeChecker(host) {
|
|
|
71304
71347
|
return type;
|
|
71305
71348
|
}
|
|
71306
71349
|
function getContextualType2(node, contextFlags) {
|
|
71350
|
+
var _a2, _b;
|
|
71307
71351
|
if (node.flags & 33554432 /* InWithStatement */) {
|
|
71308
71352
|
return void 0;
|
|
71309
71353
|
}
|
|
@@ -71348,7 +71392,9 @@ function createTypeChecker(host) {
|
|
|
71348
71392
|
case 206 /* ArrayLiteralExpression */: {
|
|
71349
71393
|
const arrayLiteral = parent2;
|
|
71350
71394
|
const type = getApparentTypeOfContextualType(arrayLiteral, contextFlags);
|
|
71351
|
-
|
|
71395
|
+
const spreadIndex = (_b = (_a2 = getNodeLinks(arrayLiteral)).firstSpreadIndex) != null ? _b : _a2.firstSpreadIndex = findIndex(arrayLiteral.elements, isSpreadElement);
|
|
71396
|
+
const elementIndex = indexOfNode(arrayLiteral.elements, node);
|
|
71397
|
+
return getContextualTypeForElementExpression(type, spreadIndex < 0 || elementIndex < spreadIndex ? elementIndex : -1);
|
|
71352
71398
|
}
|
|
71353
71399
|
case 224 /* ConditionalExpression */:
|
|
71354
71400
|
return getContextualTypeForConditionalOperand(node, contextFlags);
|
|
@@ -72798,8 +72844,8 @@ function createTypeChecker(host) {
|
|
|
72798
72844
|
}
|
|
72799
72845
|
return nonNullType;
|
|
72800
72846
|
}
|
|
72801
|
-
function checkPropertyAccessExpression(node, checkMode
|
|
72802
|
-
return node.flags & 32 /* OptionalChain */ ? checkPropertyAccessChain(node, checkMode) : checkPropertyAccessExpressionOrQualifiedName(node, node.expression, checkNonNullExpression(node.expression), node.name, checkMode
|
|
72847
|
+
function checkPropertyAccessExpression(node, checkMode) {
|
|
72848
|
+
return node.flags & 32 /* OptionalChain */ ? checkPropertyAccessChain(node, checkMode) : checkPropertyAccessExpressionOrQualifiedName(node, node.expression, checkNonNullExpression(node.expression), node.name, checkMode);
|
|
72803
72849
|
}
|
|
72804
72850
|
function checkPropertyAccessChain(node, checkMode) {
|
|
72805
72851
|
const leftType = checkExpression(node.expression);
|
|
@@ -72930,7 +72976,7 @@ function createTypeChecker(host) {
|
|
|
72930
72976
|
false
|
|
72931
72977
|
) === getDeclaringConstructor(prop);
|
|
72932
72978
|
}
|
|
72933
|
-
function checkPropertyAccessExpressionOrQualifiedName(node, left, leftType, right, checkMode
|
|
72979
|
+
function checkPropertyAccessExpressionOrQualifiedName(node, left, leftType, right, checkMode) {
|
|
72934
72980
|
const parentSymbol = getNodeLinks(left).resolvedSymbol;
|
|
72935
72981
|
const assignmentKind = getAssignmentTargetKind(node);
|
|
72936
72982
|
const apparentType = getApparentType(assignmentKind !== 0 /* None */ || isMethodAccessForCall(node) ? getWidenedType(leftType) : leftType);
|
|
@@ -73029,12 +73075,13 @@ function createTypeChecker(host) {
|
|
|
73029
73075
|
checkPropertyNotUsedBeforeDeclaration(prop, node, right);
|
|
73030
73076
|
markPropertyAsReferenced(prop, node, isSelfTypeAccess(left, parentSymbol));
|
|
73031
73077
|
getNodeLinks(node).resolvedSymbol = prop;
|
|
73032
|
-
|
|
73078
|
+
const writing = isWriteAccess(node);
|
|
73079
|
+
checkPropertyAccessibility(node, left.kind === 106 /* SuperKeyword */, writing, apparentType, prop);
|
|
73033
73080
|
if (isAssignmentToReadonlyEntity(node, prop, assignmentKind)) {
|
|
73034
73081
|
error(right, Diagnostics.Cannot_assign_to_0_because_it_is_a_read_only_property, idText(right));
|
|
73035
73082
|
return errorType;
|
|
73036
73083
|
}
|
|
73037
|
-
propType = isThisPropertyAccessInConstructor(node, prop) ? autoType :
|
|
73084
|
+
propType = isThisPropertyAccessInConstructor(node, prop) ? autoType : writing ? getWriteTypeOfSymbol(prop) : getTypeOfSymbol(prop);
|
|
73038
73085
|
}
|
|
73039
73086
|
return getFlowTypeOfAccessExpression(node, prop, propType, right, checkMode);
|
|
73040
73087
|
}
|
|
@@ -73350,7 +73397,7 @@ function createTypeChecker(host) {
|
|
|
73350
73397
|
if (!hasPrivateModifier && !hasPrivateIdentifier) {
|
|
73351
73398
|
return;
|
|
73352
73399
|
}
|
|
73353
|
-
if (nodeForCheckWriteOnly &&
|
|
73400
|
+
if (nodeForCheckWriteOnly && isWriteOnlyAccess(nodeForCheckWriteOnly) && !(prop.flags & 65536 /* SetAccessor */)) {
|
|
73354
73401
|
return;
|
|
73355
73402
|
}
|
|
73356
73403
|
if (isSelfTypeAccess2) {
|
|
@@ -77664,16 +77711,6 @@ function createTypeChecker(host) {
|
|
|
77664
77711
|
addLazyDiagnostic(checkAssignmentOperatorWorker);
|
|
77665
77712
|
}
|
|
77666
77713
|
function checkAssignmentOperatorWorker() {
|
|
77667
|
-
let assigneeType = leftType;
|
|
77668
|
-
if (isCompoundAssignment(operatorToken.kind) && left.kind === 208 /* PropertyAccessExpression */) {
|
|
77669
|
-
assigneeType = checkPropertyAccessExpression(
|
|
77670
|
-
left,
|
|
77671
|
-
/*checkMode*/
|
|
77672
|
-
void 0,
|
|
77673
|
-
/*writeOnly*/
|
|
77674
|
-
true
|
|
77675
|
-
);
|
|
77676
|
-
}
|
|
77677
77714
|
if (checkReferenceExpression(
|
|
77678
77715
|
left,
|
|
77679
77716
|
Diagnostics.The_left_hand_side_of_an_assignment_expression_must_be_a_variable_or_a_property_access,
|
|
@@ -77686,7 +77723,7 @@ function createTypeChecker(host) {
|
|
|
77686
77723
|
headMessage = Diagnostics.Type_0_is_not_assignable_to_type_1_with_exactOptionalPropertyTypes_Colon_true_Consider_adding_undefined_to_the_type_of_the_target;
|
|
77687
77724
|
}
|
|
77688
77725
|
}
|
|
77689
|
-
checkTypeAssignableToAndOptionallyElaborate(valueType,
|
|
77726
|
+
checkTypeAssignableToAndOptionallyElaborate(valueType, leftType, left, right, headMessage);
|
|
77690
77727
|
}
|
|
77691
77728
|
}
|
|
77692
77729
|
}
|
|
@@ -82456,20 +82493,19 @@ function createTypeChecker(host) {
|
|
|
82456
82493
|
}
|
|
82457
82494
|
}
|
|
82458
82495
|
}
|
|
82459
|
-
function getMemberOverrideModifierStatus(node, member) {
|
|
82496
|
+
function getMemberOverrideModifierStatus(node, member, memberSymbol) {
|
|
82460
82497
|
if (!member.name) {
|
|
82461
82498
|
return 0 /* Ok */;
|
|
82462
82499
|
}
|
|
82463
|
-
const
|
|
82464
|
-
const type = getDeclaredTypeOfSymbol(
|
|
82500
|
+
const classSymbol = getSymbolOfDeclaration(node);
|
|
82501
|
+
const type = getDeclaredTypeOfSymbol(classSymbol);
|
|
82465
82502
|
const typeWithThis = getTypeWithThisArgument(type);
|
|
82466
|
-
const staticType = getTypeOfSymbol(
|
|
82503
|
+
const staticType = getTypeOfSymbol(classSymbol);
|
|
82467
82504
|
const baseTypeNode = getEffectiveBaseTypeNode(node);
|
|
82468
82505
|
const baseTypes = baseTypeNode && getBaseTypes(type);
|
|
82469
82506
|
const baseWithThis = (baseTypes == null ? void 0 : baseTypes.length) ? getTypeWithThisArgument(first(baseTypes), type.thisType) : void 0;
|
|
82470
82507
|
const baseStaticType = getBaseConstructorTypeOfClass(type);
|
|
82471
82508
|
const memberHasOverrideModifier = member.parent ? hasOverrideModifier(member) : hasSyntacticModifier(member, 16384 /* Override */);
|
|
82472
|
-
const memberName = unescapeLeadingUnderscores(getTextOfPropertyName(member.name));
|
|
82473
82509
|
return checkMemberForOverrideModifier(
|
|
82474
82510
|
node,
|
|
82475
82511
|
staticType,
|
|
@@ -82482,7 +82518,7 @@ function createTypeChecker(host) {
|
|
|
82482
82518
|
isStatic(member),
|
|
82483
82519
|
/* memberIsParameterProperty */
|
|
82484
82520
|
false,
|
|
82485
|
-
|
|
82521
|
+
symbolName(memberSymbol)
|
|
82486
82522
|
);
|
|
82487
82523
|
}
|
|
82488
82524
|
function getTargetSymbol(s) {
|
|
@@ -148269,6 +148305,7 @@ var SymbolOriginInfoKind = /* @__PURE__ */ ((SymbolOriginInfoKind2) => {
|
|
|
148269
148305
|
SymbolOriginInfoKind2[SymbolOriginInfoKind2["TypeOnlyAlias"] = 64] = "TypeOnlyAlias";
|
|
148270
148306
|
SymbolOriginInfoKind2[SymbolOriginInfoKind2["ObjectLiteralMethod"] = 128] = "ObjectLiteralMethod";
|
|
148271
148307
|
SymbolOriginInfoKind2[SymbolOriginInfoKind2["Ignore"] = 256] = "Ignore";
|
|
148308
|
+
SymbolOriginInfoKind2[SymbolOriginInfoKind2["ComputedPropertyName"] = 512] = "ComputedPropertyName";
|
|
148272
148309
|
SymbolOriginInfoKind2[SymbolOriginInfoKind2["SymbolMemberNoExport"] = 2 /* SymbolMember */] = "SymbolMemberNoExport";
|
|
148273
148310
|
SymbolOriginInfoKind2[SymbolOriginInfoKind2["SymbolMemberExport"] = 6] = "SymbolMemberExport";
|
|
148274
148311
|
return SymbolOriginInfoKind2;
|
|
@@ -148286,7 +148323,7 @@ function originIsResolvedExport(origin) {
|
|
|
148286
148323
|
return !!(origin && origin.kind === 32 /* ResolvedExport */);
|
|
148287
148324
|
}
|
|
148288
148325
|
function originIncludesSymbolName(origin) {
|
|
148289
|
-
return originIsExport(origin) || originIsResolvedExport(origin);
|
|
148326
|
+
return originIsExport(origin) || originIsResolvedExport(origin) || originIsComputedPropertyName(origin);
|
|
148290
148327
|
}
|
|
148291
148328
|
function originIsPackageJsonImport(origin) {
|
|
148292
148329
|
return (originIsExport(origin) || originIsResolvedExport(origin)) && !!origin.isFromPackageJson;
|
|
@@ -148306,6 +148343,9 @@ function originIsObjectLiteralMethod(origin) {
|
|
|
148306
148343
|
function originIsIgnore(origin) {
|
|
148307
148344
|
return !!(origin && origin.kind & 256 /* Ignore */);
|
|
148308
148345
|
}
|
|
148346
|
+
function originIsComputedPropertyName(origin) {
|
|
148347
|
+
return !!(origin && origin.kind & 512 /* ComputedPropertyName */);
|
|
148348
|
+
}
|
|
148309
148349
|
function resolvingModuleSpecifiers(logPrefix, host, resolver, program, position, preferences, isForImportStatementCompletion, isValidTypeOnlyUseSite, cb) {
|
|
148310
148350
|
var _a2, _b, _c;
|
|
148311
148351
|
const start2 = timestamp();
|
|
@@ -149032,7 +149072,7 @@ function getEntryForMemberCompletion(host, program, options, preferences, name,
|
|
|
149032
149072
|
if (isAbstract) {
|
|
149033
149073
|
requiredModifiers |= 256 /* Abstract */;
|
|
149034
149074
|
}
|
|
149035
|
-
if (isClassElement(node) && checker.getMemberOverrideModifierStatus(classLikeDeclaration, node) === 1 /* NeedsOverride */) {
|
|
149075
|
+
if (isClassElement(node) && checker.getMemberOverrideModifierStatus(classLikeDeclaration, node, symbol) === 1 /* NeedsOverride */) {
|
|
149036
149076
|
requiredModifiers |= 16384 /* Override */;
|
|
149037
149077
|
}
|
|
149038
149078
|
if (!completionNodes.length) {
|
|
@@ -149626,7 +149666,8 @@ function getCompletionEntryDetails(program, log, sourceFile, position, entryId,
|
|
|
149626
149666
|
case "symbol": {
|
|
149627
149667
|
const { symbol, location, contextToken: contextToken2, origin, previousToken: previousToken2 } = symbolCompletion;
|
|
149628
149668
|
const { codeActions, sourceDisplay } = getCompletionEntryCodeActionsAndSourceDisplay(name, location, contextToken2, origin, symbol, program, host, compilerOptions, sourceFile, position, previousToken2, formatContext, preferences, data, source, cancellationToken);
|
|
149629
|
-
|
|
149669
|
+
const symbolName2 = originIsComputedPropertyName(origin) ? origin.symbolName : symbol.name;
|
|
149670
|
+
return createCompletionDetailsForSymbol(symbol, symbolName2, typeChecker, sourceFile, location, cancellationToken, codeActions, sourceDisplay);
|
|
149630
149671
|
}
|
|
149631
149672
|
case "literal": {
|
|
149632
149673
|
const { literal } = symbolCompletion;
|
|
@@ -149677,12 +149718,12 @@ function getCompletionEntryDetails(program, log, sourceFile, position, entryId,
|
|
|
149677
149718
|
function createSimpleDetails(name, kind, kind2) {
|
|
149678
149719
|
return createCompletionDetails(name, "" /* none */, kind, [displayPart(name, kind2)]);
|
|
149679
149720
|
}
|
|
149680
|
-
function createCompletionDetailsForSymbol(symbol, checker, sourceFile, location, cancellationToken, codeActions, sourceDisplay) {
|
|
149721
|
+
function createCompletionDetailsForSymbol(symbol, name, checker, sourceFile, location, cancellationToken, codeActions, sourceDisplay) {
|
|
149681
149722
|
const { displayParts, documentation, symbolKind, tags } = checker.runWithCancellationToken(
|
|
149682
149723
|
cancellationToken,
|
|
149683
149724
|
(checker2) => ts_SymbolDisplay_exports.getSymbolDisplayPartsDocumentationAndSymbolKind(checker2, symbol, sourceFile, location, location, 7 /* All */)
|
|
149684
149725
|
);
|
|
149685
|
-
return createCompletionDetails(
|
|
149726
|
+
return createCompletionDetails(name, ts_SymbolDisplay_exports.getSymbolModifiers(checker, symbol), symbolKind, displayParts, documentation, tags, codeActions, sourceDisplay);
|
|
149686
149727
|
}
|
|
149687
149728
|
function createCompletionDetails(name, kindModifiers, kind, displayParts, documentation, tags, codeActions, source) {
|
|
149688
149729
|
return { name, kindModifiers, kind, displayParts, documentation, tags, codeActions, source, sourceDisplay: source };
|
|
@@ -150789,6 +150830,16 @@ function getCompletionData(program, log, sourceFile, compilerOptions, position,
|
|
|
150789
150830
|
return classElementModifierFlags & 32 /* Static */ ? (type == null ? void 0 : type.symbol) && typeChecker.getPropertiesOfType(typeChecker.getTypeOfSymbolAtLocation(type.symbol, decl)) : type && typeChecker.getPropertiesOfType(type);
|
|
150790
150831
|
});
|
|
150791
150832
|
symbols = concatenate(symbols, filterClassMembersList(baseSymbols, decl.members, classElementModifierFlags));
|
|
150833
|
+
forEach(symbols, (symbol, index) => {
|
|
150834
|
+
const declaration = symbol == null ? void 0 : symbol.valueDeclaration;
|
|
150835
|
+
if (declaration && isClassElement(declaration) && declaration.name && isComputedPropertyName(declaration.name)) {
|
|
150836
|
+
const origin = {
|
|
150837
|
+
kind: 512 /* ComputedPropertyName */,
|
|
150838
|
+
symbolName: typeChecker.symbolToString(symbol)
|
|
150839
|
+
};
|
|
150840
|
+
symbolToOriginInfoMap[index] = origin;
|
|
150841
|
+
}
|
|
150842
|
+
});
|
|
150792
150843
|
}
|
|
150793
150844
|
return 1 /* Success */;
|
|
150794
150845
|
}
|
|
@@ -151173,7 +151224,7 @@ function getCompletionEntryDisplayNameForSymbol(symbol, target, origin, kind, js
|
|
|
151173
151224
|
}
|
|
151174
151225
|
switch (kind) {
|
|
151175
151226
|
case 3 /* MemberLike */:
|
|
151176
|
-
return void 0;
|
|
151227
|
+
return originIsComputedPropertyName(origin) ? { name: origin.symbolName, needsConvertPropertyAccess: false } : void 0;
|
|
151177
151228
|
case 0 /* ObjectPropertyDeclaration */:
|
|
151178
151229
|
return { name: JSON.stringify(name), needsConvertPropertyAccess: false };
|
|
151179
151230
|
case 2 /* PropertyAccess */:
|
|
@@ -151765,7 +151816,7 @@ function stringLiteralCompletionDetails(name, location, completion, sourceFile,
|
|
|
151765
151816
|
}
|
|
151766
151817
|
case 1 /* Properties */: {
|
|
151767
151818
|
const match = find(completion.symbols, (s) => s.name === name);
|
|
151768
|
-
return match && createCompletionDetailsForSymbol(match, checker, sourceFile, location, cancellationToken);
|
|
151819
|
+
return match && createCompletionDetailsForSymbol(match, match.name, checker, sourceFile, location, cancellationToken);
|
|
151769
151820
|
}
|
|
151770
151821
|
case 2 /* Types */:
|
|
151771
151822
|
return find(completion.types, (t) => t.value === name) ? createCompletionDetails(name, "" /* none */, "string" /* string */, [textPart(name)]) : void 0;
|
|
@@ -169343,8 +169394,6 @@ __export(ts_exports3, {
|
|
|
169343
169394
|
isWithStatement: () => isWithStatement,
|
|
169344
169395
|
isWriteAccess: () => isWriteAccess,
|
|
169345
169396
|
isWriteOnlyAccess: () => isWriteOnlyAccess,
|
|
169346
|
-
isWriteOnlyUsage: () => isWriteOnlyUsage,
|
|
169347
|
-
isWriteUsage: () => isWriteUsage,
|
|
169348
169397
|
isYieldExpression: () => isYieldExpression,
|
|
169349
169398
|
jsxModeNeedsExplicitImport: () => jsxModeNeedsExplicitImport,
|
|
169350
169399
|
keywordPart: () => keywordPart,
|
|
@@ -183295,8 +183344,6 @@ start(initializeNodeSystem(), require("os").platform());
|
|
|
183295
183344
|
isWithStatement,
|
|
183296
183345
|
isWriteAccess,
|
|
183297
183346
|
isWriteOnlyAccess,
|
|
183298
|
-
isWriteOnlyUsage,
|
|
183299
|
-
isWriteUsage,
|
|
183300
183347
|
isYieldExpression,
|
|
183301
183348
|
jsxModeNeedsExplicitImport,
|
|
183302
183349
|
keywordPart,
|