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/typescript.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)) {
|
|
@@ -133210,7 +133313,8 @@ ${lanes.join("\n")}
|
|
|
133210
133313
|
options.triggerCharacter,
|
|
133211
133314
|
options.triggerKind,
|
|
133212
133315
|
cancellationToken,
|
|
133213
|
-
formattingSettings && ts_formatting_exports.getFormatContext(formattingSettings, host)
|
|
133316
|
+
formattingSettings && ts_formatting_exports.getFormatContext(formattingSettings, host),
|
|
133317
|
+
options.includeSymbol
|
|
133214
133318
|
);
|
|
133215
133319
|
}
|
|
133216
133320
|
function getCompletionEntryDetails2(fileName, position, name, formattingOptions, source, preferences = emptyOptions, data) {
|
|
@@ -146134,7 +146238,14 @@ ${lanes.join("\n")}
|
|
|
146134
146238
|
changeTracker.replaceNode(file, declaration, property);
|
|
146135
146239
|
}
|
|
146136
146240
|
function updatePropertyAssignmentDeclaration(changeTracker, file, declaration, fieldName) {
|
|
146137
|
-
|
|
146241
|
+
let assignment = factory.updatePropertyAssignment(declaration, fieldName, declaration.initializer);
|
|
146242
|
+
if (assignment.modifiers || assignment.questionToken || assignment.exclamationToken) {
|
|
146243
|
+
if (assignment === declaration)
|
|
146244
|
+
assignment = factory.cloneNode(assignment);
|
|
146245
|
+
assignment.modifiers = void 0;
|
|
146246
|
+
assignment.questionToken = void 0;
|
|
146247
|
+
assignment.exclamationToken = void 0;
|
|
146248
|
+
}
|
|
146138
146249
|
changeTracker.replacePropertyAssignment(file, declaration, assignment);
|
|
146139
146250
|
}
|
|
146140
146251
|
function updateFieldDeclaration(changeTracker, file, declaration, type, fieldName, modifiers) {
|
|
@@ -147263,7 +147374,7 @@ ${lanes.join("\n")}
|
|
|
147263
147374
|
return !!(origin && origin.kind === 32 /* ResolvedExport */);
|
|
147264
147375
|
}
|
|
147265
147376
|
function originIncludesSymbolName(origin) {
|
|
147266
|
-
return originIsExport(origin) || originIsResolvedExport(origin);
|
|
147377
|
+
return originIsExport(origin) || originIsResolvedExport(origin) || originIsComputedPropertyName(origin);
|
|
147267
147378
|
}
|
|
147268
147379
|
function originIsPackageJsonImport(origin) {
|
|
147269
147380
|
return (originIsExport(origin) || originIsResolvedExport(origin)) && !!origin.isFromPackageJson;
|
|
@@ -147283,6 +147394,9 @@ ${lanes.join("\n")}
|
|
|
147283
147394
|
function originIsIgnore(origin) {
|
|
147284
147395
|
return !!(origin && origin.kind & 256 /* Ignore */);
|
|
147285
147396
|
}
|
|
147397
|
+
function originIsComputedPropertyName(origin) {
|
|
147398
|
+
return !!(origin && origin.kind & 512 /* ComputedPropertyName */);
|
|
147399
|
+
}
|
|
147286
147400
|
function resolvingModuleSpecifiers(logPrefix, host, resolver, program, position, preferences, isForImportStatementCompletion, isValidTypeOnlyUseSite, cb) {
|
|
147287
147401
|
var _a2, _b, _c;
|
|
147288
147402
|
const start = timestamp();
|
|
@@ -147325,7 +147439,7 @@ ${lanes.join("\n")}
|
|
|
147325
147439
|
return result2 || (needsFullResolution ? "failed" : "skipped");
|
|
147326
147440
|
}
|
|
147327
147441
|
}
|
|
147328
|
-
function getCompletionsAtPosition(host, program, log, sourceFile, position, preferences, triggerCharacter, completionKind, cancellationToken, formatContext) {
|
|
147442
|
+
function getCompletionsAtPosition(host, program, log, sourceFile, position, preferences, triggerCharacter, completionKind, cancellationToken, formatContext, includeSymbol = false) {
|
|
147329
147443
|
var _a2;
|
|
147330
147444
|
const { previousToken } = getRelevantTokens(position, sourceFile);
|
|
147331
147445
|
if (triggerCharacter && !isInString(sourceFile, position, previousToken) && !isValidTrigger(sourceFile, triggerCharacter, previousToken, position)) {
|
|
@@ -147347,7 +147461,7 @@ ${lanes.join("\n")}
|
|
|
147347
147461
|
} else {
|
|
147348
147462
|
incompleteCompletionsCache == null ? void 0 : incompleteCompletionsCache.clear();
|
|
147349
147463
|
}
|
|
147350
|
-
const stringCompletions = ts_Completions_StringCompletions_exports.getStringLiteralCompletions(sourceFile, position, previousToken, compilerOptions, host, program, log, preferences);
|
|
147464
|
+
const stringCompletions = ts_Completions_StringCompletions_exports.getStringLiteralCompletions(sourceFile, position, previousToken, compilerOptions, host, program, log, preferences, includeSymbol);
|
|
147351
147465
|
if (stringCompletions) {
|
|
147352
147466
|
return stringCompletions;
|
|
147353
147467
|
}
|
|
@@ -147372,7 +147486,7 @@ ${lanes.join("\n")}
|
|
|
147372
147486
|
}
|
|
147373
147487
|
switch (completionData.kind) {
|
|
147374
147488
|
case 0 /* Data */:
|
|
147375
|
-
const response = completionInfoFromData(sourceFile, host, program, compilerOptions, log, completionData, preferences, formatContext, position);
|
|
147489
|
+
const response = completionInfoFromData(sourceFile, host, program, compilerOptions, log, completionData, preferences, formatContext, position, includeSymbol);
|
|
147376
147490
|
if (response == null ? void 0 : response.isIncomplete) {
|
|
147377
147491
|
incompleteCompletionsCache == null ? void 0 : incompleteCompletionsCache.set(response);
|
|
147378
147492
|
}
|
|
@@ -147502,7 +147616,7 @@ ${lanes.join("\n")}
|
|
|
147502
147616
|
function getOptionalReplacementSpan(location) {
|
|
147503
147617
|
return (location == null ? void 0 : location.kind) === 79 /* Identifier */ ? createTextSpanFromNode(location) : void 0;
|
|
147504
147618
|
}
|
|
147505
|
-
function completionInfoFromData(sourceFile, host, program, compilerOptions, log, completionData, preferences, formatContext, position) {
|
|
147619
|
+
function completionInfoFromData(sourceFile, host, program, compilerOptions, log, completionData, preferences, formatContext, position, includeSymbol) {
|
|
147506
147620
|
const {
|
|
147507
147621
|
symbols,
|
|
147508
147622
|
contextToken,
|
|
@@ -147576,7 +147690,8 @@ ${lanes.join("\n")}
|
|
|
147576
147690
|
symbolToOriginInfoMap,
|
|
147577
147691
|
symbolToSortTextMap,
|
|
147578
147692
|
isJsxIdentifierExpected,
|
|
147579
|
-
isRightOfOpenTag
|
|
147693
|
+
isRightOfOpenTag,
|
|
147694
|
+
includeSymbol
|
|
147580
147695
|
);
|
|
147581
147696
|
if (keywordFilters !== 0 /* None */) {
|
|
147582
147697
|
for (const keywordEntry of getKeywordCompletions(keywordFilters, !insideJsDocTagTypeExpression && isSourceFileJS(sourceFile))) {
|
|
@@ -147825,7 +147940,7 @@ ${lanes.join("\n")}
|
|
|
147825
147940
|
function createCompletionEntryForLiteral(sourceFile, preferences, literal) {
|
|
147826
147941
|
return { name: completionNameForLiteral(sourceFile, preferences, literal), kind: "string" /* string */, kindModifiers: "" /* none */, sortText: SortText.LocationPriority };
|
|
147827
147942
|
}
|
|
147828
|
-
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) {
|
|
147943
|
+
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) {
|
|
147829
147944
|
let insertText;
|
|
147830
147945
|
let replacementSpan = getReplacementSpanForContextToken(replacementToken);
|
|
147831
147946
|
let data;
|
|
@@ -147869,7 +147984,9 @@ ${lanes.join("\n")}
|
|
|
147869
147984
|
}
|
|
147870
147985
|
awaitText += `(await ${propertyAccessToConvert.expression.getText()})`;
|
|
147871
147986
|
insertText = needsConvertPropertyAccess ? `${awaitText}${insertText}` : `${awaitText}${insertQuestionDot ? "?." : "."}${insertText}`;
|
|
147872
|
-
|
|
147987
|
+
const isInAwaitExpression = tryCast(propertyAccessToConvert.parent, isAwaitExpression);
|
|
147988
|
+
const wrapNode = isInAwaitExpression ? propertyAccessToConvert.parent : propertyAccessToConvert.expression;
|
|
147989
|
+
replacementSpan = createTextSpanFromBounds(wrapNode.getStart(sourceFile), propertyAccessToConvert.end);
|
|
147873
147990
|
}
|
|
147874
147991
|
if (originIsResolvedExport(origin)) {
|
|
147875
147992
|
sourceDisplay = [textPart(origin.moduleSpecifier)];
|
|
@@ -147937,7 +148054,8 @@ ${lanes.join("\n")}
|
|
|
147937
148054
|
isSnippet,
|
|
147938
148055
|
isPackageJsonImport: originIsPackageJsonImport(origin) || void 0,
|
|
147939
148056
|
isImportStatementCompletion: !!importStatementCompletion || void 0,
|
|
147940
|
-
data
|
|
148057
|
+
data,
|
|
148058
|
+
...includeSymbol ? { symbol } : void 0
|
|
147941
148059
|
};
|
|
147942
148060
|
}
|
|
147943
148061
|
function isClassLikeMemberCompletion(symbol, location, sourceFile) {
|
|
@@ -148005,7 +148123,7 @@ ${lanes.join("\n")}
|
|
|
148005
148123
|
if (isAbstract) {
|
|
148006
148124
|
requiredModifiers |= 256 /* Abstract */;
|
|
148007
148125
|
}
|
|
148008
|
-
if (isClassElement(node) && checker.getMemberOverrideModifierStatus(classLikeDeclaration, node) === 1 /* NeedsOverride */) {
|
|
148126
|
+
if (isClassElement(node) && checker.getMemberOverrideModifierStatus(classLikeDeclaration, node, symbol) === 1 /* NeedsOverride */) {
|
|
148009
148127
|
requiredModifiers |= 16384 /* Override */;
|
|
148010
148128
|
}
|
|
148011
148129
|
if (!completionNodes.length) {
|
|
@@ -148407,7 +148525,7 @@ ${lanes.join("\n")}
|
|
|
148407
148525
|
return "TypeOnlyAlias/" /* TypeOnlyAlias */;
|
|
148408
148526
|
}
|
|
148409
148527
|
}
|
|
148410
|
-
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) {
|
|
148528
|
+
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) {
|
|
148411
148529
|
var _a2;
|
|
148412
148530
|
const start = timestamp();
|
|
148413
148531
|
const variableDeclaration = getVariableDeclaration(location);
|
|
@@ -148447,7 +148565,8 @@ ${lanes.join("\n")}
|
|
|
148447
148565
|
kind,
|
|
148448
148566
|
formatContext,
|
|
148449
148567
|
isJsxIdentifierExpected,
|
|
148450
|
-
isRightOfOpenTag
|
|
148568
|
+
isRightOfOpenTag,
|
|
148569
|
+
includeSymbol
|
|
148451
148570
|
);
|
|
148452
148571
|
if (!entry) {
|
|
148453
148572
|
continue;
|
|
@@ -148598,7 +148717,8 @@ ${lanes.join("\n")}
|
|
|
148598
148717
|
case "symbol": {
|
|
148599
148718
|
const { symbol, location, contextToken: contextToken2, origin, previousToken: previousToken2 } = symbolCompletion;
|
|
148600
148719
|
const { codeActions, sourceDisplay } = getCompletionEntryCodeActionsAndSourceDisplay(name, location, contextToken2, origin, symbol, program, host, compilerOptions, sourceFile, position, previousToken2, formatContext, preferences, data, source, cancellationToken);
|
|
148601
|
-
|
|
148720
|
+
const symbolName2 = originIsComputedPropertyName(origin) ? origin.symbolName : symbol.name;
|
|
148721
|
+
return createCompletionDetailsForSymbol(symbol, symbolName2, typeChecker, sourceFile, location, cancellationToken, codeActions, sourceDisplay);
|
|
148602
148722
|
}
|
|
148603
148723
|
case "literal": {
|
|
148604
148724
|
const { literal } = symbolCompletion;
|
|
@@ -148649,12 +148769,12 @@ ${lanes.join("\n")}
|
|
|
148649
148769
|
function createSimpleDetails(name, kind, kind2) {
|
|
148650
148770
|
return createCompletionDetails(name, "" /* none */, kind, [displayPart(name, kind2)]);
|
|
148651
148771
|
}
|
|
148652
|
-
function createCompletionDetailsForSymbol(symbol, checker, sourceFile, location, cancellationToken, codeActions, sourceDisplay) {
|
|
148772
|
+
function createCompletionDetailsForSymbol(symbol, name, checker, sourceFile, location, cancellationToken, codeActions, sourceDisplay) {
|
|
148653
148773
|
const { displayParts, documentation, symbolKind, tags } = checker.runWithCancellationToken(
|
|
148654
148774
|
cancellationToken,
|
|
148655
148775
|
(checker2) => ts_SymbolDisplay_exports.getSymbolDisplayPartsDocumentationAndSymbolKind(checker2, symbol, sourceFile, location, location, 7 /* All */)
|
|
148656
148776
|
);
|
|
148657
|
-
return createCompletionDetails(
|
|
148777
|
+
return createCompletionDetails(name, ts_SymbolDisplay_exports.getSymbolModifiers(checker, symbol), symbolKind, displayParts, documentation, tags, codeActions, sourceDisplay);
|
|
148658
148778
|
}
|
|
148659
148779
|
function createCompletionDetails(name, kindModifiers, kind, displayParts, documentation, tags, codeActions, source) {
|
|
148660
148780
|
return { name, kindModifiers, kind, displayParts, documentation, tags, codeActions, source, sourceDisplay: source };
|
|
@@ -149752,6 +149872,16 @@ ${lanes.join("\n")}
|
|
|
149752
149872
|
return classElementModifierFlags & 32 /* Static */ ? (type == null ? void 0 : type.symbol) && typeChecker.getPropertiesOfType(typeChecker.getTypeOfSymbolAtLocation(type.symbol, decl)) : type && typeChecker.getPropertiesOfType(type);
|
|
149753
149873
|
});
|
|
149754
149874
|
symbols = concatenate(symbols, filterClassMembersList(baseSymbols, decl.members, classElementModifierFlags));
|
|
149875
|
+
forEach(symbols, (symbol, index) => {
|
|
149876
|
+
const declaration = symbol == null ? void 0 : symbol.valueDeclaration;
|
|
149877
|
+
if (declaration && isClassElement(declaration) && declaration.name && isComputedPropertyName(declaration.name)) {
|
|
149878
|
+
const origin = {
|
|
149879
|
+
kind: 512 /* ComputedPropertyName */,
|
|
149880
|
+
symbolName: typeChecker.symbolToString(symbol)
|
|
149881
|
+
};
|
|
149882
|
+
symbolToOriginInfoMap[index] = origin;
|
|
149883
|
+
}
|
|
149884
|
+
});
|
|
149755
149885
|
}
|
|
149756
149886
|
return 1 /* Success */;
|
|
149757
149887
|
}
|
|
@@ -150136,7 +150266,7 @@ ${lanes.join("\n")}
|
|
|
150136
150266
|
}
|
|
150137
150267
|
switch (kind) {
|
|
150138
150268
|
case 3 /* MemberLike */:
|
|
150139
|
-
return void 0;
|
|
150269
|
+
return originIsComputedPropertyName(origin) ? { name: origin.symbolName, needsConvertPropertyAccess: false } : void 0;
|
|
150140
150270
|
case 0 /* ObjectPropertyDeclaration */:
|
|
150141
150271
|
return { name: JSON.stringify(name), needsConvertPropertyAccess: false };
|
|
150142
150272
|
case 2 /* PropertyAccess */:
|
|
@@ -150644,6 +150774,7 @@ ${lanes.join("\n")}
|
|
|
150644
150774
|
SymbolOriginInfoKind2[SymbolOriginInfoKind2["TypeOnlyAlias"] = 64] = "TypeOnlyAlias";
|
|
150645
150775
|
SymbolOriginInfoKind2[SymbolOriginInfoKind2["ObjectLiteralMethod"] = 128] = "ObjectLiteralMethod";
|
|
150646
150776
|
SymbolOriginInfoKind2[SymbolOriginInfoKind2["Ignore"] = 256] = "Ignore";
|
|
150777
|
+
SymbolOriginInfoKind2[SymbolOriginInfoKind2["ComputedPropertyName"] = 512] = "ComputedPropertyName";
|
|
150647
150778
|
SymbolOriginInfoKind2[SymbolOriginInfoKind2["SymbolMemberNoExport"] = 2 /* SymbolMember */] = "SymbolMemberNoExport";
|
|
150648
150779
|
SymbolOriginInfoKind2[SymbolOriginInfoKind2["SymbolMemberExport"] = 6] = "SymbolMemberExport";
|
|
150649
150780
|
return SymbolOriginInfoKind2;
|
|
@@ -150688,7 +150819,7 @@ ${lanes.join("\n")}
|
|
|
150688
150819
|
values: map2.values.bind(map2)
|
|
150689
150820
|
};
|
|
150690
150821
|
}
|
|
150691
|
-
function getStringLiteralCompletions(sourceFile, position, contextToken, options, host, program, log, preferences) {
|
|
150822
|
+
function getStringLiteralCompletions(sourceFile, position, contextToken, options, host, program, log, preferences, includeSymbol) {
|
|
150692
150823
|
if (isInReferenceComment(sourceFile, position)) {
|
|
150693
150824
|
const entries = getTripleSlashReferenceCompletion(sourceFile, position, options, host);
|
|
150694
150825
|
return entries && convertPathCompletions(entries);
|
|
@@ -150697,10 +150828,10 @@ ${lanes.join("\n")}
|
|
|
150697
150828
|
if (!contextToken || !isStringLiteralLike(contextToken))
|
|
150698
150829
|
return void 0;
|
|
150699
150830
|
const entries = getStringLiteralCompletionEntries(sourceFile, contextToken, position, program.getTypeChecker(), options, host, preferences);
|
|
150700
|
-
return convertStringLiteralCompletions(entries, contextToken, sourceFile, host, program, log, options, preferences, position);
|
|
150831
|
+
return convertStringLiteralCompletions(entries, contextToken, sourceFile, host, program, log, options, preferences, position, includeSymbol);
|
|
150701
150832
|
}
|
|
150702
150833
|
}
|
|
150703
|
-
function convertStringLiteralCompletions(completion, contextToken, sourceFile, host, program, log, options, preferences, position) {
|
|
150834
|
+
function convertStringLiteralCompletions(completion, contextToken, sourceFile, host, program, log, options, preferences, position, includeSymbol) {
|
|
150704
150835
|
if (completion === void 0) {
|
|
150705
150836
|
return void 0;
|
|
150706
150837
|
}
|
|
@@ -150726,7 +150857,28 @@ ${lanes.join("\n")}
|
|
|
150726
150857
|
preferences,
|
|
150727
150858
|
options,
|
|
150728
150859
|
/*formatContext*/
|
|
150729
|
-
void 0
|
|
150860
|
+
void 0,
|
|
150861
|
+
/*isTypeOnlyLocation */
|
|
150862
|
+
void 0,
|
|
150863
|
+
/*propertyAccessToConvert*/
|
|
150864
|
+
void 0,
|
|
150865
|
+
/*jsxIdentifierExpected*/
|
|
150866
|
+
void 0,
|
|
150867
|
+
/*isJsxInitializer*/
|
|
150868
|
+
void 0,
|
|
150869
|
+
/*importStatementCompletion*/
|
|
150870
|
+
void 0,
|
|
150871
|
+
/*recommendedCompletion*/
|
|
150872
|
+
void 0,
|
|
150873
|
+
/*symbolToOriginInfoMap*/
|
|
150874
|
+
void 0,
|
|
150875
|
+
/*symbolToSortTextMap*/
|
|
150876
|
+
void 0,
|
|
150877
|
+
/*isJsxIdentifierExpected*/
|
|
150878
|
+
void 0,
|
|
150879
|
+
/*isRightOfOpenTag*/
|
|
150880
|
+
void 0,
|
|
150881
|
+
includeSymbol
|
|
150730
150882
|
);
|
|
150731
150883
|
return { isGlobalCompletion: false, isMemberCompletion: true, isNewIdentifierLocation: completion.hasIndexSignature, optionalReplacementSpan, entries };
|
|
150732
150884
|
}
|
|
@@ -150758,7 +150910,7 @@ ${lanes.join("\n")}
|
|
|
150758
150910
|
}
|
|
150759
150911
|
case 1 /* Properties */: {
|
|
150760
150912
|
const match = find(completion.symbols, (s) => s.name === name);
|
|
150761
|
-
return match && createCompletionDetailsForSymbol(match, checker, sourceFile, location, cancellationToken);
|
|
150913
|
+
return match && createCompletionDetailsForSymbol(match, match.name, checker, sourceFile, location, cancellationToken);
|
|
150762
150914
|
}
|
|
150763
150915
|
case 2 /* Types */:
|
|
150764
150916
|
return find(completion.types, (t) => t.value === name) ? createCompletionDetails(name, "" /* none */, "string" /* string */, [textPart(name)]) : void 0;
|
|
@@ -165871,7 +166023,7 @@ ${options.prefix}` : "\n" : options.prefix
|
|
|
165871
166023
|
}
|
|
165872
166024
|
function processChildNode(child, inheritedIndentation, parent2, parentDynamicIndentation, parentStartLine, undecoratedParentStartLine, isListItem, isFirstListItem) {
|
|
165873
166025
|
Debug.assert(!nodeIsSynthesized(child));
|
|
165874
|
-
if (nodeIsMissing(child)) {
|
|
166026
|
+
if (nodeIsMissing(child) || isGrammarError(parent2, child)) {
|
|
165875
166027
|
return inheritedIndentation;
|
|
165876
166028
|
}
|
|
165877
166029
|
const childStartPos = child.getStart(sourceFile);
|
|
@@ -168547,6 +168699,7 @@ ${options.prefix}` : "\n" : options.prefix
|
|
|
168547
168699
|
isGetOrSetAccessorDeclaration: () => isGetOrSetAccessorDeclaration,
|
|
168548
168700
|
isGlobalDeclaration: () => isGlobalDeclaration,
|
|
168549
168701
|
isGlobalScopeAugmentation: () => isGlobalScopeAugmentation,
|
|
168702
|
+
isGrammarError: () => isGrammarError,
|
|
168550
168703
|
isHeritageClause: () => isHeritageClause,
|
|
168551
168704
|
isHoistedFunction: () => isHoistedFunction,
|
|
168552
168705
|
isHoistedVariableStatement: () => isHoistedVariableStatement,
|