@typescript-deploys/pr-build 5.0.0-pr-50431-13 → 5.0.0-pr-52836-9
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 +127 -112
- package/lib/tsserver.js +149 -128
- package/lib/tsserverlibrary.js +149 -126
- package/lib/typescript.js +149 -124
- 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-insiders.
|
|
38
|
+
version = `${versionMajorMinor}.0-insiders.20230218`;
|
|
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,
|
|
@@ -17391,39 +17391,20 @@ ${lanes.join("\n")}
|
|
|
17391
17391
|
function isWriteAccess(node) {
|
|
17392
17392
|
return accessKind(node) !== 0 /* Read */;
|
|
17393
17393
|
}
|
|
17394
|
-
function isWriteOnlyUsage(node) {
|
|
17395
|
-
return accessKindForUsageChecks(node) === 1 /* Write */;
|
|
17396
|
-
}
|
|
17397
|
-
function isWriteUsage(node) {
|
|
17398
|
-
return accessKindForUsageChecks(node) !== 0 /* Read */;
|
|
17399
|
-
}
|
|
17400
|
-
function accessKindForUsageChecks(node) {
|
|
17401
|
-
const kind = accessKind(node);
|
|
17402
|
-
const { parent: parent2 } = node;
|
|
17403
|
-
switch (parent2 == null ? void 0 : parent2.kind) {
|
|
17404
|
-
case 222 /* PostfixUnaryExpression */:
|
|
17405
|
-
case 221 /* PrefixUnaryExpression */:
|
|
17406
|
-
case 223 /* BinaryExpression */:
|
|
17407
|
-
return kind === 2 /* ReadWrite */ ? writeOrReadWrite() : kind;
|
|
17408
|
-
default:
|
|
17409
|
-
return kind;
|
|
17410
|
-
}
|
|
17411
|
-
function writeOrReadWrite() {
|
|
17412
|
-
return parent2.parent && walkUpParenthesizedExpressions(parent2.parent).kind === 241 /* ExpressionStatement */ ? 1 /* Write */ : 2 /* ReadWrite */;
|
|
17413
|
-
}
|
|
17414
|
-
}
|
|
17415
17394
|
function accessKind(node) {
|
|
17416
17395
|
const { parent: parent2 } = node;
|
|
17417
|
-
|
|
17396
|
+
if (!parent2)
|
|
17397
|
+
return 0 /* Read */;
|
|
17398
|
+
switch (parent2.kind) {
|
|
17418
17399
|
case 214 /* ParenthesizedExpression */:
|
|
17419
17400
|
return accessKind(parent2);
|
|
17420
17401
|
case 222 /* PostfixUnaryExpression */:
|
|
17421
17402
|
case 221 /* PrefixUnaryExpression */:
|
|
17422
17403
|
const { operator } = parent2;
|
|
17423
|
-
return operator === 45 /* PlusPlusToken */ || operator === 46 /* MinusMinusToken */ ?
|
|
17404
|
+
return operator === 45 /* PlusPlusToken */ || operator === 46 /* MinusMinusToken */ ? writeOrReadWrite() : 0 /* Read */;
|
|
17424
17405
|
case 223 /* BinaryExpression */:
|
|
17425
17406
|
const { left, operatorToken } = parent2;
|
|
17426
|
-
return left === node && isAssignmentOperator(operatorToken.kind) ? operatorToken.kind === 63 /* EqualsToken */ ? 1 /* Write */ :
|
|
17407
|
+
return left === node && isAssignmentOperator(operatorToken.kind) ? operatorToken.kind === 63 /* EqualsToken */ ? 1 /* Write */ : writeOrReadWrite() : 0 /* Read */;
|
|
17427
17408
|
case 208 /* PropertyAccessExpression */:
|
|
17428
17409
|
return parent2.name !== node ? 0 /* Read */ : accessKind(parent2);
|
|
17429
17410
|
case 299 /* PropertyAssignment */: {
|
|
@@ -17437,6 +17418,9 @@ ${lanes.join("\n")}
|
|
|
17437
17418
|
default:
|
|
17438
17419
|
return 0 /* Read */;
|
|
17439
17420
|
}
|
|
17421
|
+
function writeOrReadWrite() {
|
|
17422
|
+
return parent2.parent && walkUpParenthesizedExpressions(parent2.parent).kind === 241 /* ExpressionStatement */ ? 1 /* Write */ : 2 /* ReadWrite */;
|
|
17423
|
+
}
|
|
17440
17424
|
}
|
|
17441
17425
|
function reverseAccessKind(a) {
|
|
17442
17426
|
switch (a) {
|
|
@@ -28480,22 +28464,22 @@ ${lanes.join("\n")}
|
|
|
28480
28464
|
[356 /* PartiallyEmittedExpression */]: forEachChildInPartiallyEmittedExpression
|
|
28481
28465
|
};
|
|
28482
28466
|
((Parser2) => {
|
|
28483
|
-
|
|
28467
|
+
var scanner2 = createScanner(
|
|
28484
28468
|
99 /* Latest */,
|
|
28485
28469
|
/*skipTrivia*/
|
|
28486
28470
|
true
|
|
28487
28471
|
);
|
|
28488
|
-
|
|
28489
|
-
|
|
28490
|
-
|
|
28491
|
-
|
|
28492
|
-
|
|
28493
|
-
|
|
28472
|
+
var disallowInAndDecoratorContext = 4096 /* DisallowInContext */ | 16384 /* DecoratorContext */;
|
|
28473
|
+
var NodeConstructor2;
|
|
28474
|
+
var TokenConstructor2;
|
|
28475
|
+
var IdentifierConstructor2;
|
|
28476
|
+
var PrivateIdentifierConstructor2;
|
|
28477
|
+
var SourceFileConstructor2;
|
|
28494
28478
|
function countNode(node) {
|
|
28495
28479
|
nodeCount++;
|
|
28496
28480
|
return node;
|
|
28497
28481
|
}
|
|
28498
|
-
|
|
28482
|
+
var baseNodeFactory = {
|
|
28499
28483
|
createBaseSourceFileNode: (kind) => countNode(new SourceFileConstructor2(
|
|
28500
28484
|
kind,
|
|
28501
28485
|
/*pos*/
|
|
@@ -28532,25 +28516,25 @@ ${lanes.join("\n")}
|
|
|
28532
28516
|
0
|
|
28533
28517
|
))
|
|
28534
28518
|
};
|
|
28535
|
-
|
|
28536
|
-
|
|
28537
|
-
|
|
28538
|
-
|
|
28539
|
-
|
|
28540
|
-
|
|
28541
|
-
|
|
28542
|
-
|
|
28543
|
-
|
|
28544
|
-
|
|
28545
|
-
|
|
28546
|
-
|
|
28547
|
-
|
|
28548
|
-
|
|
28549
|
-
|
|
28550
|
-
|
|
28551
|
-
|
|
28552
|
-
|
|
28553
|
-
|
|
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;
|
|
28554
28538
|
function parseSourceFile(fileName2, sourceText2, languageVersion2, syntaxCursor2, setParentNodes = false, scriptKind2, setExternalModuleIndicatorOverride) {
|
|
28555
28539
|
var _a2;
|
|
28556
28540
|
scriptKind2 = ensureScriptKind(fileName2, scriptKind2);
|
|
@@ -32057,13 +32041,9 @@ ${lanes.join("\n")}
|
|
|
32057
32041
|
function parseJsxClosingFragment(inExpressionContext) {
|
|
32058
32042
|
const pos = getNodePos();
|
|
32059
32043
|
parseExpected(30 /* LessThanSlashToken */);
|
|
32060
|
-
if (tokenIsIdentifierOrKeyword(token())) {
|
|
32061
|
-
parseErrorAtRange(parseJsxElementName(), Diagnostics.Expected_corresponding_closing_tag_for_JSX_fragment);
|
|
32062
|
-
}
|
|
32063
32044
|
if (parseExpected(
|
|
32064
32045
|
31 /* GreaterThanToken */,
|
|
32065
|
-
|
|
32066
|
-
void 0,
|
|
32046
|
+
Diagnostics.Expected_corresponding_closing_tag_for_JSX_fragment,
|
|
32067
32047
|
/*shouldAdvance*/
|
|
32068
32048
|
false
|
|
32069
32049
|
)) {
|
|
@@ -49723,7 +49703,7 @@ ${lanes.join("\n")}
|
|
|
49723
49703
|
return result;
|
|
49724
49704
|
}
|
|
49725
49705
|
function createAnonymousTypeNode(type2) {
|
|
49726
|
-
var _a3;
|
|
49706
|
+
var _a3, _b2;
|
|
49727
49707
|
const typeId = type2.id;
|
|
49728
49708
|
const symbol = type2.symbol;
|
|
49729
49709
|
if (symbol) {
|
|
@@ -49749,6 +49729,20 @@ ${lanes.join("\n")}
|
|
|
49749
49729
|
return visitAndTransformType(type2, createTypeNodeFromObjectType);
|
|
49750
49730
|
}
|
|
49751
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
|
+
}
|
|
49752
49746
|
return createTypeNodeFromObjectType(type2);
|
|
49753
49747
|
}
|
|
49754
49748
|
function shouldWriteTypeOfFunctionSymbol() {
|
|
@@ -50257,7 +50251,7 @@ ${lanes.join("\n")}
|
|
|
50257
50251
|
);
|
|
50258
50252
|
}
|
|
50259
50253
|
function signatureToSignatureDeclarationHelper(signature, kind, context, options) {
|
|
50260
|
-
var _a2, _b, _c, _d;
|
|
50254
|
+
var _a2, _b, _c, _d, _e;
|
|
50261
50255
|
const suppressAny = context.flags & 256 /* SuppressAnyReturnType */;
|
|
50262
50256
|
if (suppressAny)
|
|
50263
50257
|
context.flags &= ~256 /* SuppressAnyReturnType */;
|
|
@@ -50274,6 +50268,39 @@ ${lanes.join("\n")}
|
|
|
50274
50268
|
/*skipUnionExpanding*/
|
|
50275
50269
|
true
|
|
50276
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
|
+
}
|
|
50277
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));
|
|
50278
50305
|
const thisParameter = context.flags & 33554432 /* OmitThisParameter */ ? void 0 : tryGetThisParameterDeclaration(signature, context);
|
|
50279
50306
|
if (thisParameter) {
|
|
@@ -50299,11 +50326,11 @@ ${lanes.join("\n")}
|
|
|
50299
50326
|
const flags = modifiersToFlags(modifiers);
|
|
50300
50327
|
modifiers = factory.createModifiersFromModifierFlags(flags | 256 /* Abstract */);
|
|
50301
50328
|
}
|
|
50302
|
-
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(
|
|
50303
50330
|
modifiers,
|
|
50304
50331
|
/*asteriskToken*/
|
|
50305
50332
|
void 0,
|
|
50306
|
-
(
|
|
50333
|
+
(_c = options == null ? void 0 : options.name) != null ? _c : factory.createIdentifier(""),
|
|
50307
50334
|
/*questionToken*/
|
|
50308
50335
|
void 0,
|
|
50309
50336
|
typeParameters,
|
|
@@ -50318,14 +50345,14 @@ ${lanes.join("\n")}
|
|
|
50318
50345
|
void 0
|
|
50319
50346
|
) : kind === 174 /* GetAccessor */ ? factory.createGetAccessorDeclaration(
|
|
50320
50347
|
modifiers,
|
|
50321
|
-
(
|
|
50348
|
+
(_d = options == null ? void 0 : options.name) != null ? _d : factory.createIdentifier(""),
|
|
50322
50349
|
parameters,
|
|
50323
50350
|
returnTypeNode,
|
|
50324
50351
|
/*body*/
|
|
50325
50352
|
void 0
|
|
50326
50353
|
) : kind === 175 /* SetAccessor */ ? factory.createSetAccessorDeclaration(
|
|
50327
50354
|
modifiers,
|
|
50328
|
-
(
|
|
50355
|
+
(_e = options == null ? void 0 : options.name) != null ? _e : factory.createIdentifier(""),
|
|
50329
50356
|
parameters,
|
|
50330
50357
|
/*body*/
|
|
50331
50358
|
void 0
|
|
@@ -50360,6 +50387,7 @@ ${lanes.join("\n")}
|
|
|
50360
50387
|
if (typeArguments) {
|
|
50361
50388
|
node.typeArguments = factory.createNodeArray(typeArguments);
|
|
50362
50389
|
}
|
|
50390
|
+
cleanup == null ? void 0 : cleanup();
|
|
50363
50391
|
return node;
|
|
50364
50392
|
}
|
|
50365
50393
|
function tryGetThisParameterDeclaration(signature, context) {
|
|
@@ -50974,9 +51002,12 @@ ${lanes.join("\n")}
|
|
|
50974
51002
|
function existingTypeNodeIsNotReferenceOrIsReferenceWithCompatibleTypeArgumentCount(existing, type) {
|
|
50975
51003
|
return !(getObjectFlags(type) & 4 /* Reference */) || !isTypeReferenceNode(existing) || length(existing.typeArguments) >= getMinTypeArgumentCount(type.target.typeParameters);
|
|
50976
51004
|
}
|
|
51005
|
+
function getEnclosingDeclarationIgnoringFakeScope(enclosingDeclaration) {
|
|
51006
|
+
return getNodeLinks(enclosingDeclaration).fakeScopeForSignatureDeclaration ? enclosingDeclaration.parent : enclosingDeclaration;
|
|
51007
|
+
}
|
|
50977
51008
|
function serializeTypeForDeclaration(context, type, symbol, enclosingDeclaration, includePrivateSymbol, bundled) {
|
|
50978
51009
|
if (!isErrorType(type) && enclosingDeclaration) {
|
|
50979
|
-
const declWithExistingAnnotation = getDeclarationWithTypeAnnotation(symbol, enclosingDeclaration);
|
|
51010
|
+
const declWithExistingAnnotation = getDeclarationWithTypeAnnotation(symbol, getEnclosingDeclarationIgnoringFakeScope(enclosingDeclaration));
|
|
50980
51011
|
if (declWithExistingAnnotation && !isFunctionLikeDeclaration(declWithExistingAnnotation) && !isGetAccessorDeclaration(declWithExistingAnnotation)) {
|
|
50981
51012
|
const existing = getEffectiveTypeAnnotationNode(declWithExistingAnnotation);
|
|
50982
51013
|
if (typeNodeIsEquivalentToType(existing, declWithExistingAnnotation, type) && existingTypeNodeIsNotReferenceOrIsReferenceWithCompatibleTypeArgumentCount(existing, type)) {
|
|
@@ -51008,7 +51039,8 @@ ${lanes.join("\n")}
|
|
|
51008
51039
|
function serializeReturnTypeForSignature(context, type, signature, includePrivateSymbol, bundled) {
|
|
51009
51040
|
if (!isErrorType(type) && context.enclosingDeclaration) {
|
|
51010
51041
|
const annotation = signature.declaration && getEffectiveReturnTypeNode(signature.declaration);
|
|
51011
|
-
|
|
51042
|
+
const enclosingDeclarationIgnoringFakeScope = getEnclosingDeclarationIgnoringFakeScope(context.enclosingDeclaration);
|
|
51043
|
+
if (!!findAncestor(annotation, (n) => n === enclosingDeclarationIgnoringFakeScope) && annotation) {
|
|
51012
51044
|
const annotated = getTypeFromTypeNode(annotation);
|
|
51013
51045
|
const thisInstantiated = annotated.flags & 262144 /* TypeParameter */ && annotated.isThisType ? instantiateType(annotated, signature.mapper) : annotated;
|
|
51014
51046
|
if (thisInstantiated === type && existingTypeNodeIsNotReferenceOrIsReferenceWithCompatibleTypeArgumentCount(annotation, type)) {
|
|
@@ -58770,31 +58802,21 @@ ${lanes.join("\n")}
|
|
|
58770
58802
|
}
|
|
58771
58803
|
return type;
|
|
58772
58804
|
function addSpans(texts2, types2) {
|
|
58773
|
-
const isTextsArray = isArray(texts2);
|
|
58774
58805
|
for (let i = 0; i < types2.length; i++) {
|
|
58775
58806
|
const t = types2[i];
|
|
58776
|
-
const addText = isTextsArray ? texts2[i + 1] : texts2;
|
|
58777
58807
|
if (t.flags & (2944 /* Literal */ | 65536 /* Null */ | 32768 /* Undefined */)) {
|
|
58778
58808
|
text += getTemplateStringForType(t) || "";
|
|
58779
|
-
text +=
|
|
58780
|
-
if (!isTextsArray)
|
|
58781
|
-
return true;
|
|
58809
|
+
text += texts2[i + 1];
|
|
58782
58810
|
} else if (t.flags & 134217728 /* TemplateLiteral */) {
|
|
58783
58811
|
text += t.texts[0];
|
|
58784
58812
|
if (!addSpans(t.texts, t.types))
|
|
58785
58813
|
return false;
|
|
58786
|
-
text +=
|
|
58787
|
-
|
|
58788
|
-
return true;
|
|
58789
|
-
} else if (isGenericIndexType(t) || isPatternLiteralPlaceholderType(t)) {
|
|
58814
|
+
text += texts2[i + 1];
|
|
58815
|
+
} else if (isGenericIndexType(t) || isPatternLiteralPlaceholderType(t) || t.flags & 2097152 /* Intersection */) {
|
|
58790
58816
|
newTypes.push(t);
|
|
58791
58817
|
newTexts.push(text);
|
|
58792
|
-
text =
|
|
58793
|
-
} else
|
|
58794
|
-
const added = addSpans(texts2[i + 1], t.types);
|
|
58795
|
-
if (!added)
|
|
58796
|
-
return false;
|
|
58797
|
-
} else if (isTextsArray) {
|
|
58818
|
+
text = texts2[i + 1];
|
|
58819
|
+
} else {
|
|
58798
58820
|
return false;
|
|
58799
58821
|
}
|
|
58800
58822
|
}
|
|
@@ -65786,7 +65808,7 @@ ${lanes.join("\n")}
|
|
|
65786
65808
|
111551 /* Value */ | 1048576 /* ExportValue */,
|
|
65787
65809
|
getCannotFindNameDiagnosticForName(node),
|
|
65788
65810
|
node,
|
|
65789
|
-
!
|
|
65811
|
+
!isWriteOnlyAccess(node),
|
|
65790
65812
|
/*excludeGlobals*/
|
|
65791
65813
|
false
|
|
65792
65814
|
) || unknownSymbol;
|
|
@@ -70604,8 +70626,8 @@ ${lanes.join("\n")}
|
|
|
70604
70626
|
}
|
|
70605
70627
|
return nonNullType;
|
|
70606
70628
|
}
|
|
70607
|
-
function checkPropertyAccessExpression(node, checkMode
|
|
70608
|
-
return node.flags & 32 /* OptionalChain */ ? checkPropertyAccessChain(node, checkMode) : checkPropertyAccessExpressionOrQualifiedName(node, node.expression, checkNonNullExpression(node.expression), node.name, checkMode
|
|
70629
|
+
function checkPropertyAccessExpression(node, checkMode) {
|
|
70630
|
+
return node.flags & 32 /* OptionalChain */ ? checkPropertyAccessChain(node, checkMode) : checkPropertyAccessExpressionOrQualifiedName(node, node.expression, checkNonNullExpression(node.expression), node.name, checkMode);
|
|
70609
70631
|
}
|
|
70610
70632
|
function checkPropertyAccessChain(node, checkMode) {
|
|
70611
70633
|
const leftType = checkExpression(node.expression);
|
|
@@ -70736,7 +70758,7 @@ ${lanes.join("\n")}
|
|
|
70736
70758
|
false
|
|
70737
70759
|
) === getDeclaringConstructor(prop);
|
|
70738
70760
|
}
|
|
70739
|
-
function checkPropertyAccessExpressionOrQualifiedName(node, left, leftType, right, checkMode
|
|
70761
|
+
function checkPropertyAccessExpressionOrQualifiedName(node, left, leftType, right, checkMode) {
|
|
70740
70762
|
const parentSymbol = getNodeLinks(left).resolvedSymbol;
|
|
70741
70763
|
const assignmentKind = getAssignmentTargetKind(node);
|
|
70742
70764
|
const apparentType = getApparentType(assignmentKind !== 0 /* None */ || isMethodAccessForCall(node) ? getWidenedType(leftType) : leftType);
|
|
@@ -70835,12 +70857,13 @@ ${lanes.join("\n")}
|
|
|
70835
70857
|
checkPropertyNotUsedBeforeDeclaration(prop, node, right);
|
|
70836
70858
|
markPropertyAsReferenced(prop, node, isSelfTypeAccess(left, parentSymbol));
|
|
70837
70859
|
getNodeLinks(node).resolvedSymbol = prop;
|
|
70838
|
-
|
|
70860
|
+
const writing = isWriteAccess(node);
|
|
70861
|
+
checkPropertyAccessibility(node, left.kind === 106 /* SuperKeyword */, writing, apparentType, prop);
|
|
70839
70862
|
if (isAssignmentToReadonlyEntity(node, prop, assignmentKind)) {
|
|
70840
70863
|
error(right, Diagnostics.Cannot_assign_to_0_because_it_is_a_read_only_property, idText(right));
|
|
70841
70864
|
return errorType;
|
|
70842
70865
|
}
|
|
70843
|
-
propType = isThisPropertyAccessInConstructor(node, prop) ? autoType :
|
|
70866
|
+
propType = isThisPropertyAccessInConstructor(node, prop) ? autoType : writing ? getWriteTypeOfSymbol(prop) : getTypeOfSymbol(prop);
|
|
70844
70867
|
}
|
|
70845
70868
|
return getFlowTypeOfAccessExpression(node, prop, propType, right, checkMode);
|
|
70846
70869
|
}
|
|
@@ -71156,7 +71179,7 @@ ${lanes.join("\n")}
|
|
|
71156
71179
|
if (!hasPrivateModifier && !hasPrivateIdentifier) {
|
|
71157
71180
|
return;
|
|
71158
71181
|
}
|
|
71159
|
-
if (nodeForCheckWriteOnly &&
|
|
71182
|
+
if (nodeForCheckWriteOnly && isWriteOnlyAccess(nodeForCheckWriteOnly) && !(prop.flags & 65536 /* SetAccessor */)) {
|
|
71160
71183
|
return;
|
|
71161
71184
|
}
|
|
71162
71185
|
if (isSelfTypeAccess2) {
|
|
@@ -75470,16 +75493,6 @@ ${lanes.join("\n")}
|
|
|
75470
75493
|
addLazyDiagnostic(checkAssignmentOperatorWorker);
|
|
75471
75494
|
}
|
|
75472
75495
|
function checkAssignmentOperatorWorker() {
|
|
75473
|
-
let assigneeType = leftType;
|
|
75474
|
-
if (isCompoundAssignment(operatorToken.kind) && left.kind === 208 /* PropertyAccessExpression */) {
|
|
75475
|
-
assigneeType = checkPropertyAccessExpression(
|
|
75476
|
-
left,
|
|
75477
|
-
/*checkMode*/
|
|
75478
|
-
void 0,
|
|
75479
|
-
/*writeOnly*/
|
|
75480
|
-
true
|
|
75481
|
-
);
|
|
75482
|
-
}
|
|
75483
75496
|
if (checkReferenceExpression(
|
|
75484
75497
|
left,
|
|
75485
75498
|
Diagnostics.The_left_hand_side_of_an_assignment_expression_must_be_a_variable_or_a_property_access,
|
|
@@ -75492,7 +75505,7 @@ ${lanes.join("\n")}
|
|
|
75492
75505
|
headMessage = Diagnostics.Type_0_is_not_assignable_to_type_1_with_exactOptionalPropertyTypes_Colon_true_Consider_adding_undefined_to_the_type_of_the_target;
|
|
75493
75506
|
}
|
|
75494
75507
|
}
|
|
75495
|
-
checkTypeAssignableToAndOptionallyElaborate(valueType,
|
|
75508
|
+
checkTypeAssignableToAndOptionallyElaborate(valueType, leftType, left, right, headMessage);
|
|
75496
75509
|
}
|
|
75497
75510
|
}
|
|
75498
75511
|
}
|
|
@@ -80262,20 +80275,19 @@ ${lanes.join("\n")}
|
|
|
80262
80275
|
}
|
|
80263
80276
|
}
|
|
80264
80277
|
}
|
|
80265
|
-
function getMemberOverrideModifierStatus(node, member) {
|
|
80278
|
+
function getMemberOverrideModifierStatus(node, member, memberSymbol) {
|
|
80266
80279
|
if (!member.name) {
|
|
80267
80280
|
return 0 /* Ok */;
|
|
80268
80281
|
}
|
|
80269
|
-
const
|
|
80270
|
-
const type = getDeclaredTypeOfSymbol(
|
|
80282
|
+
const classSymbol = getSymbolOfDeclaration(node);
|
|
80283
|
+
const type = getDeclaredTypeOfSymbol(classSymbol);
|
|
80271
80284
|
const typeWithThis = getTypeWithThisArgument(type);
|
|
80272
|
-
const staticType = getTypeOfSymbol(
|
|
80285
|
+
const staticType = getTypeOfSymbol(classSymbol);
|
|
80273
80286
|
const baseTypeNode = getEffectiveBaseTypeNode(node);
|
|
80274
80287
|
const baseTypes = baseTypeNode && getBaseTypes(type);
|
|
80275
80288
|
const baseWithThis = (baseTypes == null ? void 0 : baseTypes.length) ? getTypeWithThisArgument(first(baseTypes), type.thisType) : void 0;
|
|
80276
80289
|
const baseStaticType = getBaseConstructorTypeOfClass(type);
|
|
80277
80290
|
const memberHasOverrideModifier = member.parent ? hasOverrideModifier(member) : hasSyntacticModifier(member, 16384 /* Override */);
|
|
80278
|
-
const memberName = unescapeLeadingUnderscores(getTextOfPropertyName(member.name));
|
|
80279
80291
|
return checkMemberForOverrideModifier(
|
|
80280
80292
|
node,
|
|
80281
80293
|
staticType,
|
|
@@ -80288,7 +80300,7 @@ ${lanes.join("\n")}
|
|
|
80288
80300
|
isStatic(member),
|
|
80289
80301
|
/* memberIsParameterProperty */
|
|
80290
80302
|
false,
|
|
80291
|
-
|
|
80303
|
+
symbolName(memberSymbol)
|
|
80292
80304
|
);
|
|
80293
80305
|
}
|
|
80294
80306
|
function getTargetSymbol(s) {
|
|
@@ -147338,7 +147350,7 @@ ${lanes.join("\n")}
|
|
|
147338
147350
|
return !!(origin && origin.kind === 32 /* ResolvedExport */);
|
|
147339
147351
|
}
|
|
147340
147352
|
function originIncludesSymbolName(origin) {
|
|
147341
|
-
return originIsExport(origin) || originIsResolvedExport(origin);
|
|
147353
|
+
return originIsExport(origin) || originIsResolvedExport(origin) || originIsComputedPropertyName(origin);
|
|
147342
147354
|
}
|
|
147343
147355
|
function originIsPackageJsonImport(origin) {
|
|
147344
147356
|
return (originIsExport(origin) || originIsResolvedExport(origin)) && !!origin.isFromPackageJson;
|
|
@@ -147358,6 +147370,9 @@ ${lanes.join("\n")}
|
|
|
147358
147370
|
function originIsIgnore(origin) {
|
|
147359
147371
|
return !!(origin && origin.kind & 256 /* Ignore */);
|
|
147360
147372
|
}
|
|
147373
|
+
function originIsComputedPropertyName(origin) {
|
|
147374
|
+
return !!(origin && origin.kind & 512 /* ComputedPropertyName */);
|
|
147375
|
+
}
|
|
147361
147376
|
function resolvingModuleSpecifiers(logPrefix, host, resolver, program, position, preferences, isForImportStatementCompletion, isValidTypeOnlyUseSite, cb) {
|
|
147362
147377
|
var _a2, _b, _c;
|
|
147363
147378
|
const start = timestamp();
|
|
@@ -148084,7 +148099,7 @@ ${lanes.join("\n")}
|
|
|
148084
148099
|
if (isAbstract) {
|
|
148085
148100
|
requiredModifiers |= 256 /* Abstract */;
|
|
148086
148101
|
}
|
|
148087
|
-
if (isClassElement(node) && checker.getMemberOverrideModifierStatus(classLikeDeclaration, node) === 1 /* NeedsOverride */) {
|
|
148102
|
+
if (isClassElement(node) && checker.getMemberOverrideModifierStatus(classLikeDeclaration, node, symbol) === 1 /* NeedsOverride */) {
|
|
148088
148103
|
requiredModifiers |= 16384 /* Override */;
|
|
148089
148104
|
}
|
|
148090
148105
|
if (!completionNodes.length) {
|
|
@@ -148678,7 +148693,8 @@ ${lanes.join("\n")}
|
|
|
148678
148693
|
case "symbol": {
|
|
148679
148694
|
const { symbol, location, contextToken: contextToken2, origin, previousToken: previousToken2 } = symbolCompletion;
|
|
148680
148695
|
const { codeActions, sourceDisplay } = getCompletionEntryCodeActionsAndSourceDisplay(name, location, contextToken2, origin, symbol, program, host, compilerOptions, sourceFile, position, previousToken2, formatContext, preferences, data, source, cancellationToken);
|
|
148681
|
-
|
|
148696
|
+
const symbolName2 = originIsComputedPropertyName(origin) ? origin.symbolName : symbol.name;
|
|
148697
|
+
return createCompletionDetailsForSymbol(symbol, symbolName2, typeChecker, sourceFile, location, cancellationToken, codeActions, sourceDisplay);
|
|
148682
148698
|
}
|
|
148683
148699
|
case "literal": {
|
|
148684
148700
|
const { literal } = symbolCompletion;
|
|
@@ -148729,12 +148745,12 @@ ${lanes.join("\n")}
|
|
|
148729
148745
|
function createSimpleDetails(name, kind, kind2) {
|
|
148730
148746
|
return createCompletionDetails(name, "" /* none */, kind, [displayPart(name, kind2)]);
|
|
148731
148747
|
}
|
|
148732
|
-
function createCompletionDetailsForSymbol(symbol, checker, sourceFile, location, cancellationToken, codeActions, sourceDisplay) {
|
|
148748
|
+
function createCompletionDetailsForSymbol(symbol, name, checker, sourceFile, location, cancellationToken, codeActions, sourceDisplay) {
|
|
148733
148749
|
const { displayParts, documentation, symbolKind, tags } = checker.runWithCancellationToken(
|
|
148734
148750
|
cancellationToken,
|
|
148735
148751
|
(checker2) => ts_SymbolDisplay_exports.getSymbolDisplayPartsDocumentationAndSymbolKind(checker2, symbol, sourceFile, location, location, 7 /* All */)
|
|
148736
148752
|
);
|
|
148737
|
-
return createCompletionDetails(
|
|
148753
|
+
return createCompletionDetails(name, ts_SymbolDisplay_exports.getSymbolModifiers(checker, symbol), symbolKind, displayParts, documentation, tags, codeActions, sourceDisplay);
|
|
148738
148754
|
}
|
|
148739
148755
|
function createCompletionDetails(name, kindModifiers, kind, displayParts, documentation, tags, codeActions, source) {
|
|
148740
148756
|
return { name, kindModifiers, kind, displayParts, documentation, tags, codeActions, source, sourceDisplay: source };
|
|
@@ -149832,6 +149848,16 @@ ${lanes.join("\n")}
|
|
|
149832
149848
|
return classElementModifierFlags & 32 /* Static */ ? (type == null ? void 0 : type.symbol) && typeChecker.getPropertiesOfType(typeChecker.getTypeOfSymbolAtLocation(type.symbol, decl)) : type && typeChecker.getPropertiesOfType(type);
|
|
149833
149849
|
});
|
|
149834
149850
|
symbols = concatenate(symbols, filterClassMembersList(baseSymbols, decl.members, classElementModifierFlags));
|
|
149851
|
+
forEach(symbols, (symbol, index) => {
|
|
149852
|
+
const declaration = symbol == null ? void 0 : symbol.valueDeclaration;
|
|
149853
|
+
if (declaration && isClassElement(declaration) && declaration.name && isComputedPropertyName(declaration.name)) {
|
|
149854
|
+
const origin = {
|
|
149855
|
+
kind: 512 /* ComputedPropertyName */,
|
|
149856
|
+
symbolName: typeChecker.symbolToString(symbol)
|
|
149857
|
+
};
|
|
149858
|
+
symbolToOriginInfoMap[index] = origin;
|
|
149859
|
+
}
|
|
149860
|
+
});
|
|
149835
149861
|
}
|
|
149836
149862
|
return 1 /* Success */;
|
|
149837
149863
|
}
|
|
@@ -150216,7 +150242,7 @@ ${lanes.join("\n")}
|
|
|
150216
150242
|
}
|
|
150217
150243
|
switch (kind) {
|
|
150218
150244
|
case 3 /* MemberLike */:
|
|
150219
|
-
return void 0;
|
|
150245
|
+
return originIsComputedPropertyName(origin) ? { name: origin.symbolName, needsConvertPropertyAccess: false } : void 0;
|
|
150220
150246
|
case 0 /* ObjectPropertyDeclaration */:
|
|
150221
150247
|
return { name: JSON.stringify(name), needsConvertPropertyAccess: false };
|
|
150222
150248
|
case 2 /* PropertyAccess */:
|
|
@@ -150724,6 +150750,7 @@ ${lanes.join("\n")}
|
|
|
150724
150750
|
SymbolOriginInfoKind2[SymbolOriginInfoKind2["TypeOnlyAlias"] = 64] = "TypeOnlyAlias";
|
|
150725
150751
|
SymbolOriginInfoKind2[SymbolOriginInfoKind2["ObjectLiteralMethod"] = 128] = "ObjectLiteralMethod";
|
|
150726
150752
|
SymbolOriginInfoKind2[SymbolOriginInfoKind2["Ignore"] = 256] = "Ignore";
|
|
150753
|
+
SymbolOriginInfoKind2[SymbolOriginInfoKind2["ComputedPropertyName"] = 512] = "ComputedPropertyName";
|
|
150727
150754
|
SymbolOriginInfoKind2[SymbolOriginInfoKind2["SymbolMemberNoExport"] = 2 /* SymbolMember */] = "SymbolMemberNoExport";
|
|
150728
150755
|
SymbolOriginInfoKind2[SymbolOriginInfoKind2["SymbolMemberExport"] = 6] = "SymbolMemberExport";
|
|
150729
150756
|
return SymbolOriginInfoKind2;
|
|
@@ -150859,7 +150886,7 @@ ${lanes.join("\n")}
|
|
|
150859
150886
|
}
|
|
150860
150887
|
case 1 /* Properties */: {
|
|
150861
150888
|
const match = find(completion.symbols, (s) => s.name === name);
|
|
150862
|
-
return match && createCompletionDetailsForSymbol(match, checker, sourceFile, location, cancellationToken);
|
|
150889
|
+
return match && createCompletionDetailsForSymbol(match, match.name, checker, sourceFile, location, cancellationToken);
|
|
150863
150890
|
}
|
|
150864
150891
|
case 2 /* Types */:
|
|
150865
150892
|
return find(completion.types, (t) => t.value === name) ? createCompletionDetails(name, "" /* none */, "string" /* string */, [textPart(name)]) : void 0;
|
|
@@ -179927,8 +179954,6 @@ ${e.message}`;
|
|
|
179927
179954
|
isWithStatement: () => isWithStatement,
|
|
179928
179955
|
isWriteAccess: () => isWriteAccess,
|
|
179929
179956
|
isWriteOnlyAccess: () => isWriteOnlyAccess,
|
|
179930
|
-
isWriteOnlyUsage: () => isWriteOnlyUsage,
|
|
179931
|
-
isWriteUsage: () => isWriteUsage,
|
|
179932
179957
|
isYieldExpression: () => isYieldExpression,
|
|
179933
179958
|
jsxModeNeedsExplicitImport: () => jsxModeNeedsExplicitImport,
|
|
179934
179959
|
keywordPart: () => keywordPart,
|
|
@@ -182289,8 +182314,6 @@ ${e.message}`;
|
|
|
182289
182314
|
isWithStatement: () => isWithStatement,
|
|
182290
182315
|
isWriteAccess: () => isWriteAccess,
|
|
182291
182316
|
isWriteOnlyAccess: () => isWriteOnlyAccess,
|
|
182292
|
-
isWriteOnlyUsage: () => isWriteOnlyUsage,
|
|
182293
|
-
isWriteUsage: () => isWriteUsage,
|
|
182294
182317
|
isYieldExpression: () => isYieldExpression,
|
|
182295
182318
|
jsxModeNeedsExplicitImport: () => jsxModeNeedsExplicitImport,
|
|
182296
182319
|
keywordPart: () => keywordPart,
|