@typescript-deploys/pr-build 5.0.0-pr-52728-17 → 5.0.0-pr-52807-23
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 +32 -7
- package/lib/tsserver.js +71 -21
- package/lib/tsserverlibrary.d.ts +13 -0
- package/lib/tsserverlibrary.js +71 -21
- package/lib/typescript.d.ts +13 -0
- package/lib/typescript.js +71 -21
- package/package.json +1 -1
package/lib/tsc.js
CHANGED
|
@@ -42585,7 +42585,6 @@ function createTypeChecker(host) {
|
|
|
42585
42585
|
let inlineLevel = 0;
|
|
42586
42586
|
let currentNode;
|
|
42587
42587
|
let varianceTypeParameter;
|
|
42588
|
-
let isInferencePartiallyBlocked = false;
|
|
42589
42588
|
const emptySymbols = createSymbolTable();
|
|
42590
42589
|
const arrayVariances = [1 /* Covariant */];
|
|
42591
42590
|
const compilerOptions = host.getCompilerOptions();
|
|
@@ -43017,9 +43016,7 @@ function createTypeChecker(host) {
|
|
|
43017
43016
|
toMarkSkip = toMarkSkip.parent;
|
|
43018
43017
|
} while (toMarkSkip && toMarkSkip !== containingCall);
|
|
43019
43018
|
}
|
|
43020
|
-
isInferencePartiallyBlocked = true;
|
|
43021
43019
|
const result = runWithoutResolvedSignatureCaching(node, fn);
|
|
43022
|
-
isInferencePartiallyBlocked = false;
|
|
43023
43020
|
if (containingCall) {
|
|
43024
43021
|
let toMarkSkip = node;
|
|
43025
43022
|
do {
|
|
@@ -61837,6 +61834,17 @@ function createTypeChecker(host) {
|
|
|
61837
61834
|
function getBaseTypeOfLiteralTypeForComparison(type) {
|
|
61838
61835
|
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;
|
|
61839
61836
|
}
|
|
61837
|
+
function getValueOfResult(type) {
|
|
61838
|
+
const valueOf = getPropertyOfType(type, "valueOf");
|
|
61839
|
+
if (valueOf) {
|
|
61840
|
+
const signatures = getSignaturesOfType(getTypeOfSymbol(valueOf), 0 /* Call */);
|
|
61841
|
+
if (signatures && signatures.length > 0) {
|
|
61842
|
+
const returnType = getReturnTypeOfSignature(signatures[0]);
|
|
61843
|
+
return returnType;
|
|
61844
|
+
}
|
|
61845
|
+
}
|
|
61846
|
+
return type;
|
|
61847
|
+
}
|
|
61840
61848
|
function getWidenedLiteralType(type) {
|
|
61841
61849
|
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;
|
|
61842
61850
|
}
|
|
@@ -69661,7 +69669,7 @@ function createTypeChecker(host) {
|
|
|
69661
69669
|
const isTaggedTemplate = node.kind === 212 /* TaggedTemplateExpression */;
|
|
69662
69670
|
const isDecorator2 = node.kind === 167 /* Decorator */;
|
|
69663
69671
|
const isJsxOpeningOrSelfClosingElement = isJsxOpeningLikeElement(node);
|
|
69664
|
-
const reportErrors2 = !
|
|
69672
|
+
const reportErrors2 = !candidatesOutArray;
|
|
69665
69673
|
let typeArguments;
|
|
69666
69674
|
if (!isDecorator2 && !isSuperCall(node)) {
|
|
69667
69675
|
typeArguments = node.typeArguments;
|
|
@@ -72908,9 +72916,17 @@ function createTypeChecker(host) {
|
|
|
72908
72916
|
if (isTypeAny(left2) || isTypeAny(right2)) {
|
|
72909
72917
|
return true;
|
|
72910
72918
|
}
|
|
72919
|
+
if (!(left2.flags & 134348796 /* Primitive */))
|
|
72920
|
+
left2 = getValueOfResult(left2);
|
|
72921
|
+
if (!(right2.flags & 134348796 /* Primitive */))
|
|
72922
|
+
right2 = getValueOfResult(right2);
|
|
72911
72923
|
const leftAssignableToNumber = isTypeAssignableTo(left2, numberOrBigIntType);
|
|
72912
|
-
|
|
72913
|
-
|
|
72924
|
+
if (leftAssignableToNumber) {
|
|
72925
|
+
const rightAssignableToNumber = isTypeAssignableTo(right2, numberOrBigIntType);
|
|
72926
|
+
if (rightAssignableToNumber)
|
|
72927
|
+
return true;
|
|
72928
|
+
}
|
|
72929
|
+
return isTypeAssignableTo(left2, stringType) && isTypeAssignableTo(right2, stringType);
|
|
72914
72930
|
});
|
|
72915
72931
|
}
|
|
72916
72932
|
return booleanType;
|
|
@@ -87640,7 +87656,16 @@ function transformClassFields(context) {
|
|
|
87640
87656
|
visitNode(node.initializer, (child) => namedEvaluationVisitor(child, referencedName), isExpression)
|
|
87641
87657
|
);
|
|
87642
87658
|
}
|
|
87643
|
-
return
|
|
87659
|
+
return factory2.updatePropertyDeclaration(
|
|
87660
|
+
node,
|
|
87661
|
+
visitNodes2(node.modifiers, modifierVisitor, isModifier),
|
|
87662
|
+
visitNode(node.name, propertyNameVisitor, isPropertyName),
|
|
87663
|
+
/*questionOrExclamationToken*/
|
|
87664
|
+
void 0,
|
|
87665
|
+
/*type*/
|
|
87666
|
+
void 0,
|
|
87667
|
+
visitNode(node.initializer, visitor, isExpression)
|
|
87668
|
+
);
|
|
87644
87669
|
}
|
|
87645
87670
|
function transformPublicFieldInitializer(node) {
|
|
87646
87671
|
if (shouldTransformInitializers && !isAutoAccessorPropertyDeclaration(node)) {
|
package/lib/tsserver.js
CHANGED
|
@@ -47161,7 +47161,6 @@ function createTypeChecker(host) {
|
|
|
47161
47161
|
let inlineLevel = 0;
|
|
47162
47162
|
let currentNode;
|
|
47163
47163
|
let varianceTypeParameter;
|
|
47164
|
-
let isInferencePartiallyBlocked = false;
|
|
47165
47164
|
const emptySymbols = createSymbolTable();
|
|
47166
47165
|
const arrayVariances = [1 /* Covariant */];
|
|
47167
47166
|
const compilerOptions = host.getCompilerOptions();
|
|
@@ -47593,9 +47592,7 @@ function createTypeChecker(host) {
|
|
|
47593
47592
|
toMarkSkip = toMarkSkip.parent;
|
|
47594
47593
|
} while (toMarkSkip && toMarkSkip !== containingCall);
|
|
47595
47594
|
}
|
|
47596
|
-
isInferencePartiallyBlocked = true;
|
|
47597
47595
|
const result = runWithoutResolvedSignatureCaching(node, fn);
|
|
47598
|
-
isInferencePartiallyBlocked = false;
|
|
47599
47596
|
if (containingCall) {
|
|
47600
47597
|
let toMarkSkip = node;
|
|
47601
47598
|
do {
|
|
@@ -66413,6 +66410,17 @@ function createTypeChecker(host) {
|
|
|
66413
66410
|
function getBaseTypeOfLiteralTypeForComparison(type) {
|
|
66414
66411
|
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;
|
|
66415
66412
|
}
|
|
66413
|
+
function getValueOfResult(type) {
|
|
66414
|
+
const valueOf = getPropertyOfType(type, "valueOf");
|
|
66415
|
+
if (valueOf) {
|
|
66416
|
+
const signatures = getSignaturesOfType(getTypeOfSymbol(valueOf), 0 /* Call */);
|
|
66417
|
+
if (signatures && signatures.length > 0) {
|
|
66418
|
+
const returnType = getReturnTypeOfSignature(signatures[0]);
|
|
66419
|
+
return returnType;
|
|
66420
|
+
}
|
|
66421
|
+
}
|
|
66422
|
+
return type;
|
|
66423
|
+
}
|
|
66416
66424
|
function getWidenedLiteralType(type) {
|
|
66417
66425
|
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;
|
|
66418
66426
|
}
|
|
@@ -74237,7 +74245,7 @@ function createTypeChecker(host) {
|
|
|
74237
74245
|
const isTaggedTemplate = node.kind === 212 /* TaggedTemplateExpression */;
|
|
74238
74246
|
const isDecorator2 = node.kind === 167 /* Decorator */;
|
|
74239
74247
|
const isJsxOpeningOrSelfClosingElement = isJsxOpeningLikeElement(node);
|
|
74240
|
-
const reportErrors2 = !
|
|
74248
|
+
const reportErrors2 = !candidatesOutArray;
|
|
74241
74249
|
let typeArguments;
|
|
74242
74250
|
if (!isDecorator2 && !isSuperCall(node)) {
|
|
74243
74251
|
typeArguments = node.typeArguments;
|
|
@@ -77484,9 +77492,17 @@ function createTypeChecker(host) {
|
|
|
77484
77492
|
if (isTypeAny(left2) || isTypeAny(right2)) {
|
|
77485
77493
|
return true;
|
|
77486
77494
|
}
|
|
77495
|
+
if (!(left2.flags & 134348796 /* Primitive */))
|
|
77496
|
+
left2 = getValueOfResult(left2);
|
|
77497
|
+
if (!(right2.flags & 134348796 /* Primitive */))
|
|
77498
|
+
right2 = getValueOfResult(right2);
|
|
77487
77499
|
const leftAssignableToNumber = isTypeAssignableTo(left2, numberOrBigIntType);
|
|
77488
|
-
|
|
77489
|
-
|
|
77500
|
+
if (leftAssignableToNumber) {
|
|
77501
|
+
const rightAssignableToNumber = isTypeAssignableTo(right2, numberOrBigIntType);
|
|
77502
|
+
if (rightAssignableToNumber)
|
|
77503
|
+
return true;
|
|
77504
|
+
}
|
|
77505
|
+
return isTypeAssignableTo(left2, stringType) && isTypeAssignableTo(right2, stringType);
|
|
77490
77506
|
});
|
|
77491
77507
|
}
|
|
77492
77508
|
return booleanType;
|
|
@@ -92387,7 +92403,16 @@ function transformClassFields(context) {
|
|
|
92387
92403
|
visitNode(node.initializer, (child) => namedEvaluationVisitor(child, referencedName), isExpression)
|
|
92388
92404
|
);
|
|
92389
92405
|
}
|
|
92390
|
-
return
|
|
92406
|
+
return factory2.updatePropertyDeclaration(
|
|
92407
|
+
node,
|
|
92408
|
+
visitNodes2(node.modifiers, modifierVisitor, isModifier),
|
|
92409
|
+
visitNode(node.name, propertyNameVisitor, isPropertyName),
|
|
92410
|
+
/*questionOrExclamationToken*/
|
|
92411
|
+
void 0,
|
|
92412
|
+
/*type*/
|
|
92413
|
+
void 0,
|
|
92414
|
+
visitNode(node.initializer, visitor, isExpression)
|
|
92415
|
+
);
|
|
92391
92416
|
}
|
|
92392
92417
|
function transformPublicFieldInitializer(node) {
|
|
92393
92418
|
if (shouldTransformInitializers && !isAutoAccessorPropertyDeclaration(node)) {
|
|
@@ -135434,7 +135459,8 @@ function createLanguageService(host, documentRegistry = createDocumentRegistry(h
|
|
|
135434
135459
|
options.triggerCharacter,
|
|
135435
135460
|
options.triggerKind,
|
|
135436
135461
|
cancellationToken,
|
|
135437
|
-
formattingSettings && ts_formatting_exports.getFormatContext(formattingSettings, host)
|
|
135462
|
+
formattingSettings && ts_formatting_exports.getFormatContext(formattingSettings, host),
|
|
135463
|
+
options.includeSymbol
|
|
135438
135464
|
);
|
|
135439
135465
|
}
|
|
135440
135466
|
function getCompletionEntryDetails2(fileName, position, name, formattingOptions, source, preferences = emptyOptions, data) {
|
|
@@ -148262,7 +148288,7 @@ function resolvingModuleSpecifiers(logPrefix, host, resolver, program, position,
|
|
|
148262
148288
|
return result2 || (needsFullResolution ? "failed" : "skipped");
|
|
148263
148289
|
}
|
|
148264
148290
|
}
|
|
148265
|
-
function getCompletionsAtPosition(host, program, log, sourceFile, position, preferences, triggerCharacter, completionKind, cancellationToken, formatContext) {
|
|
148291
|
+
function getCompletionsAtPosition(host, program, log, sourceFile, position, preferences, triggerCharacter, completionKind, cancellationToken, formatContext, includeSymbol = false) {
|
|
148266
148292
|
var _a2;
|
|
148267
148293
|
const { previousToken } = getRelevantTokens(position, sourceFile);
|
|
148268
148294
|
if (triggerCharacter && !isInString(sourceFile, position, previousToken) && !isValidTrigger(sourceFile, triggerCharacter, previousToken, position)) {
|
|
@@ -148284,7 +148310,7 @@ function getCompletionsAtPosition(host, program, log, sourceFile, position, pref
|
|
|
148284
148310
|
} else {
|
|
148285
148311
|
incompleteCompletionsCache == null ? void 0 : incompleteCompletionsCache.clear();
|
|
148286
148312
|
}
|
|
148287
|
-
const stringCompletions = ts_Completions_StringCompletions_exports.getStringLiteralCompletions(sourceFile, position, previousToken, compilerOptions, host, program, log, preferences);
|
|
148313
|
+
const stringCompletions = ts_Completions_StringCompletions_exports.getStringLiteralCompletions(sourceFile, position, previousToken, compilerOptions, host, program, log, preferences, includeSymbol);
|
|
148288
148314
|
if (stringCompletions) {
|
|
148289
148315
|
return stringCompletions;
|
|
148290
148316
|
}
|
|
@@ -148309,7 +148335,7 @@ function getCompletionsAtPosition(host, program, log, sourceFile, position, pref
|
|
|
148309
148335
|
}
|
|
148310
148336
|
switch (completionData.kind) {
|
|
148311
148337
|
case 0 /* Data */:
|
|
148312
|
-
const response = completionInfoFromData(sourceFile, host, program, compilerOptions, log, completionData, preferences, formatContext, position);
|
|
148338
|
+
const response = completionInfoFromData(sourceFile, host, program, compilerOptions, log, completionData, preferences, formatContext, position, includeSymbol);
|
|
148313
148339
|
if (response == null ? void 0 : response.isIncomplete) {
|
|
148314
148340
|
incompleteCompletionsCache == null ? void 0 : incompleteCompletionsCache.set(response);
|
|
148315
148341
|
}
|
|
@@ -148439,7 +148465,7 @@ function keywordFiltersFromSyntaxKind(keywordCompletion) {
|
|
|
148439
148465
|
function getOptionalReplacementSpan(location) {
|
|
148440
148466
|
return (location == null ? void 0 : location.kind) === 79 /* Identifier */ ? createTextSpanFromNode(location) : void 0;
|
|
148441
148467
|
}
|
|
148442
|
-
function completionInfoFromData(sourceFile, host, program, compilerOptions, log, completionData, preferences, formatContext, position) {
|
|
148468
|
+
function completionInfoFromData(sourceFile, host, program, compilerOptions, log, completionData, preferences, formatContext, position, includeSymbol) {
|
|
148443
148469
|
const {
|
|
148444
148470
|
symbols,
|
|
148445
148471
|
contextToken,
|
|
@@ -148513,7 +148539,8 @@ function completionInfoFromData(sourceFile, host, program, compilerOptions, log,
|
|
|
148513
148539
|
symbolToOriginInfoMap,
|
|
148514
148540
|
symbolToSortTextMap,
|
|
148515
148541
|
isJsxIdentifierExpected,
|
|
148516
|
-
isRightOfOpenTag
|
|
148542
|
+
isRightOfOpenTag,
|
|
148543
|
+
includeSymbol
|
|
148517
148544
|
);
|
|
148518
148545
|
if (keywordFilters !== 0 /* None */) {
|
|
148519
148546
|
for (const keywordEntry of getKeywordCompletions(keywordFilters, !insideJsDocTagTypeExpression && isSourceFileJS(sourceFile))) {
|
|
@@ -148762,7 +148789,7 @@ function completionNameForLiteral(sourceFile, preferences, literal) {
|
|
|
148762
148789
|
function createCompletionEntryForLiteral(sourceFile, preferences, literal) {
|
|
148763
148790
|
return { name: completionNameForLiteral(sourceFile, preferences, literal), kind: "string" /* string */, kindModifiers: "" /* none */, sortText: SortText.LocationPriority };
|
|
148764
148791
|
}
|
|
148765
|
-
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) {
|
|
148792
|
+
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) {
|
|
148766
148793
|
let insertText;
|
|
148767
148794
|
let replacementSpan = getReplacementSpanForContextToken(replacementToken);
|
|
148768
148795
|
let data;
|
|
@@ -148876,7 +148903,8 @@ function createCompletionEntry(symbol, sortText, replacementToken, contextToken,
|
|
|
148876
148903
|
isSnippet,
|
|
148877
148904
|
isPackageJsonImport: originIsPackageJsonImport(origin) || void 0,
|
|
148878
148905
|
isImportStatementCompletion: !!importStatementCompletion || void 0,
|
|
148879
|
-
data
|
|
148906
|
+
data,
|
|
148907
|
+
...includeSymbol ? { symbol } : void 0
|
|
148880
148908
|
};
|
|
148881
148909
|
}
|
|
148882
148910
|
function isClassLikeMemberCompletion(symbol, location, sourceFile) {
|
|
@@ -149346,7 +149374,7 @@ function getSourceFromOrigin(origin) {
|
|
|
149346
149374
|
return "TypeOnlyAlias/" /* TypeOnlyAlias */;
|
|
149347
149375
|
}
|
|
149348
149376
|
}
|
|
149349
|
-
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) {
|
|
149377
|
+
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) {
|
|
149350
149378
|
var _a2;
|
|
149351
149379
|
const start2 = timestamp();
|
|
149352
149380
|
const variableDeclaration = getVariableDeclaration(location);
|
|
@@ -149386,7 +149414,8 @@ function getCompletionEntriesFromSymbols(symbols, entries, replacementToken, con
|
|
|
149386
149414
|
kind,
|
|
149387
149415
|
formatContext,
|
|
149388
149416
|
isJsxIdentifierExpected,
|
|
149389
|
-
isRightOfOpenTag
|
|
149417
|
+
isRightOfOpenTag,
|
|
149418
|
+
includeSymbol
|
|
149390
149419
|
);
|
|
149391
149420
|
if (!entry) {
|
|
149392
149421
|
continue;
|
|
@@ -151585,7 +151614,7 @@ function createNameAndKindSet() {
|
|
|
151585
151614
|
values: map2.values.bind(map2)
|
|
151586
151615
|
};
|
|
151587
151616
|
}
|
|
151588
|
-
function getStringLiteralCompletions(sourceFile, position, contextToken, options, host, program, log, preferences) {
|
|
151617
|
+
function getStringLiteralCompletions(sourceFile, position, contextToken, options, host, program, log, preferences, includeSymbol) {
|
|
151589
151618
|
if (isInReferenceComment(sourceFile, position)) {
|
|
151590
151619
|
const entries = getTripleSlashReferenceCompletion(sourceFile, position, options, host);
|
|
151591
151620
|
return entries && convertPathCompletions(entries);
|
|
@@ -151594,10 +151623,10 @@ function getStringLiteralCompletions(sourceFile, position, contextToken, options
|
|
|
151594
151623
|
if (!contextToken || !isStringLiteralLike(contextToken))
|
|
151595
151624
|
return void 0;
|
|
151596
151625
|
const entries = getStringLiteralCompletionEntries(sourceFile, contextToken, position, program.getTypeChecker(), options, host, preferences);
|
|
151597
|
-
return convertStringLiteralCompletions(entries, contextToken, sourceFile, host, program, log, options, preferences, position);
|
|
151626
|
+
return convertStringLiteralCompletions(entries, contextToken, sourceFile, host, program, log, options, preferences, position, includeSymbol);
|
|
151598
151627
|
}
|
|
151599
151628
|
}
|
|
151600
|
-
function convertStringLiteralCompletions(completion, contextToken, sourceFile, host, program, log, options, preferences, position) {
|
|
151629
|
+
function convertStringLiteralCompletions(completion, contextToken, sourceFile, host, program, log, options, preferences, position, includeSymbol) {
|
|
151601
151630
|
if (completion === void 0) {
|
|
151602
151631
|
return void 0;
|
|
151603
151632
|
}
|
|
@@ -151623,7 +151652,28 @@ function convertStringLiteralCompletions(completion, contextToken, sourceFile, h
|
|
|
151623
151652
|
preferences,
|
|
151624
151653
|
options,
|
|
151625
151654
|
/*formatContext*/
|
|
151626
|
-
void 0
|
|
151655
|
+
void 0,
|
|
151656
|
+
/*isTypeOnlyLocation */
|
|
151657
|
+
void 0,
|
|
151658
|
+
/*propertyAccessToConvert*/
|
|
151659
|
+
void 0,
|
|
151660
|
+
/*jsxIdentifierExpected*/
|
|
151661
|
+
void 0,
|
|
151662
|
+
/*isJsxInitializer*/
|
|
151663
|
+
void 0,
|
|
151664
|
+
/*importStatementCompletion*/
|
|
151665
|
+
void 0,
|
|
151666
|
+
/*recommendedCompletion*/
|
|
151667
|
+
void 0,
|
|
151668
|
+
/*symbolToOriginInfoMap*/
|
|
151669
|
+
void 0,
|
|
151670
|
+
/*symbolToSortTextMap*/
|
|
151671
|
+
void 0,
|
|
151672
|
+
/*isJsxIdentifierExpected*/
|
|
151673
|
+
void 0,
|
|
151674
|
+
/*isRightOfOpenTag*/
|
|
151675
|
+
void 0,
|
|
151676
|
+
includeSymbol
|
|
151627
151677
|
);
|
|
151628
151678
|
return { isGlobalCompletion: false, isMemberCompletion: true, isNewIdentifierLocation: completion.hasIndexSignature, optionalReplacementSpan, entries };
|
|
151629
151679
|
}
|
package/lib/tsserverlibrary.d.ts
CHANGED
|
@@ -10073,6 +10073,13 @@ declare namespace ts {
|
|
|
10073
10073
|
*/
|
|
10074
10074
|
triggerCharacter?: CompletionsTriggerCharacter;
|
|
10075
10075
|
triggerKind?: CompletionTriggerKind;
|
|
10076
|
+
/**
|
|
10077
|
+
* Include a `symbol` property on each completion entry object.
|
|
10078
|
+
* Symbols reference cyclic data structures and sometimes an entire TypeChecker instance,
|
|
10079
|
+
* so use caution when serializing or retaining completion entries retrieved with this option.
|
|
10080
|
+
* @default false
|
|
10081
|
+
*/
|
|
10082
|
+
includeSymbol?: boolean;
|
|
10076
10083
|
/** @deprecated Use includeCompletionsForModuleExports */
|
|
10077
10084
|
includeExternalModuleExports?: boolean;
|
|
10078
10085
|
/** @deprecated Use includeCompletionsWithInsertText */
|
|
@@ -10630,6 +10637,12 @@ declare namespace ts {
|
|
|
10630
10637
|
isFromUncheckedFile?: true;
|
|
10631
10638
|
isPackageJsonImport?: true;
|
|
10632
10639
|
isImportStatementCompletion?: true;
|
|
10640
|
+
/**
|
|
10641
|
+
* For API purposes.
|
|
10642
|
+
* Included for non-string completions only when `includeSymbol: true` option is passed to `getCompletionsAtPosition`.
|
|
10643
|
+
* @example Get declaration of completion: `symbol.valueDeclaration`
|
|
10644
|
+
*/
|
|
10645
|
+
symbol?: Symbol;
|
|
10633
10646
|
/**
|
|
10634
10647
|
* A property to be sent back to TS Server in the CompletionDetailsRequest, along with `name`,
|
|
10635
10648
|
* that allows TS Server to look up the symbol represented by the completion item, disambiguating
|
package/lib/tsserverlibrary.js
CHANGED
|
@@ -44970,7 +44970,6 @@ ${lanes.join("\n")}
|
|
|
44970
44970
|
let inlineLevel = 0;
|
|
44971
44971
|
let currentNode;
|
|
44972
44972
|
let varianceTypeParameter;
|
|
44973
|
-
let isInferencePartiallyBlocked = false;
|
|
44974
44973
|
const emptySymbols = createSymbolTable();
|
|
44975
44974
|
const arrayVariances = [1 /* Covariant */];
|
|
44976
44975
|
const compilerOptions = host.getCompilerOptions();
|
|
@@ -45402,9 +45401,7 @@ ${lanes.join("\n")}
|
|
|
45402
45401
|
toMarkSkip = toMarkSkip.parent;
|
|
45403
45402
|
} while (toMarkSkip && toMarkSkip !== containingCall);
|
|
45404
45403
|
}
|
|
45405
|
-
isInferencePartiallyBlocked = true;
|
|
45406
45404
|
const result = runWithoutResolvedSignatureCaching(node, fn);
|
|
45407
|
-
isInferencePartiallyBlocked = false;
|
|
45408
45405
|
if (containingCall) {
|
|
45409
45406
|
let toMarkSkip = node;
|
|
45410
45407
|
do {
|
|
@@ -64222,6 +64219,17 @@ ${lanes.join("\n")}
|
|
|
64222
64219
|
function getBaseTypeOfLiteralTypeForComparison(type) {
|
|
64223
64220
|
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;
|
|
64224
64221
|
}
|
|
64222
|
+
function getValueOfResult(type) {
|
|
64223
|
+
const valueOf = getPropertyOfType(type, "valueOf");
|
|
64224
|
+
if (valueOf) {
|
|
64225
|
+
const signatures = getSignaturesOfType(getTypeOfSymbol(valueOf), 0 /* Call */);
|
|
64226
|
+
if (signatures && signatures.length > 0) {
|
|
64227
|
+
const returnType = getReturnTypeOfSignature(signatures[0]);
|
|
64228
|
+
return returnType;
|
|
64229
|
+
}
|
|
64230
|
+
}
|
|
64231
|
+
return type;
|
|
64232
|
+
}
|
|
64225
64233
|
function getWidenedLiteralType(type) {
|
|
64226
64234
|
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;
|
|
64227
64235
|
}
|
|
@@ -72046,7 +72054,7 @@ ${lanes.join("\n")}
|
|
|
72046
72054
|
const isTaggedTemplate = node.kind === 212 /* TaggedTemplateExpression */;
|
|
72047
72055
|
const isDecorator2 = node.kind === 167 /* Decorator */;
|
|
72048
72056
|
const isJsxOpeningOrSelfClosingElement = isJsxOpeningLikeElement(node);
|
|
72049
|
-
const reportErrors2 = !
|
|
72057
|
+
const reportErrors2 = !candidatesOutArray;
|
|
72050
72058
|
let typeArguments;
|
|
72051
72059
|
if (!isDecorator2 && !isSuperCall(node)) {
|
|
72052
72060
|
typeArguments = node.typeArguments;
|
|
@@ -75293,9 +75301,17 @@ ${lanes.join("\n")}
|
|
|
75293
75301
|
if (isTypeAny(left2) || isTypeAny(right2)) {
|
|
75294
75302
|
return true;
|
|
75295
75303
|
}
|
|
75304
|
+
if (!(left2.flags & 134348796 /* Primitive */))
|
|
75305
|
+
left2 = getValueOfResult(left2);
|
|
75306
|
+
if (!(right2.flags & 134348796 /* Primitive */))
|
|
75307
|
+
right2 = getValueOfResult(right2);
|
|
75296
75308
|
const leftAssignableToNumber = isTypeAssignableTo(left2, numberOrBigIntType);
|
|
75297
|
-
|
|
75298
|
-
|
|
75309
|
+
if (leftAssignableToNumber) {
|
|
75310
|
+
const rightAssignableToNumber = isTypeAssignableTo(right2, numberOrBigIntType);
|
|
75311
|
+
if (rightAssignableToNumber)
|
|
75312
|
+
return true;
|
|
75313
|
+
}
|
|
75314
|
+
return isTypeAssignableTo(left2, stringType) && isTypeAssignableTo(right2, stringType);
|
|
75299
75315
|
});
|
|
75300
75316
|
}
|
|
75301
75317
|
return booleanType;
|
|
@@ -90372,7 +90388,16 @@ ${lanes.join("\n")}
|
|
|
90372
90388
|
visitNode(node.initializer, (child) => namedEvaluationVisitor(child, referencedName), isExpression)
|
|
90373
90389
|
);
|
|
90374
90390
|
}
|
|
90375
|
-
return
|
|
90391
|
+
return factory2.updatePropertyDeclaration(
|
|
90392
|
+
node,
|
|
90393
|
+
visitNodes2(node.modifiers, modifierVisitor, isModifier),
|
|
90394
|
+
visitNode(node.name, propertyNameVisitor, isPropertyName),
|
|
90395
|
+
/*questionOrExclamationToken*/
|
|
90396
|
+
void 0,
|
|
90397
|
+
/*type*/
|
|
90398
|
+
void 0,
|
|
90399
|
+
visitNode(node.initializer, visitor, isExpression)
|
|
90400
|
+
);
|
|
90376
90401
|
}
|
|
90377
90402
|
function transformPublicFieldInitializer(node) {
|
|
90378
90403
|
if (shouldTransformInitializers && !isAutoAccessorPropertyDeclaration(node)) {
|
|
@@ -133202,7 +133227,8 @@ ${lanes.join("\n")}
|
|
|
133202
133227
|
options.triggerCharacter,
|
|
133203
133228
|
options.triggerKind,
|
|
133204
133229
|
cancellationToken,
|
|
133205
|
-
formattingSettings && ts_formatting_exports.getFormatContext(formattingSettings, host)
|
|
133230
|
+
formattingSettings && ts_formatting_exports.getFormatContext(formattingSettings, host),
|
|
133231
|
+
options.includeSymbol
|
|
133206
133232
|
);
|
|
133207
133233
|
}
|
|
133208
133234
|
function getCompletionEntryDetails2(fileName, position, name, formattingOptions, source, preferences = emptyOptions, data) {
|
|
@@ -147317,7 +147343,7 @@ ${lanes.join("\n")}
|
|
|
147317
147343
|
return result2 || (needsFullResolution ? "failed" : "skipped");
|
|
147318
147344
|
}
|
|
147319
147345
|
}
|
|
147320
|
-
function getCompletionsAtPosition(host, program, log, sourceFile, position, preferences, triggerCharacter, completionKind, cancellationToken, formatContext) {
|
|
147346
|
+
function getCompletionsAtPosition(host, program, log, sourceFile, position, preferences, triggerCharacter, completionKind, cancellationToken, formatContext, includeSymbol = false) {
|
|
147321
147347
|
var _a2;
|
|
147322
147348
|
const { previousToken } = getRelevantTokens(position, sourceFile);
|
|
147323
147349
|
if (triggerCharacter && !isInString(sourceFile, position, previousToken) && !isValidTrigger(sourceFile, triggerCharacter, previousToken, position)) {
|
|
@@ -147339,7 +147365,7 @@ ${lanes.join("\n")}
|
|
|
147339
147365
|
} else {
|
|
147340
147366
|
incompleteCompletionsCache == null ? void 0 : incompleteCompletionsCache.clear();
|
|
147341
147367
|
}
|
|
147342
|
-
const stringCompletions = ts_Completions_StringCompletions_exports.getStringLiteralCompletions(sourceFile, position, previousToken, compilerOptions, host, program, log, preferences);
|
|
147368
|
+
const stringCompletions = ts_Completions_StringCompletions_exports.getStringLiteralCompletions(sourceFile, position, previousToken, compilerOptions, host, program, log, preferences, includeSymbol);
|
|
147343
147369
|
if (stringCompletions) {
|
|
147344
147370
|
return stringCompletions;
|
|
147345
147371
|
}
|
|
@@ -147364,7 +147390,7 @@ ${lanes.join("\n")}
|
|
|
147364
147390
|
}
|
|
147365
147391
|
switch (completionData.kind) {
|
|
147366
147392
|
case 0 /* Data */:
|
|
147367
|
-
const response = completionInfoFromData(sourceFile, host, program, compilerOptions, log, completionData, preferences, formatContext, position);
|
|
147393
|
+
const response = completionInfoFromData(sourceFile, host, program, compilerOptions, log, completionData, preferences, formatContext, position, includeSymbol);
|
|
147368
147394
|
if (response == null ? void 0 : response.isIncomplete) {
|
|
147369
147395
|
incompleteCompletionsCache == null ? void 0 : incompleteCompletionsCache.set(response);
|
|
147370
147396
|
}
|
|
@@ -147494,7 +147520,7 @@ ${lanes.join("\n")}
|
|
|
147494
147520
|
function getOptionalReplacementSpan(location) {
|
|
147495
147521
|
return (location == null ? void 0 : location.kind) === 79 /* Identifier */ ? createTextSpanFromNode(location) : void 0;
|
|
147496
147522
|
}
|
|
147497
|
-
function completionInfoFromData(sourceFile, host, program, compilerOptions, log, completionData, preferences, formatContext, position) {
|
|
147523
|
+
function completionInfoFromData(sourceFile, host, program, compilerOptions, log, completionData, preferences, formatContext, position, includeSymbol) {
|
|
147498
147524
|
const {
|
|
147499
147525
|
symbols,
|
|
147500
147526
|
contextToken,
|
|
@@ -147568,7 +147594,8 @@ ${lanes.join("\n")}
|
|
|
147568
147594
|
symbolToOriginInfoMap,
|
|
147569
147595
|
symbolToSortTextMap,
|
|
147570
147596
|
isJsxIdentifierExpected,
|
|
147571
|
-
isRightOfOpenTag
|
|
147597
|
+
isRightOfOpenTag,
|
|
147598
|
+
includeSymbol
|
|
147572
147599
|
);
|
|
147573
147600
|
if (keywordFilters !== 0 /* None */) {
|
|
147574
147601
|
for (const keywordEntry of getKeywordCompletions(keywordFilters, !insideJsDocTagTypeExpression && isSourceFileJS(sourceFile))) {
|
|
@@ -147817,7 +147844,7 @@ ${lanes.join("\n")}
|
|
|
147817
147844
|
function createCompletionEntryForLiteral(sourceFile, preferences, literal) {
|
|
147818
147845
|
return { name: completionNameForLiteral(sourceFile, preferences, literal), kind: "string" /* string */, kindModifiers: "" /* none */, sortText: SortText.LocationPriority };
|
|
147819
147846
|
}
|
|
147820
|
-
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) {
|
|
147847
|
+
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) {
|
|
147821
147848
|
let insertText;
|
|
147822
147849
|
let replacementSpan = getReplacementSpanForContextToken(replacementToken);
|
|
147823
147850
|
let data;
|
|
@@ -147931,7 +147958,8 @@ ${lanes.join("\n")}
|
|
|
147931
147958
|
isSnippet,
|
|
147932
147959
|
isPackageJsonImport: originIsPackageJsonImport(origin) || void 0,
|
|
147933
147960
|
isImportStatementCompletion: !!importStatementCompletion || void 0,
|
|
147934
|
-
data
|
|
147961
|
+
data,
|
|
147962
|
+
...includeSymbol ? { symbol } : void 0
|
|
147935
147963
|
};
|
|
147936
147964
|
}
|
|
147937
147965
|
function isClassLikeMemberCompletion(symbol, location, sourceFile) {
|
|
@@ -148401,7 +148429,7 @@ ${lanes.join("\n")}
|
|
|
148401
148429
|
return "TypeOnlyAlias/" /* TypeOnlyAlias */;
|
|
148402
148430
|
}
|
|
148403
148431
|
}
|
|
148404
|
-
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) {
|
|
148432
|
+
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) {
|
|
148405
148433
|
var _a2;
|
|
148406
148434
|
const start = timestamp();
|
|
148407
148435
|
const variableDeclaration = getVariableDeclaration(location);
|
|
@@ -148441,7 +148469,8 @@ ${lanes.join("\n")}
|
|
|
148441
148469
|
kind,
|
|
148442
148470
|
formatContext,
|
|
148443
148471
|
isJsxIdentifierExpected,
|
|
148444
|
-
isRightOfOpenTag
|
|
148472
|
+
isRightOfOpenTag,
|
|
148473
|
+
includeSymbol
|
|
148445
148474
|
);
|
|
148446
148475
|
if (!entry) {
|
|
148447
148476
|
continue;
|
|
@@ -150682,7 +150711,7 @@ ${lanes.join("\n")}
|
|
|
150682
150711
|
values: map2.values.bind(map2)
|
|
150683
150712
|
};
|
|
150684
150713
|
}
|
|
150685
|
-
function getStringLiteralCompletions(sourceFile, position, contextToken, options, host, program, log, preferences) {
|
|
150714
|
+
function getStringLiteralCompletions(sourceFile, position, contextToken, options, host, program, log, preferences, includeSymbol) {
|
|
150686
150715
|
if (isInReferenceComment(sourceFile, position)) {
|
|
150687
150716
|
const entries = getTripleSlashReferenceCompletion(sourceFile, position, options, host);
|
|
150688
150717
|
return entries && convertPathCompletions(entries);
|
|
@@ -150691,10 +150720,10 @@ ${lanes.join("\n")}
|
|
|
150691
150720
|
if (!contextToken || !isStringLiteralLike(contextToken))
|
|
150692
150721
|
return void 0;
|
|
150693
150722
|
const entries = getStringLiteralCompletionEntries(sourceFile, contextToken, position, program.getTypeChecker(), options, host, preferences);
|
|
150694
|
-
return convertStringLiteralCompletions(entries, contextToken, sourceFile, host, program, log, options, preferences, position);
|
|
150723
|
+
return convertStringLiteralCompletions(entries, contextToken, sourceFile, host, program, log, options, preferences, position, includeSymbol);
|
|
150695
150724
|
}
|
|
150696
150725
|
}
|
|
150697
|
-
function convertStringLiteralCompletions(completion, contextToken, sourceFile, host, program, log, options, preferences, position) {
|
|
150726
|
+
function convertStringLiteralCompletions(completion, contextToken, sourceFile, host, program, log, options, preferences, position, includeSymbol) {
|
|
150698
150727
|
if (completion === void 0) {
|
|
150699
150728
|
return void 0;
|
|
150700
150729
|
}
|
|
@@ -150720,7 +150749,28 @@ ${lanes.join("\n")}
|
|
|
150720
150749
|
preferences,
|
|
150721
150750
|
options,
|
|
150722
150751
|
/*formatContext*/
|
|
150723
|
-
void 0
|
|
150752
|
+
void 0,
|
|
150753
|
+
/*isTypeOnlyLocation */
|
|
150754
|
+
void 0,
|
|
150755
|
+
/*propertyAccessToConvert*/
|
|
150756
|
+
void 0,
|
|
150757
|
+
/*jsxIdentifierExpected*/
|
|
150758
|
+
void 0,
|
|
150759
|
+
/*isJsxInitializer*/
|
|
150760
|
+
void 0,
|
|
150761
|
+
/*importStatementCompletion*/
|
|
150762
|
+
void 0,
|
|
150763
|
+
/*recommendedCompletion*/
|
|
150764
|
+
void 0,
|
|
150765
|
+
/*symbolToOriginInfoMap*/
|
|
150766
|
+
void 0,
|
|
150767
|
+
/*symbolToSortTextMap*/
|
|
150768
|
+
void 0,
|
|
150769
|
+
/*isJsxIdentifierExpected*/
|
|
150770
|
+
void 0,
|
|
150771
|
+
/*isRightOfOpenTag*/
|
|
150772
|
+
void 0,
|
|
150773
|
+
includeSymbol
|
|
150724
150774
|
);
|
|
150725
150775
|
return { isGlobalCompletion: false, isMemberCompletion: true, isNewIdentifierLocation: completion.hasIndexSignature, optionalReplacementSpan, entries };
|
|
150726
150776
|
}
|
package/lib/typescript.d.ts
CHANGED
|
@@ -6171,6 +6171,13 @@ declare namespace ts {
|
|
|
6171
6171
|
*/
|
|
6172
6172
|
triggerCharacter?: CompletionsTriggerCharacter;
|
|
6173
6173
|
triggerKind?: CompletionTriggerKind;
|
|
6174
|
+
/**
|
|
6175
|
+
* Include a `symbol` property on each completion entry object.
|
|
6176
|
+
* Symbols reference cyclic data structures and sometimes an entire TypeChecker instance,
|
|
6177
|
+
* so use caution when serializing or retaining completion entries retrieved with this option.
|
|
6178
|
+
* @default false
|
|
6179
|
+
*/
|
|
6180
|
+
includeSymbol?: boolean;
|
|
6174
6181
|
/** @deprecated Use includeCompletionsForModuleExports */
|
|
6175
6182
|
includeExternalModuleExports?: boolean;
|
|
6176
6183
|
/** @deprecated Use includeCompletionsWithInsertText */
|
|
@@ -6728,6 +6735,12 @@ declare namespace ts {
|
|
|
6728
6735
|
isFromUncheckedFile?: true;
|
|
6729
6736
|
isPackageJsonImport?: true;
|
|
6730
6737
|
isImportStatementCompletion?: true;
|
|
6738
|
+
/**
|
|
6739
|
+
* For API purposes.
|
|
6740
|
+
* Included for non-string completions only when `includeSymbol: true` option is passed to `getCompletionsAtPosition`.
|
|
6741
|
+
* @example Get declaration of completion: `symbol.valueDeclaration`
|
|
6742
|
+
*/
|
|
6743
|
+
symbol?: Symbol;
|
|
6731
6744
|
/**
|
|
6732
6745
|
* A property to be sent back to TS Server in the CompletionDetailsRequest, along with `name`,
|
|
6733
6746
|
* that allows TS Server to look up the symbol represented by the completion item, disambiguating
|
package/lib/typescript.js
CHANGED
|
@@ -44970,7 +44970,6 @@ ${lanes.join("\n")}
|
|
|
44970
44970
|
let inlineLevel = 0;
|
|
44971
44971
|
let currentNode;
|
|
44972
44972
|
let varianceTypeParameter;
|
|
44973
|
-
let isInferencePartiallyBlocked = false;
|
|
44974
44973
|
const emptySymbols = createSymbolTable();
|
|
44975
44974
|
const arrayVariances = [1 /* Covariant */];
|
|
44976
44975
|
const compilerOptions = host.getCompilerOptions();
|
|
@@ -45402,9 +45401,7 @@ ${lanes.join("\n")}
|
|
|
45402
45401
|
toMarkSkip = toMarkSkip.parent;
|
|
45403
45402
|
} while (toMarkSkip && toMarkSkip !== containingCall);
|
|
45404
45403
|
}
|
|
45405
|
-
isInferencePartiallyBlocked = true;
|
|
45406
45404
|
const result = runWithoutResolvedSignatureCaching(node, fn);
|
|
45407
|
-
isInferencePartiallyBlocked = false;
|
|
45408
45405
|
if (containingCall) {
|
|
45409
45406
|
let toMarkSkip = node;
|
|
45410
45407
|
do {
|
|
@@ -64222,6 +64219,17 @@ ${lanes.join("\n")}
|
|
|
64222
64219
|
function getBaseTypeOfLiteralTypeForComparison(type) {
|
|
64223
64220
|
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;
|
|
64224
64221
|
}
|
|
64222
|
+
function getValueOfResult(type) {
|
|
64223
|
+
const valueOf = getPropertyOfType(type, "valueOf");
|
|
64224
|
+
if (valueOf) {
|
|
64225
|
+
const signatures = getSignaturesOfType(getTypeOfSymbol(valueOf), 0 /* Call */);
|
|
64226
|
+
if (signatures && signatures.length > 0) {
|
|
64227
|
+
const returnType = getReturnTypeOfSignature(signatures[0]);
|
|
64228
|
+
return returnType;
|
|
64229
|
+
}
|
|
64230
|
+
}
|
|
64231
|
+
return type;
|
|
64232
|
+
}
|
|
64225
64233
|
function getWidenedLiteralType(type) {
|
|
64226
64234
|
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;
|
|
64227
64235
|
}
|
|
@@ -72046,7 +72054,7 @@ ${lanes.join("\n")}
|
|
|
72046
72054
|
const isTaggedTemplate = node.kind === 212 /* TaggedTemplateExpression */;
|
|
72047
72055
|
const isDecorator2 = node.kind === 167 /* Decorator */;
|
|
72048
72056
|
const isJsxOpeningOrSelfClosingElement = isJsxOpeningLikeElement(node);
|
|
72049
|
-
const reportErrors2 = !
|
|
72057
|
+
const reportErrors2 = !candidatesOutArray;
|
|
72050
72058
|
let typeArguments;
|
|
72051
72059
|
if (!isDecorator2 && !isSuperCall(node)) {
|
|
72052
72060
|
typeArguments = node.typeArguments;
|
|
@@ -75293,9 +75301,17 @@ ${lanes.join("\n")}
|
|
|
75293
75301
|
if (isTypeAny(left2) || isTypeAny(right2)) {
|
|
75294
75302
|
return true;
|
|
75295
75303
|
}
|
|
75304
|
+
if (!(left2.flags & 134348796 /* Primitive */))
|
|
75305
|
+
left2 = getValueOfResult(left2);
|
|
75306
|
+
if (!(right2.flags & 134348796 /* Primitive */))
|
|
75307
|
+
right2 = getValueOfResult(right2);
|
|
75296
75308
|
const leftAssignableToNumber = isTypeAssignableTo(left2, numberOrBigIntType);
|
|
75297
|
-
|
|
75298
|
-
|
|
75309
|
+
if (leftAssignableToNumber) {
|
|
75310
|
+
const rightAssignableToNumber = isTypeAssignableTo(right2, numberOrBigIntType);
|
|
75311
|
+
if (rightAssignableToNumber)
|
|
75312
|
+
return true;
|
|
75313
|
+
}
|
|
75314
|
+
return isTypeAssignableTo(left2, stringType) && isTypeAssignableTo(right2, stringType);
|
|
75299
75315
|
});
|
|
75300
75316
|
}
|
|
75301
75317
|
return booleanType;
|
|
@@ -90372,7 +90388,16 @@ ${lanes.join("\n")}
|
|
|
90372
90388
|
visitNode(node.initializer, (child) => namedEvaluationVisitor(child, referencedName), isExpression)
|
|
90373
90389
|
);
|
|
90374
90390
|
}
|
|
90375
|
-
return
|
|
90391
|
+
return factory2.updatePropertyDeclaration(
|
|
90392
|
+
node,
|
|
90393
|
+
visitNodes2(node.modifiers, modifierVisitor, isModifier),
|
|
90394
|
+
visitNode(node.name, propertyNameVisitor, isPropertyName),
|
|
90395
|
+
/*questionOrExclamationToken*/
|
|
90396
|
+
void 0,
|
|
90397
|
+
/*type*/
|
|
90398
|
+
void 0,
|
|
90399
|
+
visitNode(node.initializer, visitor, isExpression)
|
|
90400
|
+
);
|
|
90376
90401
|
}
|
|
90377
90402
|
function transformPublicFieldInitializer(node) {
|
|
90378
90403
|
if (shouldTransformInitializers && !isAutoAccessorPropertyDeclaration(node)) {
|
|
@@ -133216,7 +133241,8 @@ ${lanes.join("\n")}
|
|
|
133216
133241
|
options.triggerCharacter,
|
|
133217
133242
|
options.triggerKind,
|
|
133218
133243
|
cancellationToken,
|
|
133219
|
-
formattingSettings && ts_formatting_exports.getFormatContext(formattingSettings, host)
|
|
133244
|
+
formattingSettings && ts_formatting_exports.getFormatContext(formattingSettings, host),
|
|
133245
|
+
options.includeSymbol
|
|
133220
133246
|
);
|
|
133221
133247
|
}
|
|
133222
133248
|
function getCompletionEntryDetails2(fileName, position, name, formattingOptions, source, preferences = emptyOptions, data) {
|
|
@@ -147331,7 +147357,7 @@ ${lanes.join("\n")}
|
|
|
147331
147357
|
return result2 || (needsFullResolution ? "failed" : "skipped");
|
|
147332
147358
|
}
|
|
147333
147359
|
}
|
|
147334
|
-
function getCompletionsAtPosition(host, program, log, sourceFile, position, preferences, triggerCharacter, completionKind, cancellationToken, formatContext) {
|
|
147360
|
+
function getCompletionsAtPosition(host, program, log, sourceFile, position, preferences, triggerCharacter, completionKind, cancellationToken, formatContext, includeSymbol = false) {
|
|
147335
147361
|
var _a2;
|
|
147336
147362
|
const { previousToken } = getRelevantTokens(position, sourceFile);
|
|
147337
147363
|
if (triggerCharacter && !isInString(sourceFile, position, previousToken) && !isValidTrigger(sourceFile, triggerCharacter, previousToken, position)) {
|
|
@@ -147353,7 +147379,7 @@ ${lanes.join("\n")}
|
|
|
147353
147379
|
} else {
|
|
147354
147380
|
incompleteCompletionsCache == null ? void 0 : incompleteCompletionsCache.clear();
|
|
147355
147381
|
}
|
|
147356
|
-
const stringCompletions = ts_Completions_StringCompletions_exports.getStringLiteralCompletions(sourceFile, position, previousToken, compilerOptions, host, program, log, preferences);
|
|
147382
|
+
const stringCompletions = ts_Completions_StringCompletions_exports.getStringLiteralCompletions(sourceFile, position, previousToken, compilerOptions, host, program, log, preferences, includeSymbol);
|
|
147357
147383
|
if (stringCompletions) {
|
|
147358
147384
|
return stringCompletions;
|
|
147359
147385
|
}
|
|
@@ -147378,7 +147404,7 @@ ${lanes.join("\n")}
|
|
|
147378
147404
|
}
|
|
147379
147405
|
switch (completionData.kind) {
|
|
147380
147406
|
case 0 /* Data */:
|
|
147381
|
-
const response = completionInfoFromData(sourceFile, host, program, compilerOptions, log, completionData, preferences, formatContext, position);
|
|
147407
|
+
const response = completionInfoFromData(sourceFile, host, program, compilerOptions, log, completionData, preferences, formatContext, position, includeSymbol);
|
|
147382
147408
|
if (response == null ? void 0 : response.isIncomplete) {
|
|
147383
147409
|
incompleteCompletionsCache == null ? void 0 : incompleteCompletionsCache.set(response);
|
|
147384
147410
|
}
|
|
@@ -147508,7 +147534,7 @@ ${lanes.join("\n")}
|
|
|
147508
147534
|
function getOptionalReplacementSpan(location) {
|
|
147509
147535
|
return (location == null ? void 0 : location.kind) === 79 /* Identifier */ ? createTextSpanFromNode(location) : void 0;
|
|
147510
147536
|
}
|
|
147511
|
-
function completionInfoFromData(sourceFile, host, program, compilerOptions, log, completionData, preferences, formatContext, position) {
|
|
147537
|
+
function completionInfoFromData(sourceFile, host, program, compilerOptions, log, completionData, preferences, formatContext, position, includeSymbol) {
|
|
147512
147538
|
const {
|
|
147513
147539
|
symbols,
|
|
147514
147540
|
contextToken,
|
|
@@ -147582,7 +147608,8 @@ ${lanes.join("\n")}
|
|
|
147582
147608
|
symbolToOriginInfoMap,
|
|
147583
147609
|
symbolToSortTextMap,
|
|
147584
147610
|
isJsxIdentifierExpected,
|
|
147585
|
-
isRightOfOpenTag
|
|
147611
|
+
isRightOfOpenTag,
|
|
147612
|
+
includeSymbol
|
|
147586
147613
|
);
|
|
147587
147614
|
if (keywordFilters !== 0 /* None */) {
|
|
147588
147615
|
for (const keywordEntry of getKeywordCompletions(keywordFilters, !insideJsDocTagTypeExpression && isSourceFileJS(sourceFile))) {
|
|
@@ -147831,7 +147858,7 @@ ${lanes.join("\n")}
|
|
|
147831
147858
|
function createCompletionEntryForLiteral(sourceFile, preferences, literal) {
|
|
147832
147859
|
return { name: completionNameForLiteral(sourceFile, preferences, literal), kind: "string" /* string */, kindModifiers: "" /* none */, sortText: SortText.LocationPriority };
|
|
147833
147860
|
}
|
|
147834
|
-
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) {
|
|
147861
|
+
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) {
|
|
147835
147862
|
let insertText;
|
|
147836
147863
|
let replacementSpan = getReplacementSpanForContextToken(replacementToken);
|
|
147837
147864
|
let data;
|
|
@@ -147945,7 +147972,8 @@ ${lanes.join("\n")}
|
|
|
147945
147972
|
isSnippet,
|
|
147946
147973
|
isPackageJsonImport: originIsPackageJsonImport(origin) || void 0,
|
|
147947
147974
|
isImportStatementCompletion: !!importStatementCompletion || void 0,
|
|
147948
|
-
data
|
|
147975
|
+
data,
|
|
147976
|
+
...includeSymbol ? { symbol } : void 0
|
|
147949
147977
|
};
|
|
147950
147978
|
}
|
|
147951
147979
|
function isClassLikeMemberCompletion(symbol, location, sourceFile) {
|
|
@@ -148415,7 +148443,7 @@ ${lanes.join("\n")}
|
|
|
148415
148443
|
return "TypeOnlyAlias/" /* TypeOnlyAlias */;
|
|
148416
148444
|
}
|
|
148417
148445
|
}
|
|
148418
|
-
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) {
|
|
148446
|
+
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) {
|
|
148419
148447
|
var _a2;
|
|
148420
148448
|
const start = timestamp();
|
|
148421
148449
|
const variableDeclaration = getVariableDeclaration(location);
|
|
@@ -148455,7 +148483,8 @@ ${lanes.join("\n")}
|
|
|
148455
148483
|
kind,
|
|
148456
148484
|
formatContext,
|
|
148457
148485
|
isJsxIdentifierExpected,
|
|
148458
|
-
isRightOfOpenTag
|
|
148486
|
+
isRightOfOpenTag,
|
|
148487
|
+
includeSymbol
|
|
148459
148488
|
);
|
|
148460
148489
|
if (!entry) {
|
|
148461
148490
|
continue;
|
|
@@ -150696,7 +150725,7 @@ ${lanes.join("\n")}
|
|
|
150696
150725
|
values: map2.values.bind(map2)
|
|
150697
150726
|
};
|
|
150698
150727
|
}
|
|
150699
|
-
function getStringLiteralCompletions(sourceFile, position, contextToken, options, host, program, log, preferences) {
|
|
150728
|
+
function getStringLiteralCompletions(sourceFile, position, contextToken, options, host, program, log, preferences, includeSymbol) {
|
|
150700
150729
|
if (isInReferenceComment(sourceFile, position)) {
|
|
150701
150730
|
const entries = getTripleSlashReferenceCompletion(sourceFile, position, options, host);
|
|
150702
150731
|
return entries && convertPathCompletions(entries);
|
|
@@ -150705,10 +150734,10 @@ ${lanes.join("\n")}
|
|
|
150705
150734
|
if (!contextToken || !isStringLiteralLike(contextToken))
|
|
150706
150735
|
return void 0;
|
|
150707
150736
|
const entries = getStringLiteralCompletionEntries(sourceFile, contextToken, position, program.getTypeChecker(), options, host, preferences);
|
|
150708
|
-
return convertStringLiteralCompletions(entries, contextToken, sourceFile, host, program, log, options, preferences, position);
|
|
150737
|
+
return convertStringLiteralCompletions(entries, contextToken, sourceFile, host, program, log, options, preferences, position, includeSymbol);
|
|
150709
150738
|
}
|
|
150710
150739
|
}
|
|
150711
|
-
function convertStringLiteralCompletions(completion, contextToken, sourceFile, host, program, log, options, preferences, position) {
|
|
150740
|
+
function convertStringLiteralCompletions(completion, contextToken, sourceFile, host, program, log, options, preferences, position, includeSymbol) {
|
|
150712
150741
|
if (completion === void 0) {
|
|
150713
150742
|
return void 0;
|
|
150714
150743
|
}
|
|
@@ -150734,7 +150763,28 @@ ${lanes.join("\n")}
|
|
|
150734
150763
|
preferences,
|
|
150735
150764
|
options,
|
|
150736
150765
|
/*formatContext*/
|
|
150737
|
-
void 0
|
|
150766
|
+
void 0,
|
|
150767
|
+
/*isTypeOnlyLocation */
|
|
150768
|
+
void 0,
|
|
150769
|
+
/*propertyAccessToConvert*/
|
|
150770
|
+
void 0,
|
|
150771
|
+
/*jsxIdentifierExpected*/
|
|
150772
|
+
void 0,
|
|
150773
|
+
/*isJsxInitializer*/
|
|
150774
|
+
void 0,
|
|
150775
|
+
/*importStatementCompletion*/
|
|
150776
|
+
void 0,
|
|
150777
|
+
/*recommendedCompletion*/
|
|
150778
|
+
void 0,
|
|
150779
|
+
/*symbolToOriginInfoMap*/
|
|
150780
|
+
void 0,
|
|
150781
|
+
/*symbolToSortTextMap*/
|
|
150782
|
+
void 0,
|
|
150783
|
+
/*isJsxIdentifierExpected*/
|
|
150784
|
+
void 0,
|
|
150785
|
+
/*isRightOfOpenTag*/
|
|
150786
|
+
void 0,
|
|
150787
|
+
includeSymbol
|
|
150738
150788
|
);
|
|
150739
150789
|
return { isGlobalCompletion: false, isMemberCompletion: true, isNewIdentifierLocation: completion.hasIndexSignature, optionalReplacementSpan, entries };
|
|
150740
150790
|
}
|
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "@typescript-deploys/pr-build",
|
|
3
3
|
"author": "Microsoft Corp.",
|
|
4
4
|
"homepage": "https://www.typescriptlang.org/",
|
|
5
|
-
"version": "5.0.0-pr-
|
|
5
|
+
"version": "5.0.0-pr-52807-23",
|
|
6
6
|
"license": "Apache-2.0",
|
|
7
7
|
"description": "TypeScript is a language for application scale JavaScript development",
|
|
8
8
|
"keywords": [
|