typescript 5.0.0-dev.20230216 → 5.0.0-dev.20230218
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 +141 -68
- package/lib/tsserver.js +247 -92
- package/lib/tsserverlibrary.d.ts +13 -0
- package/lib/tsserverlibrary.js +246 -92
- package/lib/typescript.d.ts +13 -0
- package/lib/typescript.js +245 -92
- package/lib/typingsInstaller.js +41 -46
- 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.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,
|
|
@@ -13027,6 +13027,36 @@ ${lanes.join("\n")}
|
|
|
13027
13027
|
function nodeIsPresent(node) {
|
|
13028
13028
|
return !nodeIsMissing(node);
|
|
13029
13029
|
}
|
|
13030
|
+
function isGrammarError(parent2, child) {
|
|
13031
|
+
if (isTypeParameterDeclaration(parent2))
|
|
13032
|
+
return child === parent2.expression;
|
|
13033
|
+
if (isClassStaticBlockDeclaration(parent2))
|
|
13034
|
+
return child === parent2.modifiers;
|
|
13035
|
+
if (isPropertySignature(parent2))
|
|
13036
|
+
return child === parent2.initializer;
|
|
13037
|
+
if (isPropertyDeclaration(parent2))
|
|
13038
|
+
return child === parent2.questionToken && isAutoAccessorPropertyDeclaration(parent2);
|
|
13039
|
+
if (isPropertyAssignment(parent2))
|
|
13040
|
+
return child === parent2.modifiers || child === parent2.questionToken || child === parent2.exclamationToken || isGrammarErrorElement(parent2.modifiers, child, isModifierLike);
|
|
13041
|
+
if (isShorthandPropertyAssignment(parent2))
|
|
13042
|
+
return child === parent2.equalsToken || child === parent2.modifiers || child === parent2.questionToken || child === parent2.exclamationToken || isGrammarErrorElement(parent2.modifiers, child, isModifierLike);
|
|
13043
|
+
if (isMethodDeclaration(parent2))
|
|
13044
|
+
return child === parent2.exclamationToken;
|
|
13045
|
+
if (isConstructorDeclaration(parent2))
|
|
13046
|
+
return child === parent2.typeParameters || child === parent2.type || isGrammarErrorElement(parent2.typeParameters, child, isTypeParameterDeclaration);
|
|
13047
|
+
if (isGetAccessorDeclaration(parent2))
|
|
13048
|
+
return child === parent2.typeParameters || isGrammarErrorElement(parent2.typeParameters, child, isTypeParameterDeclaration);
|
|
13049
|
+
if (isSetAccessorDeclaration(parent2))
|
|
13050
|
+
return child === parent2.typeParameters || child === parent2.type || isGrammarErrorElement(parent2.typeParameters, child, isTypeParameterDeclaration);
|
|
13051
|
+
if (isNamespaceExportDeclaration(parent2))
|
|
13052
|
+
return child === parent2.modifiers || isGrammarErrorElement(parent2.modifiers, child, isModifierLike);
|
|
13053
|
+
return false;
|
|
13054
|
+
}
|
|
13055
|
+
function isGrammarErrorElement(nodeArray, child, isElement) {
|
|
13056
|
+
if (!nodeArray || isArray(child) || !isElement(child))
|
|
13057
|
+
return false;
|
|
13058
|
+
return contains(nodeArray, child);
|
|
13059
|
+
}
|
|
13030
13060
|
function insertStatementsAfterPrologue(to, from, isPrologueDirective2) {
|
|
13031
13061
|
if (from === void 0 || from.length === 0)
|
|
13032
13062
|
return to;
|
|
@@ -27168,7 +27198,7 @@ ${lanes.join("\n")}
|
|
|
27168
27198
|
}
|
|
27169
27199
|
function canHaveIllegalModifiers(node) {
|
|
27170
27200
|
const kind = node.kind;
|
|
27171
|
-
return kind === 172 /* ClassStaticBlockDeclaration */ || kind === 299 /* PropertyAssignment */ || kind === 300 /* ShorthandPropertyAssignment */ || kind ===
|
|
27201
|
+
return kind === 172 /* ClassStaticBlockDeclaration */ || kind === 299 /* PropertyAssignment */ || kind === 300 /* ShorthandPropertyAssignment */ || kind === 279 /* MissingDeclaration */ || kind === 267 /* NamespaceExportDeclaration */;
|
|
27172
27202
|
}
|
|
27173
27203
|
function isQuestionOrExclamationToken(node) {
|
|
27174
27204
|
return isQuestionToken(node) || isExclamationToken(node);
|
|
@@ -28434,22 +28464,22 @@ ${lanes.join("\n")}
|
|
|
28434
28464
|
[356 /* PartiallyEmittedExpression */]: forEachChildInPartiallyEmittedExpression
|
|
28435
28465
|
};
|
|
28436
28466
|
((Parser2) => {
|
|
28437
|
-
|
|
28467
|
+
var scanner2 = createScanner(
|
|
28438
28468
|
99 /* Latest */,
|
|
28439
28469
|
/*skipTrivia*/
|
|
28440
28470
|
true
|
|
28441
28471
|
);
|
|
28442
|
-
|
|
28443
|
-
|
|
28444
|
-
|
|
28445
|
-
|
|
28446
|
-
|
|
28447
|
-
|
|
28472
|
+
var disallowInAndDecoratorContext = 4096 /* DisallowInContext */ | 16384 /* DecoratorContext */;
|
|
28473
|
+
var NodeConstructor2;
|
|
28474
|
+
var TokenConstructor2;
|
|
28475
|
+
var IdentifierConstructor2;
|
|
28476
|
+
var PrivateIdentifierConstructor2;
|
|
28477
|
+
var SourceFileConstructor2;
|
|
28448
28478
|
function countNode(node) {
|
|
28449
28479
|
nodeCount++;
|
|
28450
28480
|
return node;
|
|
28451
28481
|
}
|
|
28452
|
-
|
|
28482
|
+
var baseNodeFactory = {
|
|
28453
28483
|
createBaseSourceFileNode: (kind) => countNode(new SourceFileConstructor2(
|
|
28454
28484
|
kind,
|
|
28455
28485
|
/*pos*/
|
|
@@ -28486,25 +28516,25 @@ ${lanes.join("\n")}
|
|
|
28486
28516
|
0
|
|
28487
28517
|
))
|
|
28488
28518
|
};
|
|
28489
|
-
|
|
28490
|
-
|
|
28491
|
-
|
|
28492
|
-
|
|
28493
|
-
|
|
28494
|
-
|
|
28495
|
-
|
|
28496
|
-
|
|
28497
|
-
|
|
28498
|
-
|
|
28499
|
-
|
|
28500
|
-
|
|
28501
|
-
|
|
28502
|
-
|
|
28503
|
-
|
|
28504
|
-
|
|
28505
|
-
|
|
28506
|
-
|
|
28507
|
-
|
|
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;
|
|
28508
28538
|
function parseSourceFile(fileName2, sourceText2, languageVersion2, syntaxCursor2, setParentNodes = false, scriptKind2, setExternalModuleIndicatorOverride) {
|
|
28509
28539
|
var _a2;
|
|
28510
28540
|
scriptKind2 = ensureScriptKind(fileName2, scriptKind2);
|
|
@@ -30706,6 +30736,7 @@ ${lanes.join("\n")}
|
|
|
30706
30736
|
const hasJSDoc = hasPrecedingJSDocComment();
|
|
30707
30737
|
const modifiers = parseModifiersForConstructorType();
|
|
30708
30738
|
const isConstructorType = parseOptional(103 /* NewKeyword */);
|
|
30739
|
+
Debug.assert(!modifiers || isConstructorType, "Per isStartOfFunctionOrConstructorType, a function type cannot have modifiers.");
|
|
30709
30740
|
const typeParameters = parseTypeParameters();
|
|
30710
30741
|
const parameters = parseParameters(4 /* Type */);
|
|
30711
30742
|
const type = parseReturnType(
|
|
@@ -30714,8 +30745,6 @@ ${lanes.join("\n")}
|
|
|
30714
30745
|
false
|
|
30715
30746
|
);
|
|
30716
30747
|
const node = isConstructorType ? factory2.createConstructorTypeNode(modifiers, typeParameters, parameters, type) : factory2.createFunctionTypeNode(typeParameters, parameters, type);
|
|
30717
|
-
if (!isConstructorType)
|
|
30718
|
-
node.modifiers = modifiers;
|
|
30719
30748
|
return withJSDoc(finishNode(node, pos), hasJSDoc);
|
|
30720
30749
|
}
|
|
30721
30750
|
function parseKeywordAndNoDot() {
|
|
@@ -32012,13 +32041,9 @@ ${lanes.join("\n")}
|
|
|
32012
32041
|
function parseJsxClosingFragment(inExpressionContext) {
|
|
32013
32042
|
const pos = getNodePos();
|
|
32014
32043
|
parseExpected(30 /* LessThanSlashToken */);
|
|
32015
|
-
if (tokenIsIdentifierOrKeyword(token())) {
|
|
32016
|
-
parseErrorAtRange(parseJsxElementName(), Diagnostics.Expected_corresponding_closing_tag_for_JSX_fragment);
|
|
32017
|
-
}
|
|
32018
32044
|
if (parseExpected(
|
|
32019
32045
|
31 /* GreaterThanToken */,
|
|
32020
|
-
|
|
32021
|
-
void 0,
|
|
32046
|
+
Diagnostics.Expected_corresponding_closing_tag_for_JSX_fragment,
|
|
32022
32047
|
/*shouldAdvance*/
|
|
32023
32048
|
false
|
|
32024
32049
|
)) {
|
|
@@ -44970,6 +44995,7 @@ ${lanes.join("\n")}
|
|
|
44970
44995
|
let inlineLevel = 0;
|
|
44971
44996
|
let currentNode;
|
|
44972
44997
|
let varianceTypeParameter;
|
|
44998
|
+
let isInferencePartiallyBlocked = false;
|
|
44973
44999
|
const emptySymbols = createSymbolTable();
|
|
44974
45000
|
const arrayVariances = [1 /* Covariant */];
|
|
44975
45001
|
const compilerOptions = host.getCompilerOptions();
|
|
@@ -45401,7 +45427,9 @@ ${lanes.join("\n")}
|
|
|
45401
45427
|
toMarkSkip = toMarkSkip.parent;
|
|
45402
45428
|
} while (toMarkSkip && toMarkSkip !== containingCall);
|
|
45403
45429
|
}
|
|
45430
|
+
isInferencePartiallyBlocked = true;
|
|
45404
45431
|
const result = runWithoutResolvedSignatureCaching(node, fn);
|
|
45432
|
+
isInferencePartiallyBlocked = false;
|
|
45405
45433
|
if (containingCall) {
|
|
45406
45434
|
let toMarkSkip = node;
|
|
45407
45435
|
do {
|
|
@@ -49675,7 +49703,7 @@ ${lanes.join("\n")}
|
|
|
49675
49703
|
return result;
|
|
49676
49704
|
}
|
|
49677
49705
|
function createAnonymousTypeNode(type2) {
|
|
49678
|
-
var _a3;
|
|
49706
|
+
var _a3, _b2;
|
|
49679
49707
|
const typeId = type2.id;
|
|
49680
49708
|
const symbol = type2.symbol;
|
|
49681
49709
|
if (symbol) {
|
|
@@ -49701,6 +49729,20 @@ ${lanes.join("\n")}
|
|
|
49701
49729
|
return visitAndTransformType(type2, createTypeNodeFromObjectType);
|
|
49702
49730
|
}
|
|
49703
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
|
+
}
|
|
49704
49746
|
return createTypeNodeFromObjectType(type2);
|
|
49705
49747
|
}
|
|
49706
49748
|
function shouldWriteTypeOfFunctionSymbol() {
|
|
@@ -50209,7 +50251,7 @@ ${lanes.join("\n")}
|
|
|
50209
50251
|
);
|
|
50210
50252
|
}
|
|
50211
50253
|
function signatureToSignatureDeclarationHelper(signature, kind, context, options) {
|
|
50212
|
-
var _a2, _b, _c, _d;
|
|
50254
|
+
var _a2, _b, _c, _d, _e;
|
|
50213
50255
|
const suppressAny = context.flags & 256 /* SuppressAnyReturnType */;
|
|
50214
50256
|
if (suppressAny)
|
|
50215
50257
|
context.flags &= ~256 /* SuppressAnyReturnType */;
|
|
@@ -50226,6 +50268,39 @@ ${lanes.join("\n")}
|
|
|
50226
50268
|
/*skipUnionExpanding*/
|
|
50227
50269
|
true
|
|
50228
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
|
+
}
|
|
50229
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));
|
|
50230
50305
|
const thisParameter = context.flags & 33554432 /* OmitThisParameter */ ? void 0 : tryGetThisParameterDeclaration(signature, context);
|
|
50231
50306
|
if (thisParameter) {
|
|
@@ -50251,11 +50326,11 @@ ${lanes.join("\n")}
|
|
|
50251
50326
|
const flags = modifiersToFlags(modifiers);
|
|
50252
50327
|
modifiers = factory.createModifiersFromModifierFlags(flags | 256 /* Abstract */);
|
|
50253
50328
|
}
|
|
50254
|
-
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(
|
|
50255
50330
|
modifiers,
|
|
50256
50331
|
/*asteriskToken*/
|
|
50257
50332
|
void 0,
|
|
50258
|
-
(
|
|
50333
|
+
(_c = options == null ? void 0 : options.name) != null ? _c : factory.createIdentifier(""),
|
|
50259
50334
|
/*questionToken*/
|
|
50260
50335
|
void 0,
|
|
50261
50336
|
typeParameters,
|
|
@@ -50270,14 +50345,14 @@ ${lanes.join("\n")}
|
|
|
50270
50345
|
void 0
|
|
50271
50346
|
) : kind === 174 /* GetAccessor */ ? factory.createGetAccessorDeclaration(
|
|
50272
50347
|
modifiers,
|
|
50273
|
-
(
|
|
50348
|
+
(_d = options == null ? void 0 : options.name) != null ? _d : factory.createIdentifier(""),
|
|
50274
50349
|
parameters,
|
|
50275
50350
|
returnTypeNode,
|
|
50276
50351
|
/*body*/
|
|
50277
50352
|
void 0
|
|
50278
50353
|
) : kind === 175 /* SetAccessor */ ? factory.createSetAccessorDeclaration(
|
|
50279
50354
|
modifiers,
|
|
50280
|
-
(
|
|
50355
|
+
(_e = options == null ? void 0 : options.name) != null ? _e : factory.createIdentifier(""),
|
|
50281
50356
|
parameters,
|
|
50282
50357
|
/*body*/
|
|
50283
50358
|
void 0
|
|
@@ -50312,6 +50387,7 @@ ${lanes.join("\n")}
|
|
|
50312
50387
|
if (typeArguments) {
|
|
50313
50388
|
node.typeArguments = factory.createNodeArray(typeArguments);
|
|
50314
50389
|
}
|
|
50390
|
+
cleanup == null ? void 0 : cleanup();
|
|
50315
50391
|
return node;
|
|
50316
50392
|
}
|
|
50317
50393
|
function tryGetThisParameterDeclaration(signature, context) {
|
|
@@ -50926,9 +51002,12 @@ ${lanes.join("\n")}
|
|
|
50926
51002
|
function existingTypeNodeIsNotReferenceOrIsReferenceWithCompatibleTypeArgumentCount(existing, type) {
|
|
50927
51003
|
return !(getObjectFlags(type) & 4 /* Reference */) || !isTypeReferenceNode(existing) || length(existing.typeArguments) >= getMinTypeArgumentCount(type.target.typeParameters);
|
|
50928
51004
|
}
|
|
51005
|
+
function getEnclosingDeclarationIgnoringFakeScope(enclosingDeclaration) {
|
|
51006
|
+
return getNodeLinks(enclosingDeclaration).fakeScopeForSignatureDeclaration ? enclosingDeclaration.parent : enclosingDeclaration;
|
|
51007
|
+
}
|
|
50929
51008
|
function serializeTypeForDeclaration(context, type, symbol, enclosingDeclaration, includePrivateSymbol, bundled) {
|
|
50930
51009
|
if (!isErrorType(type) && enclosingDeclaration) {
|
|
50931
|
-
const declWithExistingAnnotation = getDeclarationWithTypeAnnotation(symbol, enclosingDeclaration);
|
|
51010
|
+
const declWithExistingAnnotation = getDeclarationWithTypeAnnotation(symbol, getEnclosingDeclarationIgnoringFakeScope(enclosingDeclaration));
|
|
50932
51011
|
if (declWithExistingAnnotation && !isFunctionLikeDeclaration(declWithExistingAnnotation) && !isGetAccessorDeclaration(declWithExistingAnnotation)) {
|
|
50933
51012
|
const existing = getEffectiveTypeAnnotationNode(declWithExistingAnnotation);
|
|
50934
51013
|
if (typeNodeIsEquivalentToType(existing, declWithExistingAnnotation, type) && existingTypeNodeIsNotReferenceOrIsReferenceWithCompatibleTypeArgumentCount(existing, type)) {
|
|
@@ -50960,7 +51039,8 @@ ${lanes.join("\n")}
|
|
|
50960
51039
|
function serializeReturnTypeForSignature(context, type, signature, includePrivateSymbol, bundled) {
|
|
50961
51040
|
if (!isErrorType(type) && context.enclosingDeclaration) {
|
|
50962
51041
|
const annotation = signature.declaration && getEffectiveReturnTypeNode(signature.declaration);
|
|
50963
|
-
|
|
51042
|
+
const enclosingDeclarationIgnoringFakeScope = getEnclosingDeclarationIgnoringFakeScope(context.enclosingDeclaration);
|
|
51043
|
+
if (!!findAncestor(annotation, (n) => n === enclosingDeclarationIgnoringFakeScope) && annotation) {
|
|
50964
51044
|
const annotated = getTypeFromTypeNode(annotation);
|
|
50965
51045
|
const thisInstantiated = annotated.flags & 262144 /* TypeParameter */ && annotated.isThisType ? instantiateType(annotated, signature.mapper) : annotated;
|
|
50966
51046
|
if (thisInstantiated === type && existingTypeNodeIsNotReferenceOrIsReferenceWithCompatibleTypeArgumentCount(annotation, type)) {
|
|
@@ -55447,6 +55527,7 @@ ${lanes.join("\n")}
|
|
|
55447
55527
|
const typeParameter = getTypeParameterFromMappedType(type);
|
|
55448
55528
|
const constraintType = getConstraintTypeFromMappedType(type);
|
|
55449
55529
|
const nameType = getNameTypeFromMappedType(type.target || type);
|
|
55530
|
+
const isFilteringMappedType = nameType && isTypeAssignableTo(nameType, typeParameter);
|
|
55450
55531
|
const templateType = getTemplateTypeFromMappedType(type.target || type);
|
|
55451
55532
|
const modifiersType = getApparentType(getModifiersTypeFromMappedType(type));
|
|
55452
55533
|
const templateModifiers = getMappedTypeModifiers(type);
|
|
@@ -55484,7 +55565,7 @@ ${lanes.join("\n")}
|
|
|
55484
55565
|
prop.links.keyType = keyType;
|
|
55485
55566
|
if (modifiersProp) {
|
|
55486
55567
|
prop.links.syntheticOrigin = modifiersProp;
|
|
55487
|
-
prop.declarations = nameType
|
|
55568
|
+
prop.declarations = !nameType || isFilteringMappedType ? modifiersProp.declarations : void 0;
|
|
55488
55569
|
}
|
|
55489
55570
|
members.set(propName, prop);
|
|
55490
55571
|
}
|
|
@@ -64216,6 +64297,9 @@ ${lanes.join("\n")}
|
|
|
64216
64297
|
const key = `B${getTypeId(type)}`;
|
|
64217
64298
|
return (_a2 = getCachedType(key)) != null ? _a2 : setCachedType(key, mapType(type, getBaseTypeOfLiteralType));
|
|
64218
64299
|
}
|
|
64300
|
+
function getBaseTypeOfLiteralTypeForComparison(type) {
|
|
64301
|
+
return type.flags & (128 /* StringLiteral */ | 134217728 /* TemplateLiteral */ | 268435456 /* StringMapping */) ? stringType : type.flags & (256 /* NumberLiteral */ | 32 /* Enum */) ? numberType : type.flags & 2048 /* BigIntLiteral */ ? bigintType : type.flags & 512 /* BooleanLiteral */ ? booleanType : type.flags & 1048576 /* Union */ ? mapType(type, getBaseTypeOfLiteralTypeForComparison) : type;
|
|
64302
|
+
}
|
|
64219
64303
|
function getWidenedLiteralType(type) {
|
|
64220
64304
|
return type.flags & 1056 /* EnumLike */ && isFreshLiteralType(type) ? getBaseTypeOfEnumLikeType(type) : type.flags & 128 /* StringLiteral */ && isFreshLiteralType(type) ? stringType : type.flags & 256 /* NumberLiteral */ && isFreshLiteralType(type) ? numberType : type.flags & 2048 /* BigIntLiteral */ && isFreshLiteralType(type) ? bigintType : type.flags & 512 /* BooleanLiteral */ && isFreshLiteralType(type) ? booleanType : type.flags & 1048576 /* Union */ ? mapType(type, getWidenedLiteralType) : type;
|
|
64221
64305
|
}
|
|
@@ -72040,7 +72124,7 @@ ${lanes.join("\n")}
|
|
|
72040
72124
|
const isTaggedTemplate = node.kind === 212 /* TaggedTemplateExpression */;
|
|
72041
72125
|
const isDecorator2 = node.kind === 167 /* Decorator */;
|
|
72042
72126
|
const isJsxOpeningOrSelfClosingElement = isJsxOpeningLikeElement(node);
|
|
72043
|
-
const reportErrors2 = !candidatesOutArray;
|
|
72127
|
+
const reportErrors2 = !isInferencePartiallyBlocked && !candidatesOutArray;
|
|
72044
72128
|
let typeArguments;
|
|
72045
72129
|
if (!isDecorator2 && !isSuperCall(node)) {
|
|
72046
72130
|
typeArguments = node.typeArguments;
|
|
@@ -75281,8 +75365,8 @@ ${lanes.join("\n")}
|
|
|
75281
75365
|
case 32 /* LessThanEqualsToken */:
|
|
75282
75366
|
case 33 /* GreaterThanEqualsToken */:
|
|
75283
75367
|
if (checkForDisallowedESSymbolOperand(operator)) {
|
|
75284
|
-
leftType =
|
|
75285
|
-
rightType =
|
|
75368
|
+
leftType = getBaseTypeOfLiteralTypeForComparison(checkNonNullType(leftType, left));
|
|
75369
|
+
rightType = getBaseTypeOfLiteralTypeForComparison(checkNonNullType(rightType, right));
|
|
75286
75370
|
reportOperatorErrorUnless((left2, right2) => {
|
|
75287
75371
|
if (isTypeAny(left2) || isTypeAny(right2)) {
|
|
75288
75372
|
return true;
|
|
@@ -77118,6 +77202,17 @@ ${lanes.join("\n")}
|
|
|
77118
77202
|
lastSeenNonAmbientDeclaration = node;
|
|
77119
77203
|
}
|
|
77120
77204
|
}
|
|
77205
|
+
if (isInJSFile(current) && isFunctionLike(current) && current.jsDoc) {
|
|
77206
|
+
for (const node2 of current.jsDoc) {
|
|
77207
|
+
if (node2.tags) {
|
|
77208
|
+
for (const tag of node2.tags) {
|
|
77209
|
+
if (isJSDocOverloadTag(tag)) {
|
|
77210
|
+
hasOverloads = true;
|
|
77211
|
+
}
|
|
77212
|
+
}
|
|
77213
|
+
}
|
|
77214
|
+
}
|
|
77215
|
+
}
|
|
77121
77216
|
}
|
|
77122
77217
|
}
|
|
77123
77218
|
if (multipleConstructorImplementation) {
|
|
@@ -77155,8 +77250,9 @@ ${lanes.join("\n")}
|
|
|
77155
77250
|
const bodySignature = getSignatureFromDeclaration(bodyDeclaration);
|
|
77156
77251
|
for (const signature of signatures) {
|
|
77157
77252
|
if (!isImplementationCompatibleWithOverload(bodySignature, signature)) {
|
|
77253
|
+
const errorNode = signature.declaration && isJSDocSignature(signature.declaration) ? signature.declaration.parent.tagName : signature.declaration;
|
|
77158
77254
|
addRelatedInfo(
|
|
77159
|
-
error(
|
|
77255
|
+
error(errorNode, Diagnostics.This_overload_signature_is_not_compatible_with_its_implementation_signature),
|
|
77160
77256
|
createDiagnosticForNode(bodyDeclaration, Diagnostics.The_implementation_signature_is_declared_here)
|
|
77161
77257
|
);
|
|
77162
77258
|
break;
|
|
@@ -80189,20 +80285,19 @@ ${lanes.join("\n")}
|
|
|
80189
80285
|
}
|
|
80190
80286
|
}
|
|
80191
80287
|
}
|
|
80192
|
-
function getMemberOverrideModifierStatus(node, member) {
|
|
80288
|
+
function getMemberOverrideModifierStatus(node, member, memberSymbol) {
|
|
80193
80289
|
if (!member.name) {
|
|
80194
80290
|
return 0 /* Ok */;
|
|
80195
80291
|
}
|
|
80196
|
-
const
|
|
80197
|
-
const type = getDeclaredTypeOfSymbol(
|
|
80292
|
+
const classSymbol = getSymbolOfDeclaration(node);
|
|
80293
|
+
const type = getDeclaredTypeOfSymbol(classSymbol);
|
|
80198
80294
|
const typeWithThis = getTypeWithThisArgument(type);
|
|
80199
|
-
const staticType = getTypeOfSymbol(
|
|
80295
|
+
const staticType = getTypeOfSymbol(classSymbol);
|
|
80200
80296
|
const baseTypeNode = getEffectiveBaseTypeNode(node);
|
|
80201
80297
|
const baseTypes = baseTypeNode && getBaseTypes(type);
|
|
80202
80298
|
const baseWithThis = (baseTypes == null ? void 0 : baseTypes.length) ? getTypeWithThisArgument(first(baseTypes), type.thisType) : void 0;
|
|
80203
80299
|
const baseStaticType = getBaseConstructorTypeOfClass(type);
|
|
80204
80300
|
const memberHasOverrideModifier = member.parent ? hasOverrideModifier(member) : hasSyntacticModifier(member, 16384 /* Override */);
|
|
80205
|
-
const memberName = unescapeLeadingUnderscores(getTextOfPropertyName(member.name));
|
|
80206
80301
|
return checkMemberForOverrideModifier(
|
|
80207
80302
|
node,
|
|
80208
80303
|
staticType,
|
|
@@ -80215,7 +80310,7 @@ ${lanes.join("\n")}
|
|
|
80215
80310
|
isStatic(member),
|
|
80216
80311
|
/* memberIsParameterProperty */
|
|
80217
80312
|
false,
|
|
80218
|
-
|
|
80313
|
+
symbolName(memberSymbol)
|
|
80219
80314
|
);
|
|
80220
80315
|
}
|
|
80221
80316
|
function getTargetSymbol(s) {
|
|
@@ -83772,7 +83867,6 @@ ${lanes.join("\n")}
|
|
|
83772
83867
|
case 299 /* PropertyAssignment */:
|
|
83773
83868
|
case 300 /* ShorthandPropertyAssignment */:
|
|
83774
83869
|
case 267 /* NamespaceExportDeclaration */:
|
|
83775
|
-
case 181 /* FunctionType */:
|
|
83776
83870
|
case 279 /* MissingDeclaration */:
|
|
83777
83871
|
return find(node.modifiers, isModifier);
|
|
83778
83872
|
default:
|
|
@@ -90366,7 +90460,16 @@ ${lanes.join("\n")}
|
|
|
90366
90460
|
visitNode(node.initializer, (child) => namedEvaluationVisitor(child, referencedName), isExpression)
|
|
90367
90461
|
);
|
|
90368
90462
|
}
|
|
90369
|
-
return
|
|
90463
|
+
return factory2.updatePropertyDeclaration(
|
|
90464
|
+
node,
|
|
90465
|
+
visitNodes2(node.modifiers, modifierVisitor, isModifier),
|
|
90466
|
+
visitNode(node.name, propertyNameVisitor, isPropertyName),
|
|
90467
|
+
/*questionOrExclamationToken*/
|
|
90468
|
+
void 0,
|
|
90469
|
+
/*type*/
|
|
90470
|
+
void 0,
|
|
90471
|
+
visitNode(node.initializer, visitor, isExpression)
|
|
90472
|
+
);
|
|
90370
90473
|
}
|
|
90371
90474
|
function transformPublicFieldInitializer(node) {
|
|
90372
90475
|
if (shouldTransformInitializers && !isAutoAccessorPropertyDeclaration(node)) {
|
|
@@ -133196,7 +133299,8 @@ ${lanes.join("\n")}
|
|
|
133196
133299
|
options.triggerCharacter,
|
|
133197
133300
|
options.triggerKind,
|
|
133198
133301
|
cancellationToken,
|
|
133199
|
-
formattingSettings && ts_formatting_exports.getFormatContext(formattingSettings, host)
|
|
133302
|
+
formattingSettings && ts_formatting_exports.getFormatContext(formattingSettings, host),
|
|
133303
|
+
options.includeSymbol
|
|
133200
133304
|
);
|
|
133201
133305
|
}
|
|
133202
133306
|
function getCompletionEntryDetails2(fileName, position, name, formattingOptions, source, preferences = emptyOptions, data) {
|
|
@@ -146120,7 +146224,14 @@ ${lanes.join("\n")}
|
|
|
146120
146224
|
changeTracker.replaceNode(file, declaration, property);
|
|
146121
146225
|
}
|
|
146122
146226
|
function updatePropertyAssignmentDeclaration(changeTracker, file, declaration, fieldName) {
|
|
146123
|
-
|
|
146227
|
+
let assignment = factory.updatePropertyAssignment(declaration, fieldName, declaration.initializer);
|
|
146228
|
+
if (assignment.modifiers || assignment.questionToken || assignment.exclamationToken) {
|
|
146229
|
+
if (assignment === declaration)
|
|
146230
|
+
assignment = factory.cloneNode(assignment);
|
|
146231
|
+
assignment.modifiers = void 0;
|
|
146232
|
+
assignment.questionToken = void 0;
|
|
146233
|
+
assignment.exclamationToken = void 0;
|
|
146234
|
+
}
|
|
146124
146235
|
changeTracker.replacePropertyAssignment(file, declaration, assignment);
|
|
146125
146236
|
}
|
|
146126
146237
|
function updateFieldDeclaration(changeTracker, file, declaration, type, fieldName, modifiers) {
|
|
@@ -147249,7 +147360,7 @@ ${lanes.join("\n")}
|
|
|
147249
147360
|
return !!(origin && origin.kind === 32 /* ResolvedExport */);
|
|
147250
147361
|
}
|
|
147251
147362
|
function originIncludesSymbolName(origin) {
|
|
147252
|
-
return originIsExport(origin) || originIsResolvedExport(origin);
|
|
147363
|
+
return originIsExport(origin) || originIsResolvedExport(origin) || originIsComputedPropertyName(origin);
|
|
147253
147364
|
}
|
|
147254
147365
|
function originIsPackageJsonImport(origin) {
|
|
147255
147366
|
return (originIsExport(origin) || originIsResolvedExport(origin)) && !!origin.isFromPackageJson;
|
|
@@ -147269,6 +147380,9 @@ ${lanes.join("\n")}
|
|
|
147269
147380
|
function originIsIgnore(origin) {
|
|
147270
147381
|
return !!(origin && origin.kind & 256 /* Ignore */);
|
|
147271
147382
|
}
|
|
147383
|
+
function originIsComputedPropertyName(origin) {
|
|
147384
|
+
return !!(origin && origin.kind & 512 /* ComputedPropertyName */);
|
|
147385
|
+
}
|
|
147272
147386
|
function resolvingModuleSpecifiers(logPrefix, host, resolver, program, position, preferences, isForImportStatementCompletion, isValidTypeOnlyUseSite, cb) {
|
|
147273
147387
|
var _a2, _b, _c;
|
|
147274
147388
|
const start = timestamp();
|
|
@@ -147311,7 +147425,7 @@ ${lanes.join("\n")}
|
|
|
147311
147425
|
return result2 || (needsFullResolution ? "failed" : "skipped");
|
|
147312
147426
|
}
|
|
147313
147427
|
}
|
|
147314
|
-
function getCompletionsAtPosition(host, program, log, sourceFile, position, preferences, triggerCharacter, completionKind, cancellationToken, formatContext) {
|
|
147428
|
+
function getCompletionsAtPosition(host, program, log, sourceFile, position, preferences, triggerCharacter, completionKind, cancellationToken, formatContext, includeSymbol = false) {
|
|
147315
147429
|
var _a2;
|
|
147316
147430
|
const { previousToken } = getRelevantTokens(position, sourceFile);
|
|
147317
147431
|
if (triggerCharacter && !isInString(sourceFile, position, previousToken) && !isValidTrigger(sourceFile, triggerCharacter, previousToken, position)) {
|
|
@@ -147333,7 +147447,7 @@ ${lanes.join("\n")}
|
|
|
147333
147447
|
} else {
|
|
147334
147448
|
incompleteCompletionsCache == null ? void 0 : incompleteCompletionsCache.clear();
|
|
147335
147449
|
}
|
|
147336
|
-
const stringCompletions = ts_Completions_StringCompletions_exports.getStringLiteralCompletions(sourceFile, position, previousToken, compilerOptions, host, program, log, preferences);
|
|
147450
|
+
const stringCompletions = ts_Completions_StringCompletions_exports.getStringLiteralCompletions(sourceFile, position, previousToken, compilerOptions, host, program, log, preferences, includeSymbol);
|
|
147337
147451
|
if (stringCompletions) {
|
|
147338
147452
|
return stringCompletions;
|
|
147339
147453
|
}
|
|
@@ -147358,7 +147472,7 @@ ${lanes.join("\n")}
|
|
|
147358
147472
|
}
|
|
147359
147473
|
switch (completionData.kind) {
|
|
147360
147474
|
case 0 /* Data */:
|
|
147361
|
-
const response = completionInfoFromData(sourceFile, host, program, compilerOptions, log, completionData, preferences, formatContext, position);
|
|
147475
|
+
const response = completionInfoFromData(sourceFile, host, program, compilerOptions, log, completionData, preferences, formatContext, position, includeSymbol);
|
|
147362
147476
|
if (response == null ? void 0 : response.isIncomplete) {
|
|
147363
147477
|
incompleteCompletionsCache == null ? void 0 : incompleteCompletionsCache.set(response);
|
|
147364
147478
|
}
|
|
@@ -147488,7 +147602,7 @@ ${lanes.join("\n")}
|
|
|
147488
147602
|
function getOptionalReplacementSpan(location) {
|
|
147489
147603
|
return (location == null ? void 0 : location.kind) === 79 /* Identifier */ ? createTextSpanFromNode(location) : void 0;
|
|
147490
147604
|
}
|
|
147491
|
-
function completionInfoFromData(sourceFile, host, program, compilerOptions, log, completionData, preferences, formatContext, position) {
|
|
147605
|
+
function completionInfoFromData(sourceFile, host, program, compilerOptions, log, completionData, preferences, formatContext, position, includeSymbol) {
|
|
147492
147606
|
const {
|
|
147493
147607
|
symbols,
|
|
147494
147608
|
contextToken,
|
|
@@ -147562,7 +147676,8 @@ ${lanes.join("\n")}
|
|
|
147562
147676
|
symbolToOriginInfoMap,
|
|
147563
147677
|
symbolToSortTextMap,
|
|
147564
147678
|
isJsxIdentifierExpected,
|
|
147565
|
-
isRightOfOpenTag
|
|
147679
|
+
isRightOfOpenTag,
|
|
147680
|
+
includeSymbol
|
|
147566
147681
|
);
|
|
147567
147682
|
if (keywordFilters !== 0 /* None */) {
|
|
147568
147683
|
for (const keywordEntry of getKeywordCompletions(keywordFilters, !insideJsDocTagTypeExpression && isSourceFileJS(sourceFile))) {
|
|
@@ -147811,7 +147926,7 @@ ${lanes.join("\n")}
|
|
|
147811
147926
|
function createCompletionEntryForLiteral(sourceFile, preferences, literal) {
|
|
147812
147927
|
return { name: completionNameForLiteral(sourceFile, preferences, literal), kind: "string" /* string */, kindModifiers: "" /* none */, sortText: SortText.LocationPriority };
|
|
147813
147928
|
}
|
|
147814
|
-
function createCompletionEntry(symbol, sortText, replacementToken, contextToken, location, position, sourceFile, host, program, name, needsConvertPropertyAccess, origin, recommendedCompletion, propertyAccessToConvert, isJsxInitializer, importStatementCompletion, useSemicolons, options, preferences, completionKind, formatContext, isJsxIdentifierExpected, isRightOfOpenTag) {
|
|
147929
|
+
function createCompletionEntry(symbol, sortText, replacementToken, contextToken, location, position, sourceFile, host, program, name, needsConvertPropertyAccess, origin, recommendedCompletion, propertyAccessToConvert, isJsxInitializer, importStatementCompletion, useSemicolons, options, preferences, completionKind, formatContext, isJsxIdentifierExpected, isRightOfOpenTag, includeSymbol) {
|
|
147815
147930
|
let insertText;
|
|
147816
147931
|
let replacementSpan = getReplacementSpanForContextToken(replacementToken);
|
|
147817
147932
|
let data;
|
|
@@ -147855,7 +147970,9 @@ ${lanes.join("\n")}
|
|
|
147855
147970
|
}
|
|
147856
147971
|
awaitText += `(await ${propertyAccessToConvert.expression.getText()})`;
|
|
147857
147972
|
insertText = needsConvertPropertyAccess ? `${awaitText}${insertText}` : `${awaitText}${insertQuestionDot ? "?." : "."}${insertText}`;
|
|
147858
|
-
|
|
147973
|
+
const isInAwaitExpression = tryCast(propertyAccessToConvert.parent, isAwaitExpression);
|
|
147974
|
+
const wrapNode = isInAwaitExpression ? propertyAccessToConvert.parent : propertyAccessToConvert.expression;
|
|
147975
|
+
replacementSpan = createTextSpanFromBounds(wrapNode.getStart(sourceFile), propertyAccessToConvert.end);
|
|
147859
147976
|
}
|
|
147860
147977
|
if (originIsResolvedExport(origin)) {
|
|
147861
147978
|
sourceDisplay = [textPart(origin.moduleSpecifier)];
|
|
@@ -147923,7 +148040,8 @@ ${lanes.join("\n")}
|
|
|
147923
148040
|
isSnippet,
|
|
147924
148041
|
isPackageJsonImport: originIsPackageJsonImport(origin) || void 0,
|
|
147925
148042
|
isImportStatementCompletion: !!importStatementCompletion || void 0,
|
|
147926
|
-
data
|
|
148043
|
+
data,
|
|
148044
|
+
...includeSymbol ? { symbol } : void 0
|
|
147927
148045
|
};
|
|
147928
148046
|
}
|
|
147929
148047
|
function isClassLikeMemberCompletion(symbol, location, sourceFile) {
|
|
@@ -147991,7 +148109,7 @@ ${lanes.join("\n")}
|
|
|
147991
148109
|
if (isAbstract) {
|
|
147992
148110
|
requiredModifiers |= 256 /* Abstract */;
|
|
147993
148111
|
}
|
|
147994
|
-
if (isClassElement(node) && checker.getMemberOverrideModifierStatus(classLikeDeclaration, node) === 1 /* NeedsOverride */) {
|
|
148112
|
+
if (isClassElement(node) && checker.getMemberOverrideModifierStatus(classLikeDeclaration, node, symbol) === 1 /* NeedsOverride */) {
|
|
147995
148113
|
requiredModifiers |= 16384 /* Override */;
|
|
147996
148114
|
}
|
|
147997
148115
|
if (!completionNodes.length) {
|
|
@@ -148393,7 +148511,7 @@ ${lanes.join("\n")}
|
|
|
148393
148511
|
return "TypeOnlyAlias/" /* TypeOnlyAlias */;
|
|
148394
148512
|
}
|
|
148395
148513
|
}
|
|
148396
|
-
function getCompletionEntriesFromSymbols(symbols, entries, replacementToken, contextToken, location, position, sourceFile, host, program, target, log, kind, preferences, compilerOptions, formatContext, isTypeOnlyLocation, propertyAccessToConvert, jsxIdentifierExpected, isJsxInitializer, importStatementCompletion, recommendedCompletion, symbolToOriginInfoMap, symbolToSortTextMap, isJsxIdentifierExpected, isRightOfOpenTag) {
|
|
148514
|
+
function getCompletionEntriesFromSymbols(symbols, entries, replacementToken, contextToken, location, position, sourceFile, host, program, target, log, kind, preferences, compilerOptions, formatContext, isTypeOnlyLocation, propertyAccessToConvert, jsxIdentifierExpected, isJsxInitializer, importStatementCompletion, recommendedCompletion, symbolToOriginInfoMap, symbolToSortTextMap, isJsxIdentifierExpected, isRightOfOpenTag, includeSymbol = false) {
|
|
148397
148515
|
var _a2;
|
|
148398
148516
|
const start = timestamp();
|
|
148399
148517
|
const variableDeclaration = getVariableDeclaration(location);
|
|
@@ -148433,7 +148551,8 @@ ${lanes.join("\n")}
|
|
|
148433
148551
|
kind,
|
|
148434
148552
|
formatContext,
|
|
148435
148553
|
isJsxIdentifierExpected,
|
|
148436
|
-
isRightOfOpenTag
|
|
148554
|
+
isRightOfOpenTag,
|
|
148555
|
+
includeSymbol
|
|
148437
148556
|
);
|
|
148438
148557
|
if (!entry) {
|
|
148439
148558
|
continue;
|
|
@@ -148584,7 +148703,8 @@ ${lanes.join("\n")}
|
|
|
148584
148703
|
case "symbol": {
|
|
148585
148704
|
const { symbol, location, contextToken: contextToken2, origin, previousToken: previousToken2 } = symbolCompletion;
|
|
148586
148705
|
const { codeActions, sourceDisplay } = getCompletionEntryCodeActionsAndSourceDisplay(name, location, contextToken2, origin, symbol, program, host, compilerOptions, sourceFile, position, previousToken2, formatContext, preferences, data, source, cancellationToken);
|
|
148587
|
-
|
|
148706
|
+
const symbolName2 = originIsComputedPropertyName(origin) ? origin.symbolName : symbol.name;
|
|
148707
|
+
return createCompletionDetailsForSymbol(symbol, symbolName2, typeChecker, sourceFile, location, cancellationToken, codeActions, sourceDisplay);
|
|
148588
148708
|
}
|
|
148589
148709
|
case "literal": {
|
|
148590
148710
|
const { literal } = symbolCompletion;
|
|
@@ -148635,12 +148755,12 @@ ${lanes.join("\n")}
|
|
|
148635
148755
|
function createSimpleDetails(name, kind, kind2) {
|
|
148636
148756
|
return createCompletionDetails(name, "" /* none */, kind, [displayPart(name, kind2)]);
|
|
148637
148757
|
}
|
|
148638
|
-
function createCompletionDetailsForSymbol(symbol, checker, sourceFile, location, cancellationToken, codeActions, sourceDisplay) {
|
|
148758
|
+
function createCompletionDetailsForSymbol(symbol, name, checker, sourceFile, location, cancellationToken, codeActions, sourceDisplay) {
|
|
148639
148759
|
const { displayParts, documentation, symbolKind, tags } = checker.runWithCancellationToken(
|
|
148640
148760
|
cancellationToken,
|
|
148641
148761
|
(checker2) => ts_SymbolDisplay_exports.getSymbolDisplayPartsDocumentationAndSymbolKind(checker2, symbol, sourceFile, location, location, 7 /* All */)
|
|
148642
148762
|
);
|
|
148643
|
-
return createCompletionDetails(
|
|
148763
|
+
return createCompletionDetails(name, ts_SymbolDisplay_exports.getSymbolModifiers(checker, symbol), symbolKind, displayParts, documentation, tags, codeActions, sourceDisplay);
|
|
148644
148764
|
}
|
|
148645
148765
|
function createCompletionDetails(name, kindModifiers, kind, displayParts, documentation, tags, codeActions, source) {
|
|
148646
148766
|
return { name, kindModifiers, kind, displayParts, documentation, tags, codeActions, source, sourceDisplay: source };
|
|
@@ -149738,6 +149858,16 @@ ${lanes.join("\n")}
|
|
|
149738
149858
|
return classElementModifierFlags & 32 /* Static */ ? (type == null ? void 0 : type.symbol) && typeChecker.getPropertiesOfType(typeChecker.getTypeOfSymbolAtLocation(type.symbol, decl)) : type && typeChecker.getPropertiesOfType(type);
|
|
149739
149859
|
});
|
|
149740
149860
|
symbols = concatenate(symbols, filterClassMembersList(baseSymbols, decl.members, classElementModifierFlags));
|
|
149861
|
+
forEach(symbols, (symbol, index) => {
|
|
149862
|
+
const declaration = symbol == null ? void 0 : symbol.valueDeclaration;
|
|
149863
|
+
if (declaration && isClassElement(declaration) && declaration.name && isComputedPropertyName(declaration.name)) {
|
|
149864
|
+
const origin = {
|
|
149865
|
+
kind: 512 /* ComputedPropertyName */,
|
|
149866
|
+
symbolName: typeChecker.symbolToString(symbol)
|
|
149867
|
+
};
|
|
149868
|
+
symbolToOriginInfoMap[index] = origin;
|
|
149869
|
+
}
|
|
149870
|
+
});
|
|
149741
149871
|
}
|
|
149742
149872
|
return 1 /* Success */;
|
|
149743
149873
|
}
|
|
@@ -150122,7 +150252,7 @@ ${lanes.join("\n")}
|
|
|
150122
150252
|
}
|
|
150123
150253
|
switch (kind) {
|
|
150124
150254
|
case 3 /* MemberLike */:
|
|
150125
|
-
return void 0;
|
|
150255
|
+
return originIsComputedPropertyName(origin) ? { name: origin.symbolName, needsConvertPropertyAccess: false } : void 0;
|
|
150126
150256
|
case 0 /* ObjectPropertyDeclaration */:
|
|
150127
150257
|
return { name: JSON.stringify(name), needsConvertPropertyAccess: false };
|
|
150128
150258
|
case 2 /* PropertyAccess */:
|
|
@@ -150630,6 +150760,7 @@ ${lanes.join("\n")}
|
|
|
150630
150760
|
SymbolOriginInfoKind2[SymbolOriginInfoKind2["TypeOnlyAlias"] = 64] = "TypeOnlyAlias";
|
|
150631
150761
|
SymbolOriginInfoKind2[SymbolOriginInfoKind2["ObjectLiteralMethod"] = 128] = "ObjectLiteralMethod";
|
|
150632
150762
|
SymbolOriginInfoKind2[SymbolOriginInfoKind2["Ignore"] = 256] = "Ignore";
|
|
150763
|
+
SymbolOriginInfoKind2[SymbolOriginInfoKind2["ComputedPropertyName"] = 512] = "ComputedPropertyName";
|
|
150633
150764
|
SymbolOriginInfoKind2[SymbolOriginInfoKind2["SymbolMemberNoExport"] = 2 /* SymbolMember */] = "SymbolMemberNoExport";
|
|
150634
150765
|
SymbolOriginInfoKind2[SymbolOriginInfoKind2["SymbolMemberExport"] = 6] = "SymbolMemberExport";
|
|
150635
150766
|
return SymbolOriginInfoKind2;
|
|
@@ -150674,7 +150805,7 @@ ${lanes.join("\n")}
|
|
|
150674
150805
|
values: map2.values.bind(map2)
|
|
150675
150806
|
};
|
|
150676
150807
|
}
|
|
150677
|
-
function getStringLiteralCompletions(sourceFile, position, contextToken, options, host, program, log, preferences) {
|
|
150808
|
+
function getStringLiteralCompletions(sourceFile, position, contextToken, options, host, program, log, preferences, includeSymbol) {
|
|
150678
150809
|
if (isInReferenceComment(sourceFile, position)) {
|
|
150679
150810
|
const entries = getTripleSlashReferenceCompletion(sourceFile, position, options, host);
|
|
150680
150811
|
return entries && convertPathCompletions(entries);
|
|
@@ -150683,10 +150814,10 @@ ${lanes.join("\n")}
|
|
|
150683
150814
|
if (!contextToken || !isStringLiteralLike(contextToken))
|
|
150684
150815
|
return void 0;
|
|
150685
150816
|
const entries = getStringLiteralCompletionEntries(sourceFile, contextToken, position, program.getTypeChecker(), options, host, preferences);
|
|
150686
|
-
return convertStringLiteralCompletions(entries, contextToken, sourceFile, host, program, log, options, preferences, position);
|
|
150817
|
+
return convertStringLiteralCompletions(entries, contextToken, sourceFile, host, program, log, options, preferences, position, includeSymbol);
|
|
150687
150818
|
}
|
|
150688
150819
|
}
|
|
150689
|
-
function convertStringLiteralCompletions(completion, contextToken, sourceFile, host, program, log, options, preferences, position) {
|
|
150820
|
+
function convertStringLiteralCompletions(completion, contextToken, sourceFile, host, program, log, options, preferences, position, includeSymbol) {
|
|
150690
150821
|
if (completion === void 0) {
|
|
150691
150822
|
return void 0;
|
|
150692
150823
|
}
|
|
@@ -150712,7 +150843,28 @@ ${lanes.join("\n")}
|
|
|
150712
150843
|
preferences,
|
|
150713
150844
|
options,
|
|
150714
150845
|
/*formatContext*/
|
|
150715
|
-
void 0
|
|
150846
|
+
void 0,
|
|
150847
|
+
/*isTypeOnlyLocation */
|
|
150848
|
+
void 0,
|
|
150849
|
+
/*propertyAccessToConvert*/
|
|
150850
|
+
void 0,
|
|
150851
|
+
/*jsxIdentifierExpected*/
|
|
150852
|
+
void 0,
|
|
150853
|
+
/*isJsxInitializer*/
|
|
150854
|
+
void 0,
|
|
150855
|
+
/*importStatementCompletion*/
|
|
150856
|
+
void 0,
|
|
150857
|
+
/*recommendedCompletion*/
|
|
150858
|
+
void 0,
|
|
150859
|
+
/*symbolToOriginInfoMap*/
|
|
150860
|
+
void 0,
|
|
150861
|
+
/*symbolToSortTextMap*/
|
|
150862
|
+
void 0,
|
|
150863
|
+
/*isJsxIdentifierExpected*/
|
|
150864
|
+
void 0,
|
|
150865
|
+
/*isRightOfOpenTag*/
|
|
150866
|
+
void 0,
|
|
150867
|
+
includeSymbol
|
|
150716
150868
|
);
|
|
150717
150869
|
return { isGlobalCompletion: false, isMemberCompletion: true, isNewIdentifierLocation: completion.hasIndexSignature, optionalReplacementSpan, entries };
|
|
150718
150870
|
}
|
|
@@ -150744,7 +150896,7 @@ ${lanes.join("\n")}
|
|
|
150744
150896
|
}
|
|
150745
150897
|
case 1 /* Properties */: {
|
|
150746
150898
|
const match = find(completion.symbols, (s) => s.name === name);
|
|
150747
|
-
return match && createCompletionDetailsForSymbol(match, checker, sourceFile, location, cancellationToken);
|
|
150899
|
+
return match && createCompletionDetailsForSymbol(match, match.name, checker, sourceFile, location, cancellationToken);
|
|
150748
150900
|
}
|
|
150749
150901
|
case 2 /* Types */:
|
|
150750
150902
|
return find(completion.types, (t) => t.value === name) ? createCompletionDetails(name, "" /* none */, "string" /* string */, [textPart(name)]) : void 0;
|
|
@@ -165857,7 +166009,7 @@ ${options.prefix}` : "\n" : options.prefix
|
|
|
165857
166009
|
}
|
|
165858
166010
|
function processChildNode(child, inheritedIndentation, parent2, parentDynamicIndentation, parentStartLine, undecoratedParentStartLine, isListItem, isFirstListItem) {
|
|
165859
166011
|
Debug.assert(!nodeIsSynthesized(child));
|
|
165860
|
-
if (nodeIsMissing(child)) {
|
|
166012
|
+
if (nodeIsMissing(child) || isGrammarError(parent2, child)) {
|
|
165861
166013
|
return inheritedIndentation;
|
|
165862
166014
|
}
|
|
165863
166015
|
const childStartPos = child.getStart(sourceFile);
|
|
@@ -179366,6 +179518,7 @@ ${e.message}`;
|
|
|
179366
179518
|
isGetOrSetAccessorDeclaration: () => isGetOrSetAccessorDeclaration,
|
|
179367
179519
|
isGlobalDeclaration: () => isGlobalDeclaration,
|
|
179368
179520
|
isGlobalScopeAugmentation: () => isGlobalScopeAugmentation,
|
|
179521
|
+
isGrammarError: () => isGrammarError,
|
|
179369
179522
|
isHeritageClause: () => isHeritageClause,
|
|
179370
179523
|
isHoistedFunction: () => isHoistedFunction,
|
|
179371
179524
|
isHoistedVariableStatement: () => isHoistedVariableStatement,
|
|
@@ -181725,6 +181878,7 @@ ${e.message}`;
|
|
|
181725
181878
|
isGetOrSetAccessorDeclaration: () => isGetOrSetAccessorDeclaration,
|
|
181726
181879
|
isGlobalDeclaration: () => isGlobalDeclaration,
|
|
181727
181880
|
isGlobalScopeAugmentation: () => isGlobalScopeAugmentation,
|
|
181881
|
+
isGrammarError: () => isGrammarError,
|
|
181728
181882
|
isHeritageClause: () => isHeritageClause,
|
|
181729
181883
|
isHoistedFunction: () => isHoistedFunction,
|
|
181730
181884
|
isHoistedVariableStatement: () => isHoistedVariableStatement,
|