@typescript-deploys/pr-build 5.2.0-pr-53356-21 → 5.2.0-pr-48838-5
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 +50 -41
- package/lib/tsserver.js +86 -77
- package/lib/tsserverlibrary.d.ts +1 -1
- package/lib/tsserverlibrary.js +82 -73
- package/lib/typescript.d.ts +1 -1
- package/lib/typescript.js +53 -44
- package/lib/typingsInstaller.js +6 -5
- package/package.json +2 -2
package/lib/tsserver.js
CHANGED
|
@@ -2305,7 +2305,7 @@ module.exports = __toCommonJS(server_exports);
|
|
|
2305
2305
|
|
|
2306
2306
|
// src/compiler/corePublic.ts
|
|
2307
2307
|
var versionMajorMinor = "5.2";
|
|
2308
|
-
var version = `${versionMajorMinor}.0-insiders.
|
|
2308
|
+
var version = `${versionMajorMinor}.0-insiders.20230617`;
|
|
2309
2309
|
var Comparison = /* @__PURE__ */ ((Comparison3) => {
|
|
2310
2310
|
Comparison3[Comparison3["LessThan"] = -1] = "LessThan";
|
|
2311
2311
|
Comparison3[Comparison3["EqualTo"] = 0] = "EqualTo";
|
|
@@ -4998,7 +4998,7 @@ var prereleasePartRegExp = /^(?:0|[1-9]\d*|[a-z-][a-z0-9-]*)$/i;
|
|
|
4998
4998
|
var buildRegExp = /^[a-z0-9-]+(?:\.[a-z0-9-]+)*$/i;
|
|
4999
4999
|
var buildPartRegExp = /^[a-z0-9-]+$/i;
|
|
5000
5000
|
var numericIdentifierRegExp = /^(0|[1-9]\d*)$/;
|
|
5001
|
-
var _Version = class {
|
|
5001
|
+
var _Version = class _Version {
|
|
5002
5002
|
constructor(major, minor = 0, patch = 0, prerelease = "", build2 = "") {
|
|
5003
5003
|
if (typeof major === "string") {
|
|
5004
5004
|
const result = Debug.checkDefined(tryParseComponents(major), "Invalid version");
|
|
@@ -5062,8 +5062,8 @@ var _Version = class {
|
|
|
5062
5062
|
return result;
|
|
5063
5063
|
}
|
|
5064
5064
|
};
|
|
5065
|
+
_Version.zero = new _Version(0, 0, 0, ["0"]);
|
|
5065
5066
|
var Version = _Version;
|
|
5066
|
-
Version.zero = new _Version(0, 0, 0, ["0"]);
|
|
5067
5067
|
function tryParseComponents(text) {
|
|
5068
5068
|
const match = versionRegExp.exec(text);
|
|
5069
5069
|
if (!match)
|
|
@@ -5110,14 +5110,14 @@ function comparePrereleaseIdentifiers(left, right) {
|
|
|
5110
5110
|
}
|
|
5111
5111
|
return compareValues(left.length, right.length);
|
|
5112
5112
|
}
|
|
5113
|
-
var VersionRange = class {
|
|
5113
|
+
var VersionRange = class _VersionRange {
|
|
5114
5114
|
constructor(spec) {
|
|
5115
5115
|
this._alternatives = spec ? Debug.checkDefined(parseRange(spec), "Invalid range spec.") : emptyArray;
|
|
5116
5116
|
}
|
|
5117
5117
|
static tryParse(text) {
|
|
5118
5118
|
const sets = parseRange(text);
|
|
5119
5119
|
if (sets) {
|
|
5120
|
-
const range = new
|
|
5120
|
+
const range = new _VersionRange("");
|
|
5121
5121
|
range._alternatives = sets;
|
|
5122
5122
|
return range;
|
|
5123
5123
|
}
|
|
@@ -10306,6 +10306,7 @@ var Diagnostics = {
|
|
|
10306
10306
|
Cannot_find_a_tsconfig_json_file_at_the_current_directory_Colon_0: diag(5081, 1 /* Error */, "Cannot_find_a_tsconfig_json_file_at_the_current_directory_Colon_0_5081", "Cannot find a tsconfig.json file at the current directory: {0}."),
|
|
10307
10307
|
_0_could_be_instantiated_with_an_arbitrary_type_which_could_be_unrelated_to_1: diag(5082, 1 /* Error */, "_0_could_be_instantiated_with_an_arbitrary_type_which_could_be_unrelated_to_1_5082", "'{0}' could be instantiated with an arbitrary type which could be unrelated to '{1}'."),
|
|
10308
10308
|
Cannot_read_file_0: diag(5083, 1 /* Error */, "Cannot_read_file_0_5083", "Cannot read file '{0}'."),
|
|
10309
|
+
Tuple_members_must_all_have_names_or_all_not_have_names: diag(5084, 1 /* Error */, "Tuple_members_must_all_have_names_or_all_not_have_names_5084", "Tuple members must all have names or all not have names."),
|
|
10309
10310
|
A_tuple_member_cannot_be_both_optional_and_rest: diag(5085, 1 /* Error */, "A_tuple_member_cannot_be_both_optional_and_rest_5085", "A tuple member cannot be both optional and rest."),
|
|
10310
10311
|
A_labeled_tuple_element_is_declared_as_optional_with_a_question_mark_after_the_name_and_before_the_colon_rather_than_after_the_type: diag(5086, 1 /* Error */, "A_labeled_tuple_element_is_declared_as_optional_with_a_question_mark_after_the_name_and_before_the_c_5086", "A labeled tuple element is declared as optional with a question mark after the name and before the colon, rather than after the type."),
|
|
10311
10312
|
A_labeled_tuple_element_is_declared_as_rest_with_a_before_the_name_rather_than_before_the_type: diag(5087, 1 /* Error */, "A_labeled_tuple_element_is_declared_as_rest_with_a_before_the_name_rather_than_before_the_type_5087", "A labeled tuple element is declared as rest with a '...' before the name, rather than before the type."),
|
|
@@ -52347,18 +52348,19 @@ function createTypeChecker(host) {
|
|
|
52347
52348
|
const arity = getTypeReferenceArity(type2);
|
|
52348
52349
|
const tupleConstituentNodes = mapToTypeNodes(typeArguments.slice(0, arity), context);
|
|
52349
52350
|
if (tupleConstituentNodes) {
|
|
52350
|
-
|
|
52351
|
-
|
|
52352
|
-
|
|
52353
|
-
const labeledElementDeclaration = labeledElementDeclarations == null ? void 0 : labeledElementDeclarations[i];
|
|
52354
|
-
if (labeledElementDeclaration) {
|
|
52351
|
+
if (type2.target.labeledElementDeclarations) {
|
|
52352
|
+
for (let i = 0; i < tupleConstituentNodes.length; i++) {
|
|
52353
|
+
const flags = type2.target.elementFlags[i];
|
|
52355
52354
|
tupleConstituentNodes[i] = factory.createNamedTupleMember(
|
|
52356
52355
|
flags & 12 /* Variable */ ? factory.createToken(26 /* DotDotDotToken */) : void 0,
|
|
52357
|
-
factory.createIdentifier(unescapeLeadingUnderscores(getTupleElementLabel(
|
|
52356
|
+
factory.createIdentifier(unescapeLeadingUnderscores(getTupleElementLabel(type2.target.labeledElementDeclarations[i]))),
|
|
52358
52357
|
flags & 2 /* Optional */ ? factory.createToken(58 /* QuestionToken */) : void 0,
|
|
52359
52358
|
flags & 4 /* Rest */ ? factory.createArrayTypeNode(tupleConstituentNodes[i]) : tupleConstituentNodes[i]
|
|
52360
52359
|
);
|
|
52361
|
-
}
|
|
52360
|
+
}
|
|
52361
|
+
} else {
|
|
52362
|
+
for (let i = 0; i < Math.min(arity, tupleConstituentNodes.length); i++) {
|
|
52363
|
+
const flags = type2.target.elementFlags[i];
|
|
52362
52364
|
tupleConstituentNodes[i] = flags & 12 /* Variable */ ? factory.createRestTypeNode(flags & 4 /* Rest */ ? factory.createArrayTypeNode(tupleConstituentNodes[i]) : tupleConstituentNodes[i]) : flags & 2 /* Optional */ ? factory.createOptionalTypeNode(tupleConstituentNodes[i]) : tupleConstituentNodes[i];
|
|
52363
52365
|
}
|
|
52364
52366
|
}
|
|
@@ -57465,18 +57467,17 @@ function createTypeChecker(host) {
|
|
|
57465
57467
|
function getExpandedParameters(sig, skipUnionExpanding) {
|
|
57466
57468
|
if (signatureHasRestParameter(sig)) {
|
|
57467
57469
|
const restIndex = sig.parameters.length - 1;
|
|
57468
|
-
const restName = sig.parameters[restIndex].escapedName;
|
|
57469
57470
|
const restType = getTypeOfSymbol(sig.parameters[restIndex]);
|
|
57470
57471
|
if (isTupleType(restType)) {
|
|
57471
|
-
return [expandSignatureParametersWithTupleMembers(restType, restIndex
|
|
57472
|
+
return [expandSignatureParametersWithTupleMembers(restType, restIndex)];
|
|
57472
57473
|
} else if (!skipUnionExpanding && restType.flags & 1048576 /* Union */ && every(restType.types, isTupleType)) {
|
|
57473
|
-
return map(restType.types, (t) => expandSignatureParametersWithTupleMembers(t, restIndex
|
|
57474
|
+
return map(restType.types, (t) => expandSignatureParametersWithTupleMembers(t, restIndex));
|
|
57474
57475
|
}
|
|
57475
57476
|
}
|
|
57476
57477
|
return [sig.parameters];
|
|
57477
|
-
function expandSignatureParametersWithTupleMembers(restType, restIndex
|
|
57478
|
-
const elementTypes =
|
|
57479
|
-
const associatedNames = getUniqAssociatedNamesFromTupleType(restType
|
|
57478
|
+
function expandSignatureParametersWithTupleMembers(restType, restIndex) {
|
|
57479
|
+
const elementTypes = getElementTypes(restType);
|
|
57480
|
+
const associatedNames = getUniqAssociatedNamesFromTupleType(restType);
|
|
57480
57481
|
const restParams = map(elementTypes, (t, i) => {
|
|
57481
57482
|
const name = associatedNames && associatedNames[i] ? associatedNames[i] : getParameterNameAtPosition(sig, restIndex + i, restType);
|
|
57482
57483
|
const flags = restType.target.elementFlags[i];
|
|
@@ -57487,10 +57488,10 @@ function createTypeChecker(host) {
|
|
|
57487
57488
|
});
|
|
57488
57489
|
return concatenate(sig.parameters.slice(0, restIndex), restParams);
|
|
57489
57490
|
}
|
|
57490
|
-
function getUniqAssociatedNamesFromTupleType(type
|
|
57491
|
+
function getUniqAssociatedNamesFromTupleType(type) {
|
|
57491
57492
|
const associatedNamesMap = /* @__PURE__ */ new Map();
|
|
57492
|
-
return map(type.target.labeledElementDeclarations, (labeledElement
|
|
57493
|
-
const name = getTupleElementLabel(labeledElement
|
|
57493
|
+
return map(type.target.labeledElementDeclarations, (labeledElement) => {
|
|
57494
|
+
const name = getTupleElementLabel(labeledElement);
|
|
57494
57495
|
const prevCounter = associatedNamesMap.get(name);
|
|
57495
57496
|
if (prevCounter === void 0) {
|
|
57496
57497
|
associatedNamesMap.set(name, 1);
|
|
@@ -58289,9 +58290,9 @@ function createTypeChecker(host) {
|
|
|
58289
58290
|
function getConstraintOfTypeParameter(typeParameter) {
|
|
58290
58291
|
return hasNonCircularBaseConstraint(typeParameter) ? getConstraintFromTypeParameter(typeParameter) : void 0;
|
|
58291
58292
|
}
|
|
58292
|
-
function isConstTypeVariable(type) {
|
|
58293
|
+
function isConstTypeVariable(type, depth = 0) {
|
|
58293
58294
|
var _a;
|
|
58294
|
-
return !!(type && (type.flags & 262144 /* TypeParameter */ && some((_a = type.symbol) == null ? void 0 : _a.declarations, (d) => hasSyntacticModifier(d, 2048 /* Const */)) || type.flags & 1048576 /* Union */ && some(type.types, isConstTypeVariable) || type.flags & 8388608 /* IndexedAccess */ && isConstTypeVariable(type.objectType) || type.flags & 16777216 /* Conditional */ && isConstTypeVariable(getConstraintOfConditionalType(type)) || type.flags & 33554432 /* Substitution */ && isConstTypeVariable(type.baseType) || isGenericTupleType(type) && findIndex(getElementTypes(type), (t, i) => !!(type.target.elementFlags[i] & 8 /* Variadic */) && isConstTypeVariable(t)) >= 0));
|
|
58295
|
+
return depth < 5 && !!(type && (type.flags & 262144 /* TypeParameter */ && some((_a = type.symbol) == null ? void 0 : _a.declarations, (d) => hasSyntacticModifier(d, 2048 /* Const */)) || type.flags & 1048576 /* Union */ && some(type.types, (t) => isConstTypeVariable(t, depth)) || type.flags & 8388608 /* IndexedAccess */ && isConstTypeVariable(type.objectType, depth + 1) || type.flags & 16777216 /* Conditional */ && isConstTypeVariable(getConstraintOfConditionalType(type), depth + 1) || type.flags & 33554432 /* Substitution */ && isConstTypeVariable(type.baseType, depth) || isGenericTupleType(type) && findIndex(getElementTypes(type), (t, i) => !!(type.target.elementFlags[i] & 8 /* Variadic */) && isConstTypeVariable(t, depth)) >= 0));
|
|
58295
58296
|
}
|
|
58296
58297
|
function getConstraintOfIndexedAccess(type) {
|
|
58297
58298
|
return hasNonCircularBaseConstraint(type) ? getConstraintFromIndexedAccess(type) : void 0;
|
|
@@ -60408,10 +60409,13 @@ function createTypeChecker(host) {
|
|
|
60408
60409
|
return readonly ? globalReadonlyArrayType : globalArrayType;
|
|
60409
60410
|
}
|
|
60410
60411
|
const elementFlags = map(node.elements, getTupleElementFlags);
|
|
60411
|
-
|
|
60412
|
-
|
|
60413
|
-
|
|
60414
|
-
|
|
60412
|
+
const missingName = some(node.elements, (e) => e.kind !== 201 /* NamedTupleMember */);
|
|
60413
|
+
return getTupleTargetType(
|
|
60414
|
+
elementFlags,
|
|
60415
|
+
readonly,
|
|
60416
|
+
/*associatedNames*/
|
|
60417
|
+
missingName ? void 0 : node.elements
|
|
60418
|
+
);
|
|
60415
60419
|
}
|
|
60416
60420
|
function isDeferredTypeReferenceNode(node, hasDefaultTypeArguments) {
|
|
60417
60421
|
return !!getAliasSymbolForTypeNode(node) || isResolvedByTypeAlias(node) && (node.kind === 187 /* ArrayType */ ? mayResolveTypeAlias(node.elementType) : node.kind === 188 /* TupleType */ ? some(node.elements, mayResolveTypeAlias) : hasDefaultTypeArguments || some(node.typeArguments, mayResolveTypeAlias));
|
|
@@ -60486,7 +60490,7 @@ function createTypeChecker(host) {
|
|
|
60486
60490
|
function isReadonlyTypeOperator(node) {
|
|
60487
60491
|
return isTypeOperatorNode(node) && node.operator === 148 /* ReadonlyKeyword */;
|
|
60488
60492
|
}
|
|
60489
|
-
function createTupleType(elementTypes, elementFlags, readonly = false, namedMemberDeclarations
|
|
60493
|
+
function createTupleType(elementTypes, elementFlags, readonly = false, namedMemberDeclarations) {
|
|
60490
60494
|
const tupleTarget = getTupleTargetType(elementFlags || map(elementTypes, (_) => 1 /* Required */), readonly, namedMemberDeclarations);
|
|
60491
60495
|
return tupleTarget === emptyGenericType ? emptyObjectType : elementTypes.length ? createNormalizedTypeReference(tupleTarget, elementTypes) : tupleTarget;
|
|
60492
60496
|
}
|
|
@@ -60494,8 +60498,7 @@ function createTypeChecker(host) {
|
|
|
60494
60498
|
if (elementFlags.length === 1 && elementFlags[0] & 4 /* Rest */) {
|
|
60495
60499
|
return readonly ? globalReadonlyArrayType : globalArrayType;
|
|
60496
60500
|
}
|
|
60497
|
-
const
|
|
60498
|
-
const key = map(elementFlags, (f) => f & 1 /* Required */ ? "#" : f & 2 /* Optional */ ? "?" : f & 4 /* Rest */ ? "." : "*").join() + (readonly ? "R" : "") + (memberIds.length ? "," + memberIds.join(",") : "");
|
|
60501
|
+
const key = map(elementFlags, (f) => f & 1 /* Required */ ? "#" : f & 2 /* Optional */ ? "?" : f & 4 /* Rest */ ? "." : "*").join() + (readonly ? "R" : "") + (namedMemberDeclarations && namedMemberDeclarations.length ? "," + map(namedMemberDeclarations, getNodeId).join(",") : "");
|
|
60499
60502
|
let type = tupleTypes.get(key);
|
|
60500
60503
|
if (!type) {
|
|
60501
60504
|
tupleTypes.set(key, type = createTupleTargetType(elementFlags, readonly, namedMemberDeclarations));
|
|
@@ -60577,7 +60580,7 @@ function createTypeChecker(host) {
|
|
|
60577
60580
|
}
|
|
60578
60581
|
const expandedTypes = [];
|
|
60579
60582
|
const expandedFlags = [];
|
|
60580
|
-
|
|
60583
|
+
let expandedDeclarations = [];
|
|
60581
60584
|
let lastRequiredIndex = -1;
|
|
60582
60585
|
let firstRestIndex = -1;
|
|
60583
60586
|
let lastOptionalOrRestIndex = -1;
|
|
@@ -60615,7 +60618,7 @@ function createTypeChecker(host) {
|
|
|
60615
60618
|
));
|
|
60616
60619
|
expandedTypes.splice(firstRestIndex + 1, lastOptionalOrRestIndex - firstRestIndex);
|
|
60617
60620
|
expandedFlags.splice(firstRestIndex + 1, lastOptionalOrRestIndex - firstRestIndex);
|
|
60618
|
-
expandedDeclarations.splice(firstRestIndex + 1, lastOptionalOrRestIndex - firstRestIndex);
|
|
60621
|
+
expandedDeclarations == null ? void 0 : expandedDeclarations.splice(firstRestIndex + 1, lastOptionalOrRestIndex - firstRestIndex);
|
|
60619
60622
|
}
|
|
60620
60623
|
const tupleTarget = getTupleTargetType(expandedFlags, target.readonly, expandedDeclarations);
|
|
60621
60624
|
return tupleTarget === emptyGenericType ? emptyObjectType : expandedFlags.length ? createTypeReference(tupleTarget, expandedTypes) : tupleTarget;
|
|
@@ -60635,7 +60638,11 @@ function createTypeChecker(host) {
|
|
|
60635
60638
|
true
|
|
60636
60639
|
) : type);
|
|
60637
60640
|
expandedFlags.push(flags);
|
|
60638
|
-
expandedDeclarations
|
|
60641
|
+
if (expandedDeclarations && declaration) {
|
|
60642
|
+
expandedDeclarations.push(declaration);
|
|
60643
|
+
} else {
|
|
60644
|
+
expandedDeclarations = void 0;
|
|
60645
|
+
}
|
|
60639
60646
|
}
|
|
60640
60647
|
}
|
|
60641
60648
|
function sliceTupleType(type, index, endSkipCount = 0) {
|
|
@@ -71836,7 +71843,7 @@ function createTypeChecker(host) {
|
|
|
71836
71843
|
function instantiateContextualType(contextualType, node, contextFlags) {
|
|
71837
71844
|
if (contextualType && maybeTypeOfKind(contextualType, 465829888 /* Instantiable */)) {
|
|
71838
71845
|
const inferenceContext = getInferenceContext(node);
|
|
71839
|
-
if (inferenceContext && contextFlags & 1 /* Signature */ && some(inferenceContext.inferences, hasInferenceCandidatesOrDefault)) {
|
|
71846
|
+
if (inferenceContext && (contextFlags & 1 /* Signature */ || maybeTypeOfKind(contextualType, 25165824 /* Simplifiable */)) && some(inferenceContext.inferences, hasInferenceCandidatesOrDefault)) {
|
|
71840
71847
|
return instantiateInstantiableTypes(contextualType, inferenceContext.nonFixingMapper);
|
|
71841
71848
|
}
|
|
71842
71849
|
if (inferenceContext == null ? void 0 : inferenceContext.returnMapper) {
|
|
@@ -76367,10 +76374,7 @@ function createTypeChecker(host) {
|
|
|
76367
76374
|
}
|
|
76368
76375
|
return type;
|
|
76369
76376
|
}
|
|
76370
|
-
function getTupleElementLabel(d
|
|
76371
|
-
if (!d) {
|
|
76372
|
-
return `${restParameterName}_${index}`;
|
|
76373
|
-
}
|
|
76377
|
+
function getTupleElementLabel(d) {
|
|
76374
76378
|
Debug.assert(isIdentifier(d.name));
|
|
76375
76379
|
return d.name.escapedText;
|
|
76376
76380
|
}
|
|
@@ -76384,7 +76388,7 @@ function createTypeChecker(host) {
|
|
|
76384
76388
|
if (isTupleType(restType)) {
|
|
76385
76389
|
const associatedNames = restType.target.labeledElementDeclarations;
|
|
76386
76390
|
const index = pos - paramCount;
|
|
76387
|
-
return
|
|
76391
|
+
return associatedNames && getTupleElementLabel(associatedNames[index]) || restParameter.escapedName + "_" + index;
|
|
76388
76392
|
}
|
|
76389
76393
|
return restParameter.escapedName;
|
|
76390
76394
|
}
|
|
@@ -79739,7 +79743,12 @@ function createTypeChecker(host) {
|
|
|
79739
79743
|
const elementTypes = node.elements;
|
|
79740
79744
|
let seenOptionalElement = false;
|
|
79741
79745
|
let seenRestElement = false;
|
|
79746
|
+
const hasNamedElement = some(elementTypes, isNamedTupleMember);
|
|
79742
79747
|
for (const e of elementTypes) {
|
|
79748
|
+
if (e.kind !== 201 /* NamedTupleMember */ && hasNamedElement) {
|
|
79749
|
+
grammarErrorOnNode(e, Diagnostics.Tuple_members_must_all_have_names_or_all_not_have_names);
|
|
79750
|
+
break;
|
|
79751
|
+
}
|
|
79743
79752
|
const flags = getTupleElementFlags(e);
|
|
79744
79753
|
if (flags & 8 /* Variadic */) {
|
|
79745
79754
|
const type = getTypeFromTypeNode(e.type);
|
|
@@ -87990,13 +87999,13 @@ function createBasicNodeBuilderModuleSpecifierResolutionHost(host) {
|
|
|
87990
87999
|
readFile: host.readFile ? (fileName) => host.readFile(fileName) : void 0
|
|
87991
88000
|
};
|
|
87992
88001
|
}
|
|
87993
|
-
var SymbolTrackerImpl = class {
|
|
88002
|
+
var SymbolTrackerImpl = class _SymbolTrackerImpl {
|
|
87994
88003
|
constructor(context, tracker, moduleResolverHost) {
|
|
87995
88004
|
this.moduleResolverHost = void 0;
|
|
87996
88005
|
this.inner = void 0;
|
|
87997
88006
|
this.disableTrackSymbol = false;
|
|
87998
88007
|
var _a;
|
|
87999
|
-
while (tracker instanceof
|
|
88008
|
+
while (tracker instanceof _SymbolTrackerImpl) {
|
|
88000
88009
|
tracker = tracker.inner;
|
|
88001
88010
|
}
|
|
88002
88011
|
this.inner = tracker;
|
|
@@ -166234,7 +166243,7 @@ function isSeparator(node, candidate) {
|
|
|
166234
166243
|
function isThisTypeAnnotatable(containingFunction) {
|
|
166235
166244
|
return isFunctionExpression(containingFunction) || isFunctionDeclaration(containingFunction);
|
|
166236
166245
|
}
|
|
166237
|
-
var ChangeTracker = class {
|
|
166246
|
+
var ChangeTracker = class _ChangeTracker {
|
|
166238
166247
|
/** Public for tests only. Other callers should use `ChangeTracker.with`. */
|
|
166239
166248
|
constructor(newLineCharacter, formatContext) {
|
|
166240
166249
|
this.newLineCharacter = newLineCharacter;
|
|
@@ -166245,10 +166254,10 @@ var ChangeTracker = class {
|
|
|
166245
166254
|
this.deletedNodes = [];
|
|
166246
166255
|
}
|
|
166247
166256
|
static fromContext(context) {
|
|
166248
|
-
return new
|
|
166257
|
+
return new _ChangeTracker(getNewLineOrDefaultFromHost(context.host, context.formatContext.options), context.formatContext);
|
|
166249
166258
|
}
|
|
166250
166259
|
static with(context, cb) {
|
|
166251
|
-
const tracker =
|
|
166260
|
+
const tracker = _ChangeTracker.fromContext(context);
|
|
166252
166261
|
cb(tracker);
|
|
166253
166262
|
return tracker.getChanges();
|
|
166254
166263
|
}
|
|
@@ -173059,7 +173068,7 @@ function createSortedArray2() {
|
|
|
173059
173068
|
}
|
|
173060
173069
|
|
|
173061
173070
|
// src/server/utilities.ts
|
|
173062
|
-
var ThrottledOperations = class {
|
|
173071
|
+
var ThrottledOperations = class _ThrottledOperations {
|
|
173063
173072
|
constructor(host, logger) {
|
|
173064
173073
|
this.host = host;
|
|
173065
173074
|
this.pendingTimeouts = /* @__PURE__ */ new Map();
|
|
@@ -173076,7 +173085,7 @@ var ThrottledOperations = class {
|
|
|
173076
173085
|
if (pendingTimeout) {
|
|
173077
173086
|
this.host.clearTimeout(pendingTimeout);
|
|
173078
173087
|
}
|
|
173079
|
-
this.pendingTimeouts.set(operationId, this.host.setTimeout(
|
|
173088
|
+
this.pendingTimeouts.set(operationId, this.host.setTimeout(_ThrottledOperations.run, delay, operationId, this, cb));
|
|
173080
173089
|
if (this.logger) {
|
|
173081
173090
|
this.logger.info(`Scheduled: ${operationId}${pendingTimeout ? ", Cancelled earlier one" : ""}`);
|
|
173082
173091
|
}
|
|
@@ -173099,7 +173108,7 @@ var ThrottledOperations = class {
|
|
|
173099
173108
|
(_b = perfLogger) == null ? void 0 : _b.logStopScheduledOperation();
|
|
173100
173109
|
}
|
|
173101
173110
|
};
|
|
173102
|
-
var GcTimer = class {
|
|
173111
|
+
var GcTimer = class _GcTimer {
|
|
173103
173112
|
constructor(host, delay, logger) {
|
|
173104
173113
|
this.host = host;
|
|
173105
173114
|
this.delay = delay;
|
|
@@ -173109,7 +173118,7 @@ var GcTimer = class {
|
|
|
173109
173118
|
if (!this.host.gc || this.timerId !== void 0) {
|
|
173110
173119
|
return;
|
|
173111
173120
|
}
|
|
173112
|
-
this.timerId = this.host.setTimeout(
|
|
173121
|
+
this.timerId = this.host.setTimeout(_GcTimer.run, this.delay, this);
|
|
173113
173122
|
}
|
|
173114
173123
|
static run(self) {
|
|
173115
173124
|
var _a, _b;
|
|
@@ -174060,7 +174069,7 @@ function hasNoTypeScriptSource(fileNames) {
|
|
|
174060
174069
|
function isGeneratedFileWatcher(watch) {
|
|
174061
174070
|
return watch.generatedFilePath !== void 0;
|
|
174062
174071
|
}
|
|
174063
|
-
var Project3 = class {
|
|
174072
|
+
var Project3 = class _Project {
|
|
174064
174073
|
/** @internal */
|
|
174065
174074
|
constructor(projectName, projectKind, projectService, documentRegistry, hasExplicitListOfFiles, lastFileExceededProgramSize, compilerOptions, compileOnSaveEnabled, watchOptions, directoryStructureHost, currentDirectory) {
|
|
174066
174075
|
this.projectKind = projectKind;
|
|
@@ -174177,7 +174186,7 @@ var Project3 = class {
|
|
|
174177
174186
|
return hasOneOrMoreJsAndNoTsFiles(this);
|
|
174178
174187
|
}
|
|
174179
174188
|
static resolveModule(moduleName, initialDir, host, log) {
|
|
174180
|
-
return
|
|
174189
|
+
return _Project.importServicePluginSync({ name: moduleName }, [initialDir], host, log).resolvedModule;
|
|
174181
174190
|
}
|
|
174182
174191
|
/** @internal */
|
|
174183
174192
|
static importServicePluginSync(pluginConfigEntry, searchPaths, host, log) {
|
|
@@ -175782,7 +175791,7 @@ var AuxiliaryProject = class extends Project3 {
|
|
|
175782
175791
|
return;
|
|
175783
175792
|
}
|
|
175784
175793
|
};
|
|
175785
|
-
var _AutoImportProviderProject = class extends Project3 {
|
|
175794
|
+
var _AutoImportProviderProject = class _AutoImportProviderProject extends Project3 {
|
|
175786
175795
|
/** @internal */
|
|
175787
175796
|
constructor(hostProject, initialRootNames, documentRegistry, compilerOptions) {
|
|
175788
175797
|
super(
|
|
@@ -176006,11 +176015,10 @@ var _AutoImportProviderProject = class extends Project3 {
|
|
|
176006
176015
|
return (_a = this.hostProject.getCurrentProgram()) == null ? void 0 : _a.getModuleResolutionCache();
|
|
176007
176016
|
}
|
|
176008
176017
|
};
|
|
176009
|
-
var AutoImportProviderProject = _AutoImportProviderProject;
|
|
176010
176018
|
/** @internal */
|
|
176011
|
-
|
|
176019
|
+
_AutoImportProviderProject.maxDependencies = 10;
|
|
176012
176020
|
/** @internal */
|
|
176013
|
-
|
|
176021
|
+
_AutoImportProviderProject.compilerOptionsOverrides = {
|
|
176014
176022
|
diagnostics: false,
|
|
176015
176023
|
skipLibCheck: true,
|
|
176016
176024
|
sourceMap: false,
|
|
@@ -176018,6 +176026,7 @@ AutoImportProviderProject.compilerOptionsOverrides = {
|
|
|
176018
176026
|
lib: emptyArray,
|
|
176019
176027
|
noLib: true
|
|
176020
176028
|
};
|
|
176029
|
+
var AutoImportProviderProject = _AutoImportProviderProject;
|
|
176021
176030
|
var ConfiguredProject2 = class extends Project3 {
|
|
176022
176031
|
/** @internal */
|
|
176023
176032
|
constructor(configFileName, canonicalConfigFilePath, projectService, documentRegistry, cachedDirectoryStructureHost) {
|
|
@@ -176579,7 +176588,7 @@ function createProjectNameFactoryWithCounter(nameFactory) {
|
|
|
176579
176588
|
let nextId = 1;
|
|
176580
176589
|
return () => nameFactory(nextId++);
|
|
176581
176590
|
}
|
|
176582
|
-
var _ProjectService = class {
|
|
176591
|
+
var _ProjectService = class _ProjectService {
|
|
176583
176592
|
constructor(opts) {
|
|
176584
176593
|
/**
|
|
176585
176594
|
* Container of all known scripts
|
|
@@ -179562,9 +179571,9 @@ Dynamic files must always be opened with service's current directory or service
|
|
|
179562
179571
|
return this.incompleteCompletionsCache || (this.incompleteCompletionsCache = createIncompleteCompletionsCache());
|
|
179563
179572
|
}
|
|
179564
179573
|
};
|
|
179565
|
-
var ProjectService3 = _ProjectService;
|
|
179566
179574
|
/** Makes a filename safe to insert in a RegExp */
|
|
179567
|
-
|
|
179575
|
+
_ProjectService.filenameEscapeRegexp = /[-\/\\^$*+?.()|[\]{}]/g;
|
|
179576
|
+
var ProjectService3 = _ProjectService;
|
|
179568
179577
|
function createIncompleteCompletionsCache() {
|
|
179569
179578
|
let info;
|
|
179570
179579
|
return {
|
|
@@ -180231,7 +180240,7 @@ var invalidSyntacticModeCommands = [
|
|
|
180231
180240
|
"documentHighlights" /* DocumentHighlights */,
|
|
180232
180241
|
"documentHighlights-full" /* DocumentHighlightsFull */
|
|
180233
180242
|
];
|
|
180234
|
-
var Session3 = class {
|
|
180243
|
+
var Session3 = class _Session {
|
|
180235
180244
|
constructor(opts) {
|
|
180236
180245
|
this.changeSeq = 0;
|
|
180237
180246
|
this.handlers = new Map(Object.entries({
|
|
@@ -181334,7 +181343,7 @@ Project '${project.projectName}' (${ProjectKind[project.projectKind]}) ${counter
|
|
|
181334
181343
|
const { file, project } = this.getFileAndProject(args);
|
|
181335
181344
|
const position = this.getPositionInFile(args, file);
|
|
181336
181345
|
const definitions = this.mapDefinitionInfoLocations(project.getLanguageService().getDefinitionAtPosition(file, position) || emptyArray2, project);
|
|
181337
|
-
return simplifiedResult ? this.mapDefinitionInfo(definitions, project) : definitions.map(
|
|
181346
|
+
return simplifiedResult ? this.mapDefinitionInfo(definitions, project) : definitions.map(_Session.mapToOriginalLocation);
|
|
181338
181347
|
}
|
|
181339
181348
|
mapDefinitionInfoLocations(definitions, project) {
|
|
181340
181349
|
return definitions.map((info) => {
|
|
@@ -181371,7 +181380,7 @@ Project '${project.projectName}' (${ProjectKind[project.projectKind]}) ${counter
|
|
|
181371
181380
|
};
|
|
181372
181381
|
}
|
|
181373
181382
|
return {
|
|
181374
|
-
definitions: definitions.map(
|
|
181383
|
+
definitions: definitions.map(_Session.mapToOriginalLocation),
|
|
181375
181384
|
textSpan
|
|
181376
181385
|
};
|
|
181377
181386
|
}
|
|
@@ -181628,7 +181637,7 @@ Project '${project.projectName}' (${ProjectKind[project.projectKind]}) ${counter
|
|
|
181628
181637
|
const { file, project } = this.getFileAndProject(args);
|
|
181629
181638
|
const position = this.getPositionInFile(args, file);
|
|
181630
181639
|
const implementations = this.mapImplementationLocations(project.getLanguageService().getImplementationAtPosition(file, position) || emptyArray2, project);
|
|
181631
|
-
return simplifiedResult ? implementations.map(({ fileName, textSpan, contextSpan }) => this.toFileSpanWithContext(fileName, textSpan, contextSpan, project)) : implementations.map(
|
|
181640
|
+
return simplifiedResult ? implementations.map(({ fileName, textSpan, contextSpan }) => this.toFileSpanWithContext(fileName, textSpan, contextSpan, project)) : implementations.map(_Session.mapToOriginalLocation);
|
|
181632
181641
|
}
|
|
181633
181642
|
getSyntacticDiagnosticsSync(args) {
|
|
181634
181643
|
const { configFile } = this.getConfigFileAndProject(args);
|
|
@@ -183252,7 +183261,7 @@ var TextChange9 = class {
|
|
|
183252
183261
|
);
|
|
183253
183262
|
}
|
|
183254
183263
|
};
|
|
183255
|
-
var _ScriptVersionCache = class {
|
|
183264
|
+
var _ScriptVersionCache = class _ScriptVersionCache {
|
|
183256
183265
|
constructor() {
|
|
183257
183266
|
this.changes = [];
|
|
183258
183267
|
this.versions = new Array(_ScriptVersionCache.maxVersions);
|
|
@@ -183344,11 +183353,11 @@ var _ScriptVersionCache = class {
|
|
|
183344
183353
|
return svc;
|
|
183345
183354
|
}
|
|
183346
183355
|
};
|
|
183356
|
+
_ScriptVersionCache.changeNumberThreshold = 8;
|
|
183357
|
+
_ScriptVersionCache.changeLengthThreshold = 256;
|
|
183358
|
+
_ScriptVersionCache.maxVersions = 8;
|
|
183347
183359
|
var ScriptVersionCache = _ScriptVersionCache;
|
|
183348
|
-
|
|
183349
|
-
ScriptVersionCache.changeLengthThreshold = 256;
|
|
183350
|
-
ScriptVersionCache.maxVersions = 8;
|
|
183351
|
-
var LineIndexSnapshot = class {
|
|
183360
|
+
var LineIndexSnapshot = class _LineIndexSnapshot {
|
|
183352
183361
|
constructor(version2, cache, index, changesSincePreviousVersion = emptyArray2) {
|
|
183353
183362
|
this.version = version2;
|
|
183354
183363
|
this.cache = cache;
|
|
@@ -183362,7 +183371,7 @@ var LineIndexSnapshot = class {
|
|
|
183362
183371
|
return this.index.getLength();
|
|
183363
183372
|
}
|
|
183364
183373
|
getChangeRange(oldSnapshot) {
|
|
183365
|
-
if (oldSnapshot instanceof
|
|
183374
|
+
if (oldSnapshot instanceof _LineIndexSnapshot && this.cache === oldSnapshot.cache) {
|
|
183366
183375
|
if (this.version <= oldSnapshot.version) {
|
|
183367
183376
|
return unchangedTextChangeRange;
|
|
183368
183377
|
} else {
|
|
@@ -183371,7 +183380,7 @@ var LineIndexSnapshot = class {
|
|
|
183371
183380
|
}
|
|
183372
183381
|
}
|
|
183373
183382
|
};
|
|
183374
|
-
var LineIndex = class {
|
|
183383
|
+
var LineIndex = class _LineIndex {
|
|
183375
183384
|
constructor() {
|
|
183376
183385
|
// set this to true to check each edit for accuracy
|
|
183377
183386
|
this.checkEdits = false;
|
|
@@ -183404,7 +183413,7 @@ var LineIndex = class {
|
|
|
183404
183413
|
for (let i = 0; i < lines.length; i++) {
|
|
183405
183414
|
leaves[i] = new LineLeaf(lines[i]);
|
|
183406
183415
|
}
|
|
183407
|
-
this.root =
|
|
183416
|
+
this.root = _LineIndex.buildTreeFromBottom(leaves);
|
|
183408
183417
|
} else {
|
|
183409
183418
|
this.root = new LineNode();
|
|
183410
183419
|
}
|
|
@@ -183448,7 +183457,7 @@ var LineIndex = class {
|
|
|
183448
183457
|
if (this.root.charCount() === 0) {
|
|
183449
183458
|
Debug.assert(deleteLength === 0);
|
|
183450
183459
|
if (newText !== void 0) {
|
|
183451
|
-
this.load(
|
|
183460
|
+
this.load(_LineIndex.linesFromText(newText).lines);
|
|
183452
183461
|
return this;
|
|
183453
183462
|
}
|
|
183454
183463
|
return void 0;
|
|
@@ -183519,7 +183528,7 @@ var LineIndex = class {
|
|
|
183519
183528
|
return { lines, lineMap };
|
|
183520
183529
|
}
|
|
183521
183530
|
};
|
|
183522
|
-
var LineNode = class {
|
|
183531
|
+
var LineNode = class _LineNode {
|
|
183523
183532
|
constructor(children = []) {
|
|
183524
183533
|
this.children = children;
|
|
183525
183534
|
this.totalChars = 0;
|
|
@@ -183651,7 +183660,7 @@ var LineNode = class {
|
|
|
183651
183660
|
childIndex++;
|
|
183652
183661
|
const endLength = childIndex;
|
|
183653
183662
|
if (childIndex < clen) {
|
|
183654
|
-
splitNode = new
|
|
183663
|
+
splitNode = new _LineNode();
|
|
183655
183664
|
while (childIndex < clen) {
|
|
183656
183665
|
splitNode.add(this.children[childIndex]);
|
|
183657
183666
|
childIndex++;
|
|
@@ -183700,7 +183709,7 @@ var LineNode = class {
|
|
|
183700
183709
|
splitNodes = new Array(splitNodeCount);
|
|
183701
183710
|
let splitNodeIndex = 0;
|
|
183702
183711
|
for (let i = 0; i < splitNodeCount; i++) {
|
|
183703
|
-
splitNodes[i] = new
|
|
183712
|
+
splitNodes[i] = new _LineNode();
|
|
183704
183713
|
}
|
|
183705
183714
|
let splitNode = splitNodes[0];
|
|
183706
183715
|
while (nodeIndex < nodeCount) {
|
|
@@ -184183,7 +184192,7 @@ function startNodeSession(options, logger, cancellationToken) {
|
|
|
184183
184192
|
output: process.stdout,
|
|
184184
184193
|
terminal: false
|
|
184185
184194
|
});
|
|
184186
|
-
const _NodeTypingsInstaller = class {
|
|
184195
|
+
const _NodeTypingsInstaller = class _NodeTypingsInstaller {
|
|
184187
184196
|
constructor(telemetryEnabled2, logger2, host, globalTypingsCacheLocation, typingSafeListLocation2, typesMapLocation2, npmLocation2, validateDefaultNpmLocation2, event) {
|
|
184188
184197
|
this.telemetryEnabled = telemetryEnabled2;
|
|
184189
184198
|
this.logger = logger2;
|
|
@@ -184391,14 +184400,14 @@ function startNodeSession(options, logger, cancellationToken) {
|
|
|
184391
184400
|
this.host.setTimeout(request.operation, _NodeTypingsInstaller.requestDelayMillis);
|
|
184392
184401
|
}
|
|
184393
184402
|
};
|
|
184394
|
-
let NodeTypingsInstaller = _NodeTypingsInstaller;
|
|
184395
184403
|
// This number is essentially arbitrary. Processing more than one typings request
|
|
184396
184404
|
// at a time makes sense, but having too many in the pipe results in a hang
|
|
184397
184405
|
// (see https://github.com/nodejs/node/issues/7657).
|
|
184398
184406
|
// It would be preferable to base our limit on the amount of space left in the
|
|
184399
184407
|
// buffer, but we have yet to find a way to retrieve that value.
|
|
184400
|
-
|
|
184401
|
-
|
|
184408
|
+
_NodeTypingsInstaller.maxActiveRequestCount = 10;
|
|
184409
|
+
_NodeTypingsInstaller.requestDelayMillis = 100;
|
|
184410
|
+
let NodeTypingsInstaller = _NodeTypingsInstaller;
|
|
184402
184411
|
class IOSession extends Session3 {
|
|
184403
184412
|
constructor() {
|
|
184404
184413
|
const event = (body, eventName) => {
|
package/lib/tsserverlibrary.d.ts
CHANGED
|
@@ -6948,7 +6948,7 @@ declare namespace ts {
|
|
|
6948
6948
|
hasRestElement: boolean;
|
|
6949
6949
|
combinedFlags: ElementFlags;
|
|
6950
6950
|
readonly: boolean;
|
|
6951
|
-
labeledElementDeclarations?: readonly (NamedTupleMember | ParameterDeclaration
|
|
6951
|
+
labeledElementDeclarations?: readonly (NamedTupleMember | ParameterDeclaration)[];
|
|
6952
6952
|
}
|
|
6953
6953
|
interface TupleTypeReference extends TypeReference {
|
|
6954
6954
|
target: TupleType;
|