@typescript-deploys/pr-build 5.0.0-pr-52818-5 → 5.0.0-pr-52836-9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/tsc.js +109 -68
- package/lib/tsserver.js +133 -77
- package/lib/tsserverlibrary.js +133 -77
- package/lib/typescript.js +133 -77
- package/lib/typingsInstaller.js +39 -39
- package/package.json +1 -1
package/lib/tsserver.js
CHANGED
|
@@ -2288,7 +2288,7 @@ module.exports = __toCommonJS(server_exports);
|
|
|
2288
2288
|
|
|
2289
2289
|
// src/compiler/corePublic.ts
|
|
2290
2290
|
var versionMajorMinor = "5.0";
|
|
2291
|
-
var version = `${versionMajorMinor}.0-insiders.
|
|
2291
|
+
var version = `${versionMajorMinor}.0-insiders.20230218`;
|
|
2292
2292
|
var Comparison = /* @__PURE__ */ ((Comparison3) => {
|
|
2293
2293
|
Comparison3[Comparison3["LessThan"] = -1] = "LessThan";
|
|
2294
2294
|
Comparison3[Comparison3["EqualTo"] = 0] = "EqualTo";
|
|
@@ -11952,18 +11952,18 @@ function isIdentifierText(name, languageVersion, identifierVariant) {
|
|
|
11952
11952
|
return true;
|
|
11953
11953
|
}
|
|
11954
11954
|
function createScanner(languageVersion, skipTrivia2, languageVariant = 0 /* Standard */, textInitial, onError, start2, length2) {
|
|
11955
|
-
|
|
11956
|
-
|
|
11957
|
-
|
|
11958
|
-
|
|
11959
|
-
|
|
11960
|
-
|
|
11961
|
-
|
|
11962
|
-
|
|
11963
|
-
|
|
11964
|
-
|
|
11955
|
+
var text = textInitial;
|
|
11956
|
+
var pos;
|
|
11957
|
+
var end;
|
|
11958
|
+
var startPos;
|
|
11959
|
+
var tokenPos;
|
|
11960
|
+
var token;
|
|
11961
|
+
var tokenValue;
|
|
11962
|
+
var tokenFlags;
|
|
11963
|
+
var commentDirectives;
|
|
11964
|
+
var inJSDocType = 0;
|
|
11965
11965
|
setText(text, start2, length2);
|
|
11966
|
-
|
|
11966
|
+
var scanner2 = {
|
|
11967
11967
|
getStartPos: () => startPos,
|
|
11968
11968
|
getTextPos: () => pos,
|
|
11969
11969
|
getToken: () => token,
|
|
@@ -30354,22 +30354,22 @@ function parseJSDocTypeExpressionForTests(content, start2, length2) {
|
|
|
30354
30354
|
}
|
|
30355
30355
|
var Parser;
|
|
30356
30356
|
((Parser2) => {
|
|
30357
|
-
|
|
30357
|
+
var scanner2 = createScanner(
|
|
30358
30358
|
99 /* Latest */,
|
|
30359
30359
|
/*skipTrivia*/
|
|
30360
30360
|
true
|
|
30361
30361
|
);
|
|
30362
|
-
|
|
30363
|
-
|
|
30364
|
-
|
|
30365
|
-
|
|
30366
|
-
|
|
30367
|
-
|
|
30362
|
+
var disallowInAndDecoratorContext = 4096 /* DisallowInContext */ | 16384 /* DecoratorContext */;
|
|
30363
|
+
var NodeConstructor2;
|
|
30364
|
+
var TokenConstructor2;
|
|
30365
|
+
var IdentifierConstructor2;
|
|
30366
|
+
var PrivateIdentifierConstructor2;
|
|
30367
|
+
var SourceFileConstructor2;
|
|
30368
30368
|
function countNode(node) {
|
|
30369
30369
|
nodeCount++;
|
|
30370
30370
|
return node;
|
|
30371
30371
|
}
|
|
30372
|
-
|
|
30372
|
+
var baseNodeFactory = {
|
|
30373
30373
|
createBaseSourceFileNode: (kind) => countNode(new SourceFileConstructor2(
|
|
30374
30374
|
kind,
|
|
30375
30375
|
/*pos*/
|
|
@@ -30406,25 +30406,25 @@ var Parser;
|
|
|
30406
30406
|
0
|
|
30407
30407
|
))
|
|
30408
30408
|
};
|
|
30409
|
-
|
|
30410
|
-
|
|
30411
|
-
|
|
30412
|
-
|
|
30413
|
-
|
|
30414
|
-
|
|
30415
|
-
|
|
30416
|
-
|
|
30417
|
-
|
|
30418
|
-
|
|
30419
|
-
|
|
30420
|
-
|
|
30421
|
-
|
|
30422
|
-
|
|
30423
|
-
|
|
30424
|
-
|
|
30425
|
-
|
|
30426
|
-
|
|
30427
|
-
|
|
30409
|
+
var factory2 = createNodeFactory(1 /* NoParenthesizerRules */ | 2 /* NoNodeConverters */ | 8 /* NoOriginalNode */, baseNodeFactory);
|
|
30410
|
+
var fileName;
|
|
30411
|
+
var sourceFlags;
|
|
30412
|
+
var sourceText;
|
|
30413
|
+
var languageVersion;
|
|
30414
|
+
var scriptKind;
|
|
30415
|
+
var languageVariant;
|
|
30416
|
+
var parseDiagnostics;
|
|
30417
|
+
var jsDocDiagnostics;
|
|
30418
|
+
var syntaxCursor;
|
|
30419
|
+
var currentToken;
|
|
30420
|
+
var nodeCount;
|
|
30421
|
+
var identifiers;
|
|
30422
|
+
var identifierCount;
|
|
30423
|
+
var parsingContext;
|
|
30424
|
+
var notParenthesizedArrow;
|
|
30425
|
+
var contextFlags;
|
|
30426
|
+
var topLevel = true;
|
|
30427
|
+
var parseErrorBeforeNextFinishedNode = false;
|
|
30428
30428
|
function parseSourceFile(fileName2, sourceText2, languageVersion2, syntaxCursor2, setParentNodes = false, scriptKind2, setExternalModuleIndicatorOverride) {
|
|
30429
30429
|
var _a2;
|
|
30430
30430
|
scriptKind2 = ensureScriptKind(fileName2, scriptKind2);
|
|
@@ -51895,7 +51895,7 @@ function createTypeChecker(host) {
|
|
|
51895
51895
|
return result;
|
|
51896
51896
|
}
|
|
51897
51897
|
function createAnonymousTypeNode(type2) {
|
|
51898
|
-
var _a3;
|
|
51898
|
+
var _a3, _b2;
|
|
51899
51899
|
const typeId = type2.id;
|
|
51900
51900
|
const symbol = type2.symbol;
|
|
51901
51901
|
if (symbol) {
|
|
@@ -51921,6 +51921,20 @@ function createTypeChecker(host) {
|
|
|
51921
51921
|
return visitAndTransformType(type2, createTypeNodeFromObjectType);
|
|
51922
51922
|
}
|
|
51923
51923
|
} else {
|
|
51924
|
+
const isInstantiationExpressionType = !!(getObjectFlags(type2) & 8388608 /* InstantiationExpressionType */);
|
|
51925
|
+
if (isInstantiationExpressionType) {
|
|
51926
|
+
const instantiationExpressionType = type2;
|
|
51927
|
+
if (isTypeQueryNode(instantiationExpressionType.node)) {
|
|
51928
|
+
const typeNode = serializeExistingTypeNode(context, instantiationExpressionType.node);
|
|
51929
|
+
if (typeNode) {
|
|
51930
|
+
return typeNode;
|
|
51931
|
+
}
|
|
51932
|
+
}
|
|
51933
|
+
if ((_b2 = context.visitedTypes) == null ? void 0 : _b2.has(typeId)) {
|
|
51934
|
+
return createElidedInformationPlaceholder(context);
|
|
51935
|
+
}
|
|
51936
|
+
return visitAndTransformType(type2, createTypeNodeFromObjectType);
|
|
51937
|
+
}
|
|
51924
51938
|
return createTypeNodeFromObjectType(type2);
|
|
51925
51939
|
}
|
|
51926
51940
|
function shouldWriteTypeOfFunctionSymbol() {
|
|
@@ -52429,7 +52443,7 @@ function createTypeChecker(host) {
|
|
|
52429
52443
|
);
|
|
52430
52444
|
}
|
|
52431
52445
|
function signatureToSignatureDeclarationHelper(signature, kind, context, options) {
|
|
52432
|
-
var _a2, _b, _c, _d;
|
|
52446
|
+
var _a2, _b, _c, _d, _e;
|
|
52433
52447
|
const suppressAny = context.flags & 256 /* SuppressAnyReturnType */;
|
|
52434
52448
|
if (suppressAny)
|
|
52435
52449
|
context.flags &= ~256 /* SuppressAnyReturnType */;
|
|
@@ -52446,6 +52460,39 @@ function createTypeChecker(host) {
|
|
|
52446
52460
|
/*skipUnionExpanding*/
|
|
52447
52461
|
true
|
|
52448
52462
|
)[0];
|
|
52463
|
+
let cleanup;
|
|
52464
|
+
if (context.enclosingDeclaration && signature.declaration && signature.declaration !== context.enclosingDeclaration && !isInJSFile(signature.declaration) && some(expandedParams)) {
|
|
52465
|
+
const existingFakeScope = getNodeLinks(context.enclosingDeclaration).fakeScopeForSignatureDeclaration ? context.enclosingDeclaration : void 0;
|
|
52466
|
+
Debug.assertOptionalNode(existingFakeScope, isBlock);
|
|
52467
|
+
const locals = (_a2 = existingFakeScope == null ? void 0 : existingFakeScope.locals) != null ? _a2 : createSymbolTable();
|
|
52468
|
+
let newLocals;
|
|
52469
|
+
for (const param of expandedParams) {
|
|
52470
|
+
if (!locals.has(param.escapedName)) {
|
|
52471
|
+
newLocals = append(newLocals, param.escapedName);
|
|
52472
|
+
locals.set(param.escapedName, param);
|
|
52473
|
+
}
|
|
52474
|
+
}
|
|
52475
|
+
if (newLocals) {
|
|
52476
|
+
let removeNewLocals2 = function() {
|
|
52477
|
+
forEach(newLocals, (s) => locals.delete(s));
|
|
52478
|
+
};
|
|
52479
|
+
var removeNewLocals = removeNewLocals2;
|
|
52480
|
+
if (existingFakeScope) {
|
|
52481
|
+
cleanup = removeNewLocals2;
|
|
52482
|
+
} else {
|
|
52483
|
+
const fakeScope = parseNodeFactory.createBlock(emptyArray);
|
|
52484
|
+
getNodeLinks(fakeScope).fakeScopeForSignatureDeclaration = true;
|
|
52485
|
+
fakeScope.locals = locals;
|
|
52486
|
+
const saveEnclosingDeclaration = context.enclosingDeclaration;
|
|
52487
|
+
setParent(fakeScope, saveEnclosingDeclaration);
|
|
52488
|
+
context.enclosingDeclaration = fakeScope;
|
|
52489
|
+
cleanup = () => {
|
|
52490
|
+
context.enclosingDeclaration = saveEnclosingDeclaration;
|
|
52491
|
+
removeNewLocals2();
|
|
52492
|
+
};
|
|
52493
|
+
}
|
|
52494
|
+
}
|
|
52495
|
+
}
|
|
52449
52496
|
const parameters = (some(expandedParams, (p) => p !== expandedParams[expandedParams.length - 1] && !!(getCheckFlags(p) & 32768 /* RestParameter */)) ? signature.parameters : expandedParams).map((parameter) => symbolToParameterDeclaration(parameter, context, kind === 173 /* Constructor */, options == null ? void 0 : options.privateSymbolVisitor, options == null ? void 0 : options.bundledImports));
|
|
52450
52497
|
const thisParameter = context.flags & 33554432 /* OmitThisParameter */ ? void 0 : tryGetThisParameterDeclaration(signature, context);
|
|
52451
52498
|
if (thisParameter) {
|
|
@@ -52471,11 +52518,11 @@ function createTypeChecker(host) {
|
|
|
52471
52518
|
const flags = modifiersToFlags(modifiers);
|
|
52472
52519
|
modifiers = factory.createModifiersFromModifierFlags(flags | 256 /* Abstract */);
|
|
52473
52520
|
}
|
|
52474
|
-
const node = kind === 176 /* CallSignature */ ? factory.createCallSignature(typeParameters, parameters, returnTypeNode) : kind === 177 /* ConstructSignature */ ? factory.createConstructSignature(typeParameters, parameters, returnTypeNode) : kind === 170 /* MethodSignature */ ? factory.createMethodSignature(modifiers, (
|
|
52521
|
+
const node = kind === 176 /* CallSignature */ ? factory.createCallSignature(typeParameters, parameters, returnTypeNode) : kind === 177 /* ConstructSignature */ ? factory.createConstructSignature(typeParameters, parameters, returnTypeNode) : kind === 170 /* MethodSignature */ ? factory.createMethodSignature(modifiers, (_b = options == null ? void 0 : options.name) != null ? _b : factory.createIdentifier(""), options == null ? void 0 : options.questionToken, typeParameters, parameters, returnTypeNode) : kind === 171 /* MethodDeclaration */ ? factory.createMethodDeclaration(
|
|
52475
52522
|
modifiers,
|
|
52476
52523
|
/*asteriskToken*/
|
|
52477
52524
|
void 0,
|
|
52478
|
-
(
|
|
52525
|
+
(_c = options == null ? void 0 : options.name) != null ? _c : factory.createIdentifier(""),
|
|
52479
52526
|
/*questionToken*/
|
|
52480
52527
|
void 0,
|
|
52481
52528
|
typeParameters,
|
|
@@ -52490,14 +52537,14 @@ function createTypeChecker(host) {
|
|
|
52490
52537
|
void 0
|
|
52491
52538
|
) : kind === 174 /* GetAccessor */ ? factory.createGetAccessorDeclaration(
|
|
52492
52539
|
modifiers,
|
|
52493
|
-
(
|
|
52540
|
+
(_d = options == null ? void 0 : options.name) != null ? _d : factory.createIdentifier(""),
|
|
52494
52541
|
parameters,
|
|
52495
52542
|
returnTypeNode,
|
|
52496
52543
|
/*body*/
|
|
52497
52544
|
void 0
|
|
52498
52545
|
) : kind === 175 /* SetAccessor */ ? factory.createSetAccessorDeclaration(
|
|
52499
52546
|
modifiers,
|
|
52500
|
-
(
|
|
52547
|
+
(_e = options == null ? void 0 : options.name) != null ? _e : factory.createIdentifier(""),
|
|
52501
52548
|
parameters,
|
|
52502
52549
|
/*body*/
|
|
52503
52550
|
void 0
|
|
@@ -52532,6 +52579,7 @@ function createTypeChecker(host) {
|
|
|
52532
52579
|
if (typeArguments) {
|
|
52533
52580
|
node.typeArguments = factory.createNodeArray(typeArguments);
|
|
52534
52581
|
}
|
|
52582
|
+
cleanup == null ? void 0 : cleanup();
|
|
52535
52583
|
return node;
|
|
52536
52584
|
}
|
|
52537
52585
|
function tryGetThisParameterDeclaration(signature, context) {
|
|
@@ -53146,9 +53194,12 @@ function createTypeChecker(host) {
|
|
|
53146
53194
|
function existingTypeNodeIsNotReferenceOrIsReferenceWithCompatibleTypeArgumentCount(existing, type) {
|
|
53147
53195
|
return !(getObjectFlags(type) & 4 /* Reference */) || !isTypeReferenceNode(existing) || length(existing.typeArguments) >= getMinTypeArgumentCount(type.target.typeParameters);
|
|
53148
53196
|
}
|
|
53197
|
+
function getEnclosingDeclarationIgnoringFakeScope(enclosingDeclaration) {
|
|
53198
|
+
return getNodeLinks(enclosingDeclaration).fakeScopeForSignatureDeclaration ? enclosingDeclaration.parent : enclosingDeclaration;
|
|
53199
|
+
}
|
|
53149
53200
|
function serializeTypeForDeclaration(context, type, symbol, enclosingDeclaration, includePrivateSymbol, bundled) {
|
|
53150
53201
|
if (!isErrorType(type) && enclosingDeclaration) {
|
|
53151
|
-
const declWithExistingAnnotation = getDeclarationWithTypeAnnotation(symbol, enclosingDeclaration);
|
|
53202
|
+
const declWithExistingAnnotation = getDeclarationWithTypeAnnotation(symbol, getEnclosingDeclarationIgnoringFakeScope(enclosingDeclaration));
|
|
53152
53203
|
if (declWithExistingAnnotation && !isFunctionLikeDeclaration(declWithExistingAnnotation) && !isGetAccessorDeclaration(declWithExistingAnnotation)) {
|
|
53153
53204
|
const existing = getEffectiveTypeAnnotationNode(declWithExistingAnnotation);
|
|
53154
53205
|
if (typeNodeIsEquivalentToType(existing, declWithExistingAnnotation, type) && existingTypeNodeIsNotReferenceOrIsReferenceWithCompatibleTypeArgumentCount(existing, type)) {
|
|
@@ -53180,7 +53231,8 @@ function createTypeChecker(host) {
|
|
|
53180
53231
|
function serializeReturnTypeForSignature(context, type, signature, includePrivateSymbol, bundled) {
|
|
53181
53232
|
if (!isErrorType(type) && context.enclosingDeclaration) {
|
|
53182
53233
|
const annotation = signature.declaration && getEffectiveReturnTypeNode(signature.declaration);
|
|
53183
|
-
|
|
53234
|
+
const enclosingDeclarationIgnoringFakeScope = getEnclosingDeclarationIgnoringFakeScope(context.enclosingDeclaration);
|
|
53235
|
+
if (!!findAncestor(annotation, (n) => n === enclosingDeclarationIgnoringFakeScope) && annotation) {
|
|
53184
53236
|
const annotated = getTypeFromTypeNode(annotation);
|
|
53185
53237
|
const thisInstantiated = annotated.flags & 262144 /* TypeParameter */ && annotated.isThisType ? instantiateType(annotated, signature.mapper) : annotated;
|
|
53186
53238
|
if (thisInstantiated === type && existingTypeNodeIsNotReferenceOrIsReferenceWithCompatibleTypeArgumentCount(annotation, type)) {
|
|
@@ -60942,31 +60994,21 @@ function createTypeChecker(host) {
|
|
|
60942
60994
|
}
|
|
60943
60995
|
return type;
|
|
60944
60996
|
function addSpans(texts2, types2) {
|
|
60945
|
-
const isTextsArray = isArray(texts2);
|
|
60946
60997
|
for (let i = 0; i < types2.length; i++) {
|
|
60947
60998
|
const t = types2[i];
|
|
60948
|
-
const addText = isTextsArray ? texts2[i + 1] : texts2;
|
|
60949
60999
|
if (t.flags & (2944 /* Literal */ | 65536 /* Null */ | 32768 /* Undefined */)) {
|
|
60950
61000
|
text += getTemplateStringForType(t) || "";
|
|
60951
|
-
text +=
|
|
60952
|
-
if (!isTextsArray)
|
|
60953
|
-
return true;
|
|
61001
|
+
text += texts2[i + 1];
|
|
60954
61002
|
} else if (t.flags & 134217728 /* TemplateLiteral */) {
|
|
60955
61003
|
text += t.texts[0];
|
|
60956
61004
|
if (!addSpans(t.texts, t.types))
|
|
60957
61005
|
return false;
|
|
60958
|
-
text +=
|
|
60959
|
-
|
|
60960
|
-
return true;
|
|
60961
|
-
} else if (isGenericIndexType(t) || isPatternLiteralPlaceholderType(t)) {
|
|
61006
|
+
text += texts2[i + 1];
|
|
61007
|
+
} else if (isGenericIndexType(t) || isPatternLiteralPlaceholderType(t) || t.flags & 2097152 /* Intersection */) {
|
|
60962
61008
|
newTypes.push(t);
|
|
60963
61009
|
newTexts.push(text);
|
|
60964
|
-
text =
|
|
60965
|
-
} else
|
|
60966
|
-
const added = addSpans(texts2[i + 1], t.types);
|
|
60967
|
-
if (!added)
|
|
60968
|
-
return false;
|
|
60969
|
-
} else if (isTextsArray) {
|
|
61010
|
+
text = texts2[i + 1];
|
|
61011
|
+
} else {
|
|
60970
61012
|
return false;
|
|
60971
61013
|
}
|
|
60972
61014
|
}
|
|
@@ -82425,20 +82467,19 @@ function createTypeChecker(host) {
|
|
|
82425
82467
|
}
|
|
82426
82468
|
}
|
|
82427
82469
|
}
|
|
82428
|
-
function getMemberOverrideModifierStatus(node, member) {
|
|
82470
|
+
function getMemberOverrideModifierStatus(node, member, memberSymbol) {
|
|
82429
82471
|
if (!member.name) {
|
|
82430
82472
|
return 0 /* Ok */;
|
|
82431
82473
|
}
|
|
82432
|
-
const
|
|
82433
|
-
const type = getDeclaredTypeOfSymbol(
|
|
82474
|
+
const classSymbol = getSymbolOfDeclaration(node);
|
|
82475
|
+
const type = getDeclaredTypeOfSymbol(classSymbol);
|
|
82434
82476
|
const typeWithThis = getTypeWithThisArgument(type);
|
|
82435
|
-
const staticType = getTypeOfSymbol(
|
|
82477
|
+
const staticType = getTypeOfSymbol(classSymbol);
|
|
82436
82478
|
const baseTypeNode = getEffectiveBaseTypeNode(node);
|
|
82437
82479
|
const baseTypes = baseTypeNode && getBaseTypes(type);
|
|
82438
82480
|
const baseWithThis = (baseTypes == null ? void 0 : baseTypes.length) ? getTypeWithThisArgument(first(baseTypes), type.thisType) : void 0;
|
|
82439
82481
|
const baseStaticType = getBaseConstructorTypeOfClass(type);
|
|
82440
82482
|
const memberHasOverrideModifier = member.parent ? hasOverrideModifier(member) : hasSyntacticModifier(member, 16384 /* Override */);
|
|
82441
|
-
const memberName = unescapeLeadingUnderscores(getTextOfPropertyName(member.name));
|
|
82442
82483
|
return checkMemberForOverrideModifier(
|
|
82443
82484
|
node,
|
|
82444
82485
|
staticType,
|
|
@@ -82451,7 +82492,7 @@ function createTypeChecker(host) {
|
|
|
82451
82492
|
isStatic(member),
|
|
82452
82493
|
/* memberIsParameterProperty */
|
|
82453
82494
|
false,
|
|
82454
|
-
|
|
82495
|
+
symbolName(memberSymbol)
|
|
82455
82496
|
);
|
|
82456
82497
|
}
|
|
82457
82498
|
function getTargetSymbol(s) {
|
|
@@ -148238,6 +148279,7 @@ var SymbolOriginInfoKind = /* @__PURE__ */ ((SymbolOriginInfoKind2) => {
|
|
|
148238
148279
|
SymbolOriginInfoKind2[SymbolOriginInfoKind2["TypeOnlyAlias"] = 64] = "TypeOnlyAlias";
|
|
148239
148280
|
SymbolOriginInfoKind2[SymbolOriginInfoKind2["ObjectLiteralMethod"] = 128] = "ObjectLiteralMethod";
|
|
148240
148281
|
SymbolOriginInfoKind2[SymbolOriginInfoKind2["Ignore"] = 256] = "Ignore";
|
|
148282
|
+
SymbolOriginInfoKind2[SymbolOriginInfoKind2["ComputedPropertyName"] = 512] = "ComputedPropertyName";
|
|
148241
148283
|
SymbolOriginInfoKind2[SymbolOriginInfoKind2["SymbolMemberNoExport"] = 2 /* SymbolMember */] = "SymbolMemberNoExport";
|
|
148242
148284
|
SymbolOriginInfoKind2[SymbolOriginInfoKind2["SymbolMemberExport"] = 6] = "SymbolMemberExport";
|
|
148243
148285
|
return SymbolOriginInfoKind2;
|
|
@@ -148255,7 +148297,7 @@ function originIsResolvedExport(origin) {
|
|
|
148255
148297
|
return !!(origin && origin.kind === 32 /* ResolvedExport */);
|
|
148256
148298
|
}
|
|
148257
148299
|
function originIncludesSymbolName(origin) {
|
|
148258
|
-
return originIsExport(origin) || originIsResolvedExport(origin);
|
|
148300
|
+
return originIsExport(origin) || originIsResolvedExport(origin) || originIsComputedPropertyName(origin);
|
|
148259
148301
|
}
|
|
148260
148302
|
function originIsPackageJsonImport(origin) {
|
|
148261
148303
|
return (originIsExport(origin) || originIsResolvedExport(origin)) && !!origin.isFromPackageJson;
|
|
@@ -148275,6 +148317,9 @@ function originIsObjectLiteralMethod(origin) {
|
|
|
148275
148317
|
function originIsIgnore(origin) {
|
|
148276
148318
|
return !!(origin && origin.kind & 256 /* Ignore */);
|
|
148277
148319
|
}
|
|
148320
|
+
function originIsComputedPropertyName(origin) {
|
|
148321
|
+
return !!(origin && origin.kind & 512 /* ComputedPropertyName */);
|
|
148322
|
+
}
|
|
148278
148323
|
function resolvingModuleSpecifiers(logPrefix, host, resolver, program, position, preferences, isForImportStatementCompletion, isValidTypeOnlyUseSite, cb) {
|
|
148279
148324
|
var _a2, _b, _c;
|
|
148280
148325
|
const start2 = timestamp();
|
|
@@ -149001,7 +149046,7 @@ function getEntryForMemberCompletion(host, program, options, preferences, name,
|
|
|
149001
149046
|
if (isAbstract) {
|
|
149002
149047
|
requiredModifiers |= 256 /* Abstract */;
|
|
149003
149048
|
}
|
|
149004
|
-
if (isClassElement(node) && checker.getMemberOverrideModifierStatus(classLikeDeclaration, node) === 1 /* NeedsOverride */) {
|
|
149049
|
+
if (isClassElement(node) && checker.getMemberOverrideModifierStatus(classLikeDeclaration, node, symbol) === 1 /* NeedsOverride */) {
|
|
149005
149050
|
requiredModifiers |= 16384 /* Override */;
|
|
149006
149051
|
}
|
|
149007
149052
|
if (!completionNodes.length) {
|
|
@@ -149595,7 +149640,8 @@ function getCompletionEntryDetails(program, log, sourceFile, position, entryId,
|
|
|
149595
149640
|
case "symbol": {
|
|
149596
149641
|
const { symbol, location, contextToken: contextToken2, origin, previousToken: previousToken2 } = symbolCompletion;
|
|
149597
149642
|
const { codeActions, sourceDisplay } = getCompletionEntryCodeActionsAndSourceDisplay(name, location, contextToken2, origin, symbol, program, host, compilerOptions, sourceFile, position, previousToken2, formatContext, preferences, data, source, cancellationToken);
|
|
149598
|
-
|
|
149643
|
+
const symbolName2 = originIsComputedPropertyName(origin) ? origin.symbolName : symbol.name;
|
|
149644
|
+
return createCompletionDetailsForSymbol(symbol, symbolName2, typeChecker, sourceFile, location, cancellationToken, codeActions, sourceDisplay);
|
|
149599
149645
|
}
|
|
149600
149646
|
case "literal": {
|
|
149601
149647
|
const { literal } = symbolCompletion;
|
|
@@ -149646,12 +149692,12 @@ function getCompletionEntryDetails(program, log, sourceFile, position, entryId,
|
|
|
149646
149692
|
function createSimpleDetails(name, kind, kind2) {
|
|
149647
149693
|
return createCompletionDetails(name, "" /* none */, kind, [displayPart(name, kind2)]);
|
|
149648
149694
|
}
|
|
149649
|
-
function createCompletionDetailsForSymbol(symbol, checker, sourceFile, location, cancellationToken, codeActions, sourceDisplay) {
|
|
149695
|
+
function createCompletionDetailsForSymbol(symbol, name, checker, sourceFile, location, cancellationToken, codeActions, sourceDisplay) {
|
|
149650
149696
|
const { displayParts, documentation, symbolKind, tags } = checker.runWithCancellationToken(
|
|
149651
149697
|
cancellationToken,
|
|
149652
149698
|
(checker2) => ts_SymbolDisplay_exports.getSymbolDisplayPartsDocumentationAndSymbolKind(checker2, symbol, sourceFile, location, location, 7 /* All */)
|
|
149653
149699
|
);
|
|
149654
|
-
return createCompletionDetails(
|
|
149700
|
+
return createCompletionDetails(name, ts_SymbolDisplay_exports.getSymbolModifiers(checker, symbol), symbolKind, displayParts, documentation, tags, codeActions, sourceDisplay);
|
|
149655
149701
|
}
|
|
149656
149702
|
function createCompletionDetails(name, kindModifiers, kind, displayParts, documentation, tags, codeActions, source) {
|
|
149657
149703
|
return { name, kindModifiers, kind, displayParts, documentation, tags, codeActions, source, sourceDisplay: source };
|
|
@@ -150758,6 +150804,16 @@ function getCompletionData(program, log, sourceFile, compilerOptions, position,
|
|
|
150758
150804
|
return classElementModifierFlags & 32 /* Static */ ? (type == null ? void 0 : type.symbol) && typeChecker.getPropertiesOfType(typeChecker.getTypeOfSymbolAtLocation(type.symbol, decl)) : type && typeChecker.getPropertiesOfType(type);
|
|
150759
150805
|
});
|
|
150760
150806
|
symbols = concatenate(symbols, filterClassMembersList(baseSymbols, decl.members, classElementModifierFlags));
|
|
150807
|
+
forEach(symbols, (symbol, index) => {
|
|
150808
|
+
const declaration = symbol == null ? void 0 : symbol.valueDeclaration;
|
|
150809
|
+
if (declaration && isClassElement(declaration) && declaration.name && isComputedPropertyName(declaration.name)) {
|
|
150810
|
+
const origin = {
|
|
150811
|
+
kind: 512 /* ComputedPropertyName */,
|
|
150812
|
+
symbolName: typeChecker.symbolToString(symbol)
|
|
150813
|
+
};
|
|
150814
|
+
symbolToOriginInfoMap[index] = origin;
|
|
150815
|
+
}
|
|
150816
|
+
});
|
|
150761
150817
|
}
|
|
150762
150818
|
return 1 /* Success */;
|
|
150763
150819
|
}
|
|
@@ -151142,7 +151198,7 @@ function getCompletionEntryDisplayNameForSymbol(symbol, target, origin, kind, js
|
|
|
151142
151198
|
}
|
|
151143
151199
|
switch (kind) {
|
|
151144
151200
|
case 3 /* MemberLike */:
|
|
151145
|
-
return void 0;
|
|
151201
|
+
return originIsComputedPropertyName(origin) ? { name: origin.symbolName, needsConvertPropertyAccess: false } : void 0;
|
|
151146
151202
|
case 0 /* ObjectPropertyDeclaration */:
|
|
151147
151203
|
return { name: JSON.stringify(name), needsConvertPropertyAccess: false };
|
|
151148
151204
|
case 2 /* PropertyAccess */:
|
|
@@ -151734,7 +151790,7 @@ function stringLiteralCompletionDetails(name, location, completion, sourceFile,
|
|
|
151734
151790
|
}
|
|
151735
151791
|
case 1 /* Properties */: {
|
|
151736
151792
|
const match = find(completion.symbols, (s) => s.name === name);
|
|
151737
|
-
return match && createCompletionDetailsForSymbol(match, checker, sourceFile, location, cancellationToken);
|
|
151793
|
+
return match && createCompletionDetailsForSymbol(match, match.name, checker, sourceFile, location, cancellationToken);
|
|
151738
151794
|
}
|
|
151739
151795
|
case 2 /* Types */:
|
|
151740
151796
|
return find(completion.types, (t) => t.value === name) ? createCompletionDetails(name, "" /* none */, "string" /* string */, [textPart(name)]) : void 0;
|
|
@@ -166453,7 +166509,7 @@ function formatSpanWorker(originalRange, enclosingNode, initialIndentation, delt
|
|
|
166453
166509
|
}
|
|
166454
166510
|
function processChildNode(child, inheritedIndentation, parent2, parentDynamicIndentation, parentStartLine, undecoratedParentStartLine, isListItem, isFirstListItem) {
|
|
166455
166511
|
Debug.assert(!nodeIsSynthesized(child));
|
|
166456
|
-
if (nodeIsMissing(child)) {
|
|
166512
|
+
if (nodeIsMissing(child) || isGrammarError(parent2, child)) {
|
|
166457
166513
|
return inheritedIndentation;
|
|
166458
166514
|
}
|
|
166459
166515
|
const childStartPos = child.getStart(sourceFile);
|
|
@@ -166496,7 +166552,7 @@ function formatSpanWorker(originalRange, enclosingNode, initialIndentation, delt
|
|
|
166496
166552
|
}
|
|
166497
166553
|
if (isToken(child)) {
|
|
166498
166554
|
const tokenInfo = formattingScanner.readTokenInfo(child);
|
|
166499
|
-
if (child.kind !== 11 /* JsxText */
|
|
166555
|
+
if (child.kind !== 11 /* JsxText */) {
|
|
166500
166556
|
Debug.assert(tokenInfo.token.end === child.end, "Token end is child end");
|
|
166501
166557
|
consumeTokenAndAdvanceScanner(tokenInfo, node, parentDynamicIndentation, child);
|
|
166502
166558
|
return inheritedIndentation;
|