typescript 5.0.0-dev.20230215 → 5.0.0-dev.20230217
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 +37 -12
- package/lib/tsserver.js +122 -36
- package/lib/tsserverlibrary.d.ts +13 -0
- package/lib/tsserverlibrary.js +121 -36
- package/lib/typescript.d.ts +13 -0
- package/lib/typescript.js +120 -36
- package/lib/typingsInstaller.js +2 -4
- 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.20230217`;
|
|
39
39
|
Comparison = /* @__PURE__ */ ((Comparison3) => {
|
|
40
40
|
Comparison3[Comparison3["LessThan"] = -1] = "LessThan";
|
|
41
41
|
Comparison3[Comparison3["EqualTo"] = 0] = "EqualTo";
|
|
@@ -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);
|
|
@@ -29414,7 +29444,6 @@ ${lanes.join("\n")}
|
|
|
29414
29444
|
return canFollowExportModifier();
|
|
29415
29445
|
case 88 /* DefaultKeyword */:
|
|
29416
29446
|
return nextTokenCanFollowDefaultKeyword();
|
|
29417
|
-
case 127 /* AccessorKeyword */:
|
|
29418
29447
|
case 124 /* StaticKeyword */:
|
|
29419
29448
|
case 137 /* GetKeyword */:
|
|
29420
29449
|
case 151 /* SetKeyword */:
|
|
@@ -30707,6 +30736,7 @@ ${lanes.join("\n")}
|
|
|
30707
30736
|
const hasJSDoc = hasPrecedingJSDocComment();
|
|
30708
30737
|
const modifiers = parseModifiersForConstructorType();
|
|
30709
30738
|
const isConstructorType = parseOptional(103 /* NewKeyword */);
|
|
30739
|
+
Debug.assert(!modifiers || isConstructorType, "Per isStartOfFunctionOrConstructorType, a function type cannot have modifiers.");
|
|
30710
30740
|
const typeParameters = parseTypeParameters();
|
|
30711
30741
|
const parameters = parseParameters(4 /* Type */);
|
|
30712
30742
|
const type = parseReturnType(
|
|
@@ -30715,8 +30745,6 @@ ${lanes.join("\n")}
|
|
|
30715
30745
|
false
|
|
30716
30746
|
);
|
|
30717
30747
|
const node = isConstructorType ? factory2.createConstructorTypeNode(modifiers, typeParameters, parameters, type) : factory2.createFunctionTypeNode(typeParameters, parameters, type);
|
|
30718
|
-
if (!isConstructorType)
|
|
30719
|
-
node.modifiers = modifiers;
|
|
30720
30748
|
return withJSDoc(finishNode(node, pos), hasJSDoc);
|
|
30721
30749
|
}
|
|
30722
30750
|
function parseKeywordAndNoDot() {
|
|
@@ -44971,6 +44999,7 @@ ${lanes.join("\n")}
|
|
|
44971
44999
|
let inlineLevel = 0;
|
|
44972
45000
|
let currentNode;
|
|
44973
45001
|
let varianceTypeParameter;
|
|
45002
|
+
let isInferencePartiallyBlocked = false;
|
|
44974
45003
|
const emptySymbols = createSymbolTable();
|
|
44975
45004
|
const arrayVariances = [1 /* Covariant */];
|
|
44976
45005
|
const compilerOptions = host.getCompilerOptions();
|
|
@@ -45402,7 +45431,9 @@ ${lanes.join("\n")}
|
|
|
45402
45431
|
toMarkSkip = toMarkSkip.parent;
|
|
45403
45432
|
} while (toMarkSkip && toMarkSkip !== containingCall);
|
|
45404
45433
|
}
|
|
45434
|
+
isInferencePartiallyBlocked = true;
|
|
45405
45435
|
const result = runWithoutResolvedSignatureCaching(node, fn);
|
|
45436
|
+
isInferencePartiallyBlocked = false;
|
|
45406
45437
|
if (containingCall) {
|
|
45407
45438
|
let toMarkSkip = node;
|
|
45408
45439
|
do {
|
|
@@ -55448,6 +55479,7 @@ ${lanes.join("\n")}
|
|
|
55448
55479
|
const typeParameter = getTypeParameterFromMappedType(type);
|
|
55449
55480
|
const constraintType = getConstraintTypeFromMappedType(type);
|
|
55450
55481
|
const nameType = getNameTypeFromMappedType(type.target || type);
|
|
55482
|
+
const isFilteringMappedType = nameType && isTypeAssignableTo(nameType, typeParameter);
|
|
55451
55483
|
const templateType = getTemplateTypeFromMappedType(type.target || type);
|
|
55452
55484
|
const modifiersType = getApparentType(getModifiersTypeFromMappedType(type));
|
|
55453
55485
|
const templateModifiers = getMappedTypeModifiers(type);
|
|
@@ -55485,7 +55517,7 @@ ${lanes.join("\n")}
|
|
|
55485
55517
|
prop.links.keyType = keyType;
|
|
55486
55518
|
if (modifiersProp) {
|
|
55487
55519
|
prop.links.syntheticOrigin = modifiersProp;
|
|
55488
|
-
prop.declarations = nameType
|
|
55520
|
+
prop.declarations = !nameType || isFilteringMappedType ? modifiersProp.declarations : void 0;
|
|
55489
55521
|
}
|
|
55490
55522
|
members.set(propName, prop);
|
|
55491
55523
|
}
|
|
@@ -64217,6 +64249,9 @@ ${lanes.join("\n")}
|
|
|
64217
64249
|
const key = `B${getTypeId(type)}`;
|
|
64218
64250
|
return (_a2 = getCachedType(key)) != null ? _a2 : setCachedType(key, mapType(type, getBaseTypeOfLiteralType));
|
|
64219
64251
|
}
|
|
64252
|
+
function getBaseTypeOfLiteralTypeForComparison(type) {
|
|
64253
|
+
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;
|
|
64254
|
+
}
|
|
64220
64255
|
function getWidenedLiteralType(type) {
|
|
64221
64256
|
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;
|
|
64222
64257
|
}
|
|
@@ -72041,7 +72076,7 @@ ${lanes.join("\n")}
|
|
|
72041
72076
|
const isTaggedTemplate = node.kind === 212 /* TaggedTemplateExpression */;
|
|
72042
72077
|
const isDecorator2 = node.kind === 167 /* Decorator */;
|
|
72043
72078
|
const isJsxOpeningOrSelfClosingElement = isJsxOpeningLikeElement(node);
|
|
72044
|
-
const reportErrors2 = !candidatesOutArray;
|
|
72079
|
+
const reportErrors2 = !isInferencePartiallyBlocked && !candidatesOutArray;
|
|
72045
72080
|
let typeArguments;
|
|
72046
72081
|
if (!isDecorator2 && !isSuperCall(node)) {
|
|
72047
72082
|
typeArguments = node.typeArguments;
|
|
@@ -75282,8 +75317,8 @@ ${lanes.join("\n")}
|
|
|
75282
75317
|
case 32 /* LessThanEqualsToken */:
|
|
75283
75318
|
case 33 /* GreaterThanEqualsToken */:
|
|
75284
75319
|
if (checkForDisallowedESSymbolOperand(operator)) {
|
|
75285
|
-
leftType =
|
|
75286
|
-
rightType =
|
|
75320
|
+
leftType = getBaseTypeOfLiteralTypeForComparison(checkNonNullType(leftType, left));
|
|
75321
|
+
rightType = getBaseTypeOfLiteralTypeForComparison(checkNonNullType(rightType, right));
|
|
75287
75322
|
reportOperatorErrorUnless((left2, right2) => {
|
|
75288
75323
|
if (isTypeAny(left2) || isTypeAny(right2)) {
|
|
75289
75324
|
return true;
|
|
@@ -77119,6 +77154,17 @@ ${lanes.join("\n")}
|
|
|
77119
77154
|
lastSeenNonAmbientDeclaration = node;
|
|
77120
77155
|
}
|
|
77121
77156
|
}
|
|
77157
|
+
if (isInJSFile(current) && isFunctionLike(current) && current.jsDoc) {
|
|
77158
|
+
for (const node2 of current.jsDoc) {
|
|
77159
|
+
if (node2.tags) {
|
|
77160
|
+
for (const tag of node2.tags) {
|
|
77161
|
+
if (isJSDocOverloadTag(tag)) {
|
|
77162
|
+
hasOverloads = true;
|
|
77163
|
+
}
|
|
77164
|
+
}
|
|
77165
|
+
}
|
|
77166
|
+
}
|
|
77167
|
+
}
|
|
77122
77168
|
}
|
|
77123
77169
|
}
|
|
77124
77170
|
if (multipleConstructorImplementation) {
|
|
@@ -77156,8 +77202,9 @@ ${lanes.join("\n")}
|
|
|
77156
77202
|
const bodySignature = getSignatureFromDeclaration(bodyDeclaration);
|
|
77157
77203
|
for (const signature of signatures) {
|
|
77158
77204
|
if (!isImplementationCompatibleWithOverload(bodySignature, signature)) {
|
|
77205
|
+
const errorNode = signature.declaration && isJSDocSignature(signature.declaration) ? signature.declaration.parent.tagName : signature.declaration;
|
|
77159
77206
|
addRelatedInfo(
|
|
77160
|
-
error(
|
|
77207
|
+
error(errorNode, Diagnostics.This_overload_signature_is_not_compatible_with_its_implementation_signature),
|
|
77161
77208
|
createDiagnosticForNode(bodyDeclaration, Diagnostics.The_implementation_signature_is_declared_here)
|
|
77162
77209
|
);
|
|
77163
77210
|
break;
|
|
@@ -83773,7 +83820,6 @@ ${lanes.join("\n")}
|
|
|
83773
83820
|
case 299 /* PropertyAssignment */:
|
|
83774
83821
|
case 300 /* ShorthandPropertyAssignment */:
|
|
83775
83822
|
case 267 /* NamespaceExportDeclaration */:
|
|
83776
|
-
case 181 /* FunctionType */:
|
|
83777
83823
|
case 279 /* MissingDeclaration */:
|
|
83778
83824
|
return find(node.modifiers, isModifier);
|
|
83779
83825
|
default:
|
|
@@ -90367,7 +90413,16 @@ ${lanes.join("\n")}
|
|
|
90367
90413
|
visitNode(node.initializer, (child) => namedEvaluationVisitor(child, referencedName), isExpression)
|
|
90368
90414
|
);
|
|
90369
90415
|
}
|
|
90370
|
-
return
|
|
90416
|
+
return factory2.updatePropertyDeclaration(
|
|
90417
|
+
node,
|
|
90418
|
+
visitNodes2(node.modifiers, modifierVisitor, isModifier),
|
|
90419
|
+
visitNode(node.name, propertyNameVisitor, isPropertyName),
|
|
90420
|
+
/*questionOrExclamationToken*/
|
|
90421
|
+
void 0,
|
|
90422
|
+
/*type*/
|
|
90423
|
+
void 0,
|
|
90424
|
+
visitNode(node.initializer, visitor, isExpression)
|
|
90425
|
+
);
|
|
90371
90426
|
}
|
|
90372
90427
|
function transformPublicFieldInitializer(node) {
|
|
90373
90428
|
if (shouldTransformInitializers && !isAutoAccessorPropertyDeclaration(node)) {
|
|
@@ -133211,7 +133266,8 @@ ${lanes.join("\n")}
|
|
|
133211
133266
|
options.triggerCharacter,
|
|
133212
133267
|
options.triggerKind,
|
|
133213
133268
|
cancellationToken,
|
|
133214
|
-
formattingSettings && ts_formatting_exports.getFormatContext(formattingSettings, host)
|
|
133269
|
+
formattingSettings && ts_formatting_exports.getFormatContext(formattingSettings, host),
|
|
133270
|
+
options.includeSymbol
|
|
133215
133271
|
);
|
|
133216
133272
|
}
|
|
133217
133273
|
function getCompletionEntryDetails2(fileName, position, name, formattingOptions, source, preferences = emptyOptions, data) {
|
|
@@ -145843,13 +145899,7 @@ ${lanes.join("\n")}
|
|
|
145843
145899
|
function getReturnTypeFromSignatures(signatures, checker, context, enclosingDeclaration) {
|
|
145844
145900
|
if (length(signatures)) {
|
|
145845
145901
|
const type = checker.getUnionType(map(signatures, checker.getReturnTypeOfSignature));
|
|
145846
|
-
return checker.typeToTypeNode(
|
|
145847
|
-
type,
|
|
145848
|
-
enclosingDeclaration,
|
|
145849
|
-
/*flags*/
|
|
145850
|
-
void 0,
|
|
145851
|
-
getNoopSymbolTrackerWithResolver(context)
|
|
145852
|
-
);
|
|
145902
|
+
return checker.typeToTypeNode(type, enclosingDeclaration, 1 /* NoTruncation */, getNoopSymbolTrackerWithResolver(context));
|
|
145853
145903
|
}
|
|
145854
145904
|
}
|
|
145855
145905
|
function createStubbedMethod(modifiers, name, optional, typeParameters, parameters, returnType, quotePreference, body) {
|
|
@@ -146141,7 +146191,14 @@ ${lanes.join("\n")}
|
|
|
146141
146191
|
changeTracker.replaceNode(file, declaration, property);
|
|
146142
146192
|
}
|
|
146143
146193
|
function updatePropertyAssignmentDeclaration(changeTracker, file, declaration, fieldName) {
|
|
146144
|
-
|
|
146194
|
+
let assignment = factory.updatePropertyAssignment(declaration, fieldName, declaration.initializer);
|
|
146195
|
+
if (assignment.modifiers || assignment.questionToken || assignment.exclamationToken) {
|
|
146196
|
+
if (assignment === declaration)
|
|
146197
|
+
assignment = factory.cloneNode(assignment);
|
|
146198
|
+
assignment.modifiers = void 0;
|
|
146199
|
+
assignment.questionToken = void 0;
|
|
146200
|
+
assignment.exclamationToken = void 0;
|
|
146201
|
+
}
|
|
146145
146202
|
changeTracker.replacePropertyAssignment(file, declaration, assignment);
|
|
146146
146203
|
}
|
|
146147
146204
|
function updateFieldDeclaration(changeTracker, file, declaration, type, fieldName, modifiers) {
|
|
@@ -147332,7 +147389,7 @@ ${lanes.join("\n")}
|
|
|
147332
147389
|
return result2 || (needsFullResolution ? "failed" : "skipped");
|
|
147333
147390
|
}
|
|
147334
147391
|
}
|
|
147335
|
-
function getCompletionsAtPosition(host, program, log, sourceFile, position, preferences, triggerCharacter, completionKind, cancellationToken, formatContext) {
|
|
147392
|
+
function getCompletionsAtPosition(host, program, log, sourceFile, position, preferences, triggerCharacter, completionKind, cancellationToken, formatContext, includeSymbol = false) {
|
|
147336
147393
|
var _a2;
|
|
147337
147394
|
const { previousToken } = getRelevantTokens(position, sourceFile);
|
|
147338
147395
|
if (triggerCharacter && !isInString(sourceFile, position, previousToken) && !isValidTrigger(sourceFile, triggerCharacter, previousToken, position)) {
|
|
@@ -147354,7 +147411,7 @@ ${lanes.join("\n")}
|
|
|
147354
147411
|
} else {
|
|
147355
147412
|
incompleteCompletionsCache == null ? void 0 : incompleteCompletionsCache.clear();
|
|
147356
147413
|
}
|
|
147357
|
-
const stringCompletions = ts_Completions_StringCompletions_exports.getStringLiteralCompletions(sourceFile, position, previousToken, compilerOptions, host, program, log, preferences);
|
|
147414
|
+
const stringCompletions = ts_Completions_StringCompletions_exports.getStringLiteralCompletions(sourceFile, position, previousToken, compilerOptions, host, program, log, preferences, includeSymbol);
|
|
147358
147415
|
if (stringCompletions) {
|
|
147359
147416
|
return stringCompletions;
|
|
147360
147417
|
}
|
|
@@ -147379,7 +147436,7 @@ ${lanes.join("\n")}
|
|
|
147379
147436
|
}
|
|
147380
147437
|
switch (completionData.kind) {
|
|
147381
147438
|
case 0 /* Data */:
|
|
147382
|
-
const response = completionInfoFromData(sourceFile, host, program, compilerOptions, log, completionData, preferences, formatContext, position);
|
|
147439
|
+
const response = completionInfoFromData(sourceFile, host, program, compilerOptions, log, completionData, preferences, formatContext, position, includeSymbol);
|
|
147383
147440
|
if (response == null ? void 0 : response.isIncomplete) {
|
|
147384
147441
|
incompleteCompletionsCache == null ? void 0 : incompleteCompletionsCache.set(response);
|
|
147385
147442
|
}
|
|
@@ -147509,7 +147566,7 @@ ${lanes.join("\n")}
|
|
|
147509
147566
|
function getOptionalReplacementSpan(location) {
|
|
147510
147567
|
return (location == null ? void 0 : location.kind) === 79 /* Identifier */ ? createTextSpanFromNode(location) : void 0;
|
|
147511
147568
|
}
|
|
147512
|
-
function completionInfoFromData(sourceFile, host, program, compilerOptions, log, completionData, preferences, formatContext, position) {
|
|
147569
|
+
function completionInfoFromData(sourceFile, host, program, compilerOptions, log, completionData, preferences, formatContext, position, includeSymbol) {
|
|
147513
147570
|
const {
|
|
147514
147571
|
symbols,
|
|
147515
147572
|
contextToken,
|
|
@@ -147583,7 +147640,8 @@ ${lanes.join("\n")}
|
|
|
147583
147640
|
symbolToOriginInfoMap,
|
|
147584
147641
|
symbolToSortTextMap,
|
|
147585
147642
|
isJsxIdentifierExpected,
|
|
147586
|
-
isRightOfOpenTag
|
|
147643
|
+
isRightOfOpenTag,
|
|
147644
|
+
includeSymbol
|
|
147587
147645
|
);
|
|
147588
147646
|
if (keywordFilters !== 0 /* None */) {
|
|
147589
147647
|
for (const keywordEntry of getKeywordCompletions(keywordFilters, !insideJsDocTagTypeExpression && isSourceFileJS(sourceFile))) {
|
|
@@ -147832,7 +147890,7 @@ ${lanes.join("\n")}
|
|
|
147832
147890
|
function createCompletionEntryForLiteral(sourceFile, preferences, literal) {
|
|
147833
147891
|
return { name: completionNameForLiteral(sourceFile, preferences, literal), kind: "string" /* string */, kindModifiers: "" /* none */, sortText: SortText.LocationPriority };
|
|
147834
147892
|
}
|
|
147835
|
-
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) {
|
|
147893
|
+
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) {
|
|
147836
147894
|
let insertText;
|
|
147837
147895
|
let replacementSpan = getReplacementSpanForContextToken(replacementToken);
|
|
147838
147896
|
let data;
|
|
@@ -147876,7 +147934,9 @@ ${lanes.join("\n")}
|
|
|
147876
147934
|
}
|
|
147877
147935
|
awaitText += `(await ${propertyAccessToConvert.expression.getText()})`;
|
|
147878
147936
|
insertText = needsConvertPropertyAccess ? `${awaitText}${insertText}` : `${awaitText}${insertQuestionDot ? "?." : "."}${insertText}`;
|
|
147879
|
-
|
|
147937
|
+
const isInAwaitExpression = tryCast(propertyAccessToConvert.parent, isAwaitExpression);
|
|
147938
|
+
const wrapNode = isInAwaitExpression ? propertyAccessToConvert.parent : propertyAccessToConvert.expression;
|
|
147939
|
+
replacementSpan = createTextSpanFromBounds(wrapNode.getStart(sourceFile), propertyAccessToConvert.end);
|
|
147880
147940
|
}
|
|
147881
147941
|
if (originIsResolvedExport(origin)) {
|
|
147882
147942
|
sourceDisplay = [textPart(origin.moduleSpecifier)];
|
|
@@ -147944,7 +148004,8 @@ ${lanes.join("\n")}
|
|
|
147944
148004
|
isSnippet,
|
|
147945
148005
|
isPackageJsonImport: originIsPackageJsonImport(origin) || void 0,
|
|
147946
148006
|
isImportStatementCompletion: !!importStatementCompletion || void 0,
|
|
147947
|
-
data
|
|
148007
|
+
data,
|
|
148008
|
+
...includeSymbol ? { symbol } : void 0
|
|
147948
148009
|
};
|
|
147949
148010
|
}
|
|
147950
148011
|
function isClassLikeMemberCompletion(symbol, location, sourceFile) {
|
|
@@ -148414,7 +148475,7 @@ ${lanes.join("\n")}
|
|
|
148414
148475
|
return "TypeOnlyAlias/" /* TypeOnlyAlias */;
|
|
148415
148476
|
}
|
|
148416
148477
|
}
|
|
148417
|
-
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) {
|
|
148478
|
+
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) {
|
|
148418
148479
|
var _a2;
|
|
148419
148480
|
const start = timestamp();
|
|
148420
148481
|
const variableDeclaration = getVariableDeclaration(location);
|
|
@@ -148454,7 +148515,8 @@ ${lanes.join("\n")}
|
|
|
148454
148515
|
kind,
|
|
148455
148516
|
formatContext,
|
|
148456
148517
|
isJsxIdentifierExpected,
|
|
148457
|
-
isRightOfOpenTag
|
|
148518
|
+
isRightOfOpenTag,
|
|
148519
|
+
includeSymbol
|
|
148458
148520
|
);
|
|
148459
148521
|
if (!entry) {
|
|
148460
148522
|
continue;
|
|
@@ -150695,7 +150757,7 @@ ${lanes.join("\n")}
|
|
|
150695
150757
|
values: map2.values.bind(map2)
|
|
150696
150758
|
};
|
|
150697
150759
|
}
|
|
150698
|
-
function getStringLiteralCompletions(sourceFile, position, contextToken, options, host, program, log, preferences) {
|
|
150760
|
+
function getStringLiteralCompletions(sourceFile, position, contextToken, options, host, program, log, preferences, includeSymbol) {
|
|
150699
150761
|
if (isInReferenceComment(sourceFile, position)) {
|
|
150700
150762
|
const entries = getTripleSlashReferenceCompletion(sourceFile, position, options, host);
|
|
150701
150763
|
return entries && convertPathCompletions(entries);
|
|
@@ -150704,10 +150766,10 @@ ${lanes.join("\n")}
|
|
|
150704
150766
|
if (!contextToken || !isStringLiteralLike(contextToken))
|
|
150705
150767
|
return void 0;
|
|
150706
150768
|
const entries = getStringLiteralCompletionEntries(sourceFile, contextToken, position, program.getTypeChecker(), options, host, preferences);
|
|
150707
|
-
return convertStringLiteralCompletions(entries, contextToken, sourceFile, host, program, log, options, preferences, position);
|
|
150769
|
+
return convertStringLiteralCompletions(entries, contextToken, sourceFile, host, program, log, options, preferences, position, includeSymbol);
|
|
150708
150770
|
}
|
|
150709
150771
|
}
|
|
150710
|
-
function convertStringLiteralCompletions(completion, contextToken, sourceFile, host, program, log, options, preferences, position) {
|
|
150772
|
+
function convertStringLiteralCompletions(completion, contextToken, sourceFile, host, program, log, options, preferences, position, includeSymbol) {
|
|
150711
150773
|
if (completion === void 0) {
|
|
150712
150774
|
return void 0;
|
|
150713
150775
|
}
|
|
@@ -150733,7 +150795,28 @@ ${lanes.join("\n")}
|
|
|
150733
150795
|
preferences,
|
|
150734
150796
|
options,
|
|
150735
150797
|
/*formatContext*/
|
|
150736
|
-
void 0
|
|
150798
|
+
void 0,
|
|
150799
|
+
/*isTypeOnlyLocation */
|
|
150800
|
+
void 0,
|
|
150801
|
+
/*propertyAccessToConvert*/
|
|
150802
|
+
void 0,
|
|
150803
|
+
/*jsxIdentifierExpected*/
|
|
150804
|
+
void 0,
|
|
150805
|
+
/*isJsxInitializer*/
|
|
150806
|
+
void 0,
|
|
150807
|
+
/*importStatementCompletion*/
|
|
150808
|
+
void 0,
|
|
150809
|
+
/*recommendedCompletion*/
|
|
150810
|
+
void 0,
|
|
150811
|
+
/*symbolToOriginInfoMap*/
|
|
150812
|
+
void 0,
|
|
150813
|
+
/*symbolToSortTextMap*/
|
|
150814
|
+
void 0,
|
|
150815
|
+
/*isJsxIdentifierExpected*/
|
|
150816
|
+
void 0,
|
|
150817
|
+
/*isRightOfOpenTag*/
|
|
150818
|
+
void 0,
|
|
150819
|
+
includeSymbol
|
|
150737
150820
|
);
|
|
150738
150821
|
return { isGlobalCompletion: false, isMemberCompletion: true, isNewIdentifierLocation: completion.hasIndexSignature, optionalReplacementSpan, entries };
|
|
150739
150822
|
}
|
|
@@ -165878,7 +165961,7 @@ ${options.prefix}` : "\n" : options.prefix
|
|
|
165878
165961
|
}
|
|
165879
165962
|
function processChildNode(child, inheritedIndentation, parent2, parentDynamicIndentation, parentStartLine, undecoratedParentStartLine, isListItem, isFirstListItem) {
|
|
165880
165963
|
Debug.assert(!nodeIsSynthesized(child));
|
|
165881
|
-
if (nodeIsMissing(child)) {
|
|
165964
|
+
if (nodeIsMissing(child) || isGrammarError(parent2, child)) {
|
|
165882
165965
|
return inheritedIndentation;
|
|
165883
165966
|
}
|
|
165884
165967
|
const childStartPos = child.getStart(sourceFile);
|
|
@@ -168554,6 +168637,7 @@ ${options.prefix}` : "\n" : options.prefix
|
|
|
168554
168637
|
isGetOrSetAccessorDeclaration: () => isGetOrSetAccessorDeclaration,
|
|
168555
168638
|
isGlobalDeclaration: () => isGlobalDeclaration,
|
|
168556
168639
|
isGlobalScopeAugmentation: () => isGlobalScopeAugmentation,
|
|
168640
|
+
isGrammarError: () => isGrammarError,
|
|
168557
168641
|
isHeritageClause: () => isHeritageClause,
|
|
168558
168642
|
isHoistedFunction: () => isHoistedFunction,
|
|
168559
168643
|
isHoistedVariableStatement: () => isHoistedVariableStatement,
|
package/lib/typingsInstaller.js
CHANGED
|
@@ -54,7 +54,7 @@ var path = __toESM(require("path"));
|
|
|
54
54
|
|
|
55
55
|
// src/compiler/corePublic.ts
|
|
56
56
|
var versionMajorMinor = "5.0";
|
|
57
|
-
var version = `${versionMajorMinor}.0-dev.
|
|
57
|
+
var version = `${versionMajorMinor}.0-dev.20230217`;
|
|
58
58
|
|
|
59
59
|
// src/compiler/core.ts
|
|
60
60
|
var emptyArray = [];
|
|
@@ -19832,7 +19832,6 @@ var Parser;
|
|
|
19832
19832
|
return canFollowExportModifier();
|
|
19833
19833
|
case 88 /* DefaultKeyword */:
|
|
19834
19834
|
return nextTokenCanFollowDefaultKeyword();
|
|
19835
|
-
case 127 /* AccessorKeyword */:
|
|
19836
19835
|
case 124 /* StaticKeyword */:
|
|
19837
19836
|
case 137 /* GetKeyword */:
|
|
19838
19837
|
case 151 /* SetKeyword */:
|
|
@@ -21125,6 +21124,7 @@ var Parser;
|
|
|
21125
21124
|
const hasJSDoc = hasPrecedingJSDocComment();
|
|
21126
21125
|
const modifiers = parseModifiersForConstructorType();
|
|
21127
21126
|
const isConstructorType = parseOptional(103 /* NewKeyword */);
|
|
21127
|
+
Debug.assert(!modifiers || isConstructorType, "Per isStartOfFunctionOrConstructorType, a function type cannot have modifiers.");
|
|
21128
21128
|
const typeParameters = parseTypeParameters();
|
|
21129
21129
|
const parameters = parseParameters(4 /* Type */);
|
|
21130
21130
|
const type = parseReturnType(
|
|
@@ -21133,8 +21133,6 @@ var Parser;
|
|
|
21133
21133
|
false
|
|
21134
21134
|
);
|
|
21135
21135
|
const node = isConstructorType ? factory2.createConstructorTypeNode(modifiers, typeParameters, parameters, type) : factory2.createFunctionTypeNode(typeParameters, parameters, type);
|
|
21136
|
-
if (!isConstructorType)
|
|
21137
|
-
node.modifiers = modifiers;
|
|
21138
21136
|
return withJSDoc(finishNode(node, pos), hasJSDoc);
|
|
21139
21137
|
}
|
|
21140
21138
|
function parseKeywordAndNoDot() {
|
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "typescript",
|
|
3
3
|
"author": "Microsoft Corp.",
|
|
4
4
|
"homepage": "https://www.typescriptlang.org/",
|
|
5
|
-
"version": "5.0.0-dev.
|
|
5
|
+
"version": "5.0.0-dev.20230217",
|
|
6
6
|
"license": "Apache-2.0",
|
|
7
7
|
"description": "TypeScript is a language for application scale JavaScript development",
|
|
8
8
|
"keywords": [
|