@typescript-deploys/pr-build 5.2.0-pr-54316-2 → 5.2.0-pr-54052-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/lib.es2017.d.ts +1 -0
- package/lib/lib.es2017.date.d.ts +31 -0
- package/lib/tsc.js +99 -75
- package/lib/tsserver.js +181 -113
- package/lib/tsserverlibrary.d.ts +1 -1
- package/lib/tsserverlibrary.js +181 -113
- package/lib/typescript.d.ts +1 -1
- package/lib/typescript.js +181 -113
- package/lib/typingsInstaller.js +3 -1
- package/package.json +2 -2
package/lib/tsserver.js
CHANGED
|
@@ -2304,7 +2304,7 @@ module.exports = __toCommonJS(server_exports);
|
|
|
2304
2304
|
|
|
2305
2305
|
// src/compiler/corePublic.ts
|
|
2306
2306
|
var versionMajorMinor = "5.2";
|
|
2307
|
-
var version = `${versionMajorMinor}.0-insiders.
|
|
2307
|
+
var version = `${versionMajorMinor}.0-insiders.20230526`;
|
|
2308
2308
|
var Comparison = /* @__PURE__ */ ((Comparison3) => {
|
|
2309
2309
|
Comparison3[Comparison3["LessThan"] = -1] = "LessThan";
|
|
2310
2310
|
Comparison3[Comparison3["EqualTo"] = 0] = "EqualTo";
|
|
@@ -37753,6 +37753,7 @@ var libEntries = [
|
|
|
37753
37753
|
["es2015.symbol", "lib.es2015.symbol.d.ts"],
|
|
37754
37754
|
["es2015.symbol.wellknown", "lib.es2015.symbol.wellknown.d.ts"],
|
|
37755
37755
|
["es2016.array.include", "lib.es2016.array.include.d.ts"],
|
|
37756
|
+
["es2017.date", "lib.es2017.date.d.ts"],
|
|
37756
37757
|
["es2017.object", "lib.es2017.object.d.ts"],
|
|
37757
37758
|
["es2017.sharedmemory", "lib.es2017.sharedmemory.d.ts"],
|
|
37758
37759
|
["es2017.string", "lib.es2017.string.d.ts"],
|
|
@@ -47306,6 +47307,7 @@ var CheckMode = /* @__PURE__ */ ((CheckMode3) => {
|
|
|
47306
47307
|
CheckMode3[CheckMode3["IsForSignatureHelp"] = 16] = "IsForSignatureHelp";
|
|
47307
47308
|
CheckMode3[CheckMode3["IsForStringLiteralArgumentCompletions"] = 32] = "IsForStringLiteralArgumentCompletions";
|
|
47308
47309
|
CheckMode3[CheckMode3["RestBindingElement"] = 64] = "RestBindingElement";
|
|
47310
|
+
CheckMode3[CheckMode3["TypeOnly"] = 128] = "TypeOnly";
|
|
47309
47311
|
return CheckMode3;
|
|
47310
47312
|
})(CheckMode || {});
|
|
47311
47313
|
var SignatureCheckMode = /* @__PURE__ */ ((SignatureCheckMode3) => {
|
|
@@ -52552,32 +52554,34 @@ function createTypeChecker(host) {
|
|
|
52552
52554
|
const methodDeclaration = signatureToSignatureDeclarationHelper(signature, 172 /* MethodSignature */, context, { name: propertyName, questionToken: optionalToken });
|
|
52553
52555
|
typeElements.push(preserveCommentsOn(methodDeclaration));
|
|
52554
52556
|
}
|
|
52557
|
+
if (signatures.length || !optionalToken) {
|
|
52558
|
+
return;
|
|
52559
|
+
}
|
|
52560
|
+
}
|
|
52561
|
+
let propertyTypeNode;
|
|
52562
|
+
if (shouldUsePlaceholderForProperty(propertySymbol, context)) {
|
|
52563
|
+
propertyTypeNode = createElidedInformationPlaceholder(context);
|
|
52555
52564
|
} else {
|
|
52556
|
-
|
|
52557
|
-
|
|
52558
|
-
|
|
52559
|
-
} else {
|
|
52560
|
-
if (propertyIsReverseMapped) {
|
|
52561
|
-
context.reverseMappedStack || (context.reverseMappedStack = []);
|
|
52562
|
-
context.reverseMappedStack.push(propertySymbol);
|
|
52563
|
-
}
|
|
52564
|
-
propertyTypeNode = propertyType ? serializeTypeForDeclaration(context, propertyType, propertySymbol, saveEnclosingDeclaration) : factory.createKeywordTypeNode(133 /* AnyKeyword */);
|
|
52565
|
-
if (propertyIsReverseMapped) {
|
|
52566
|
-
context.reverseMappedStack.pop();
|
|
52567
|
-
}
|
|
52565
|
+
if (propertyIsReverseMapped) {
|
|
52566
|
+
context.reverseMappedStack || (context.reverseMappedStack = []);
|
|
52567
|
+
context.reverseMappedStack.push(propertySymbol);
|
|
52568
52568
|
}
|
|
52569
|
-
|
|
52570
|
-
if (
|
|
52571
|
-
context.
|
|
52569
|
+
propertyTypeNode = propertyType ? serializeTypeForDeclaration(context, propertyType, propertySymbol, saveEnclosingDeclaration) : factory.createKeywordTypeNode(133 /* AnyKeyword */);
|
|
52570
|
+
if (propertyIsReverseMapped) {
|
|
52571
|
+
context.reverseMappedStack.pop();
|
|
52572
52572
|
}
|
|
52573
|
-
const propertySignature = factory.createPropertySignature(
|
|
52574
|
-
modifiers,
|
|
52575
|
-
propertyName,
|
|
52576
|
-
optionalToken,
|
|
52577
|
-
propertyTypeNode
|
|
52578
|
-
);
|
|
52579
|
-
typeElements.push(preserveCommentsOn(propertySignature));
|
|
52580
52573
|
}
|
|
52574
|
+
const modifiers = isReadonlySymbol(propertySymbol) ? [factory.createToken(148 /* ReadonlyKeyword */)] : void 0;
|
|
52575
|
+
if (modifiers) {
|
|
52576
|
+
context.approximateLength += 9;
|
|
52577
|
+
}
|
|
52578
|
+
const propertySignature = factory.createPropertySignature(
|
|
52579
|
+
modifiers,
|
|
52580
|
+
propertyName,
|
|
52581
|
+
optionalToken,
|
|
52582
|
+
propertyTypeNode
|
|
52583
|
+
);
|
|
52584
|
+
typeElements.push(preserveCommentsOn(propertySignature));
|
|
52581
52585
|
function preserveCommentsOn(node) {
|
|
52582
52586
|
var _a2;
|
|
52583
52587
|
if (some(propertySymbol.declarations, (d) => d.kind === 354 /* JSDocPropertyTag */)) {
|
|
@@ -58640,7 +58644,7 @@ function createTypeChecker(host) {
|
|
|
58640
58644
|
} else if (type !== firstType) {
|
|
58641
58645
|
checkFlags |= 64 /* HasNonUniformType */;
|
|
58642
58646
|
}
|
|
58643
|
-
if (isLiteralType(type) || isPatternLiteralType(type)
|
|
58647
|
+
if (isLiteralType(type) || isPatternLiteralType(type)) {
|
|
58644
58648
|
checkFlags |= 128 /* HasLiteralType */;
|
|
58645
58649
|
}
|
|
58646
58650
|
if (type.flags & 131072 /* Never */ && type !== uniqueLiteralType) {
|
|
@@ -60867,31 +60871,28 @@ function createTypeChecker(host) {
|
|
|
60867
60871
|
return getUnionTypeFromSortedList(typeSet, objectFlags, aliasSymbol, aliasTypeArguments, origin);
|
|
60868
60872
|
}
|
|
60869
60873
|
function getUnionOrIntersectionTypePredicate(signatures, kind) {
|
|
60870
|
-
let
|
|
60874
|
+
let last2;
|
|
60871
60875
|
const types = [];
|
|
60872
60876
|
for (const sig of signatures) {
|
|
60873
60877
|
const pred = getTypePredicateOfSignature(sig);
|
|
60874
|
-
if (
|
|
60875
|
-
if (kind !==
|
|
60876
|
-
continue;
|
|
60877
|
-
} else {
|
|
60878
|
-
return;
|
|
60879
|
-
}
|
|
60880
|
-
}
|
|
60881
|
-
if (first2) {
|
|
60882
|
-
if (!typePredicateKindsMatch(first2, pred)) {
|
|
60878
|
+
if (pred) {
|
|
60879
|
+
if (pred.kind !== 0 /* This */ && pred.kind !== 1 /* Identifier */ || last2 && !typePredicateKindsMatch(last2, pred)) {
|
|
60883
60880
|
return void 0;
|
|
60884
60881
|
}
|
|
60882
|
+
last2 = pred;
|
|
60883
|
+
types.push(pred.type);
|
|
60885
60884
|
} else {
|
|
60886
|
-
|
|
60885
|
+
const returnType = kind !== 2097152 /* Intersection */ ? getReturnTypeOfSignature(sig) : void 0;
|
|
60886
|
+
if (returnType !== falseType && returnType !== regularFalseType) {
|
|
60887
|
+
return void 0;
|
|
60888
|
+
}
|
|
60887
60889
|
}
|
|
60888
|
-
types.push(pred.type);
|
|
60889
60890
|
}
|
|
60890
|
-
if (!
|
|
60891
|
+
if (!last2) {
|
|
60891
60892
|
return void 0;
|
|
60892
60893
|
}
|
|
60893
60894
|
const compositeType = getUnionOrIntersectionType(types, kind);
|
|
60894
|
-
return createTypePredicate(
|
|
60895
|
+
return createTypePredicate(last2.kind, last2.parameterName, last2.parameterIndex, compositeType);
|
|
60895
60896
|
}
|
|
60896
60897
|
function typePredicateKindsMatch(a, b) {
|
|
60897
60898
|
return a.kind === b.kind && a.parameterIndex === b.parameterIndex;
|
|
@@ -61933,9 +61934,9 @@ function createTypeChecker(host) {
|
|
|
61933
61934
|
);
|
|
61934
61935
|
if (freshMapper) {
|
|
61935
61936
|
const freshCombinedMapper = combineTypeMappers(mapper, freshMapper);
|
|
61936
|
-
for (
|
|
61937
|
-
if (root.inferTypeParameters
|
|
61938
|
-
|
|
61937
|
+
for (let i = 0; i < freshParams.length; i++) {
|
|
61938
|
+
if (freshParams[i] !== root.inferTypeParameters[i]) {
|
|
61939
|
+
freshParams[i].mapper = freshCombinedMapper;
|
|
61939
61940
|
}
|
|
61940
61941
|
}
|
|
61941
61942
|
}
|
|
@@ -62772,18 +62773,19 @@ function createTypeChecker(host) {
|
|
|
62772
62773
|
case 185 /* TypeQuery */:
|
|
62773
62774
|
const entityName = node2.exprName;
|
|
62774
62775
|
const firstIdentifier = getFirstIdentifier(entityName);
|
|
62775
|
-
|
|
62776
|
-
|
|
62777
|
-
|
|
62778
|
-
|
|
62779
|
-
|
|
62780
|
-
|
|
62781
|
-
|
|
62782
|
-
|
|
62783
|
-
|
|
62784
|
-
|
|
62785
|
-
|
|
62786
|
-
|
|
62776
|
+
if (!isThisIdentifier(firstIdentifier)) {
|
|
62777
|
+
const firstIdentifierSymbol = getResolvedSymbol(firstIdentifier);
|
|
62778
|
+
const tpDeclaration = tp.symbol.declarations[0];
|
|
62779
|
+
const tpScope = tpDeclaration.kind === 167 /* TypeParameter */ ? tpDeclaration.parent : (
|
|
62780
|
+
// Type parameter is a regular type parameter, e.g. foo<T>
|
|
62781
|
+
tp.isThisType ? tpDeclaration : (
|
|
62782
|
+
// Type parameter is the this type, and its declaration is the class declaration.
|
|
62783
|
+
void 0
|
|
62784
|
+
)
|
|
62785
|
+
);
|
|
62786
|
+
if (firstIdentifierSymbol.declarations && tpScope) {
|
|
62787
|
+
return some(firstIdentifierSymbol.declarations, (idDecl) => isNodeDescendantOf(idDecl, tpScope)) || some(node2.typeArguments, containsReference);
|
|
62788
|
+
}
|
|
62787
62789
|
}
|
|
62788
62790
|
return true;
|
|
62789
62791
|
case 173 /* MethodDeclaration */:
|
|
@@ -62837,6 +62839,9 @@ function createTypeChecker(host) {
|
|
|
62837
62839
|
const elementFlags = tupleType.target.elementFlags;
|
|
62838
62840
|
const elementTypes = map(getElementTypes(tupleType), (t, i) => {
|
|
62839
62841
|
const singleton = elementFlags[i] & 8 /* Variadic */ ? t : elementFlags[i] & 4 /* Rest */ ? createArrayType(t) : createTupleType([t], [elementFlags[i]]);
|
|
62842
|
+
if (singleton === typeVariable) {
|
|
62843
|
+
return mappedType;
|
|
62844
|
+
}
|
|
62840
62845
|
return instantiateMappedType(mappedType, prependTypeMapping(typeVariable, singleton, mapper));
|
|
62841
62846
|
});
|
|
62842
62847
|
const newReadonly = getModifiedReadonlyState(tupleType.target.readonly, getMappedTypeModifiers(mappedType));
|
|
@@ -63174,6 +63179,10 @@ function createTypeChecker(host) {
|
|
|
63174
63179
|
return true;
|
|
63175
63180
|
}
|
|
63176
63181
|
switch (node.kind) {
|
|
63182
|
+
case 233 /* AsExpression */:
|
|
63183
|
+
if (!isConstAssertion(node)) {
|
|
63184
|
+
break;
|
|
63185
|
+
}
|
|
63177
63186
|
case 293 /* JsxExpression */:
|
|
63178
63187
|
case 216 /* ParenthesizedExpression */:
|
|
63179
63188
|
return elaborateError(node.expression, source, target, relation, headMessage, containingMessageChain, errorOutputContainer);
|
|
@@ -66421,7 +66430,7 @@ function createTypeChecker(host) {
|
|
|
66421
66430
|
}
|
|
66422
66431
|
}
|
|
66423
66432
|
}
|
|
66424
|
-
const filtered = contains(include, 0 /* False */) ? getUnionType(types.filter((_, i) => include[i])) : target;
|
|
66433
|
+
const filtered = contains(include, 0 /* False */) ? getUnionType(types.filter((_, i) => include[i]), 0 /* None */) : target;
|
|
66425
66434
|
return filtered.flags & 131072 /* Never */ ? target : filtered;
|
|
66426
66435
|
}
|
|
66427
66436
|
function isWeakType(type) {
|
|
@@ -66625,7 +66634,7 @@ function createTypeChecker(host) {
|
|
|
66625
66634
|
}
|
|
66626
66635
|
function getRecursionIdentity(type) {
|
|
66627
66636
|
if (type.flags & 524288 /* Object */ && !isObjectOrArrayLiteralType(type)) {
|
|
66628
|
-
if (getObjectFlags(type)
|
|
66637
|
+
if (getObjectFlags(type) & 4 /* Reference */ && type.node) {
|
|
66629
66638
|
return type.node;
|
|
66630
66639
|
}
|
|
66631
66640
|
if (type.symbol && !(getObjectFlags(type) & 16 /* Anonymous */ && type.symbol.flags & 32 /* Class */)) {
|
|
@@ -69452,7 +69461,7 @@ function createTypeChecker(host) {
|
|
|
69452
69461
|
target.antecedents = saveAntecedents;
|
|
69453
69462
|
} else if (flags & 2 /* Start */) {
|
|
69454
69463
|
const container = flow.node;
|
|
69455
|
-
if (container && container !== flowContainer && reference.kind !== 210 /* PropertyAccessExpression */ && reference.kind !== 211 /* ElementAccessExpression */ && reference.kind
|
|
69464
|
+
if (container && container !== flowContainer && reference.kind !== 210 /* PropertyAccessExpression */ && reference.kind !== 211 /* ElementAccessExpression */ && !(reference.kind === 110 /* ThisKeyword */ && container.kind !== 218 /* ArrowFunction */)) {
|
|
69456
69465
|
flow = container.flowNode;
|
|
69457
69466
|
continue;
|
|
69458
69467
|
}
|
|
@@ -77939,7 +77948,7 @@ function createTypeChecker(host) {
|
|
|
77939
77948
|
Debug.assertIsDefined(leftType);
|
|
77940
77949
|
const rightType = getLastResult(state);
|
|
77941
77950
|
Debug.assertIsDefined(rightType);
|
|
77942
|
-
result = checkBinaryLikeExpressionWorker(node.left, node.operatorToken, node.right, leftType, rightType, node);
|
|
77951
|
+
result = checkBinaryLikeExpressionWorker(node.left, node.operatorToken, node.right, leftType, rightType, state.checkMode, node);
|
|
77943
77952
|
}
|
|
77944
77953
|
state.skip = false;
|
|
77945
77954
|
setLeftType(
|
|
@@ -78001,9 +78010,9 @@ function createTypeChecker(host) {
|
|
|
78001
78010
|
leftType = checkExpression(left, checkMode);
|
|
78002
78011
|
}
|
|
78003
78012
|
const rightType = checkExpression(right, checkMode);
|
|
78004
|
-
return checkBinaryLikeExpressionWorker(left, operatorToken, right, leftType, rightType, errorNode);
|
|
78013
|
+
return checkBinaryLikeExpressionWorker(left, operatorToken, right, leftType, rightType, checkMode, errorNode);
|
|
78005
78014
|
}
|
|
78006
|
-
function checkBinaryLikeExpressionWorker(left, operatorToken, right, leftType, rightType, errorNode) {
|
|
78015
|
+
function checkBinaryLikeExpressionWorker(left, operatorToken, right, leftType, rightType, checkMode, errorNode) {
|
|
78007
78016
|
const operator = operatorToken.kind;
|
|
78008
78017
|
switch (operator) {
|
|
78009
78018
|
case 42 /* AsteriskToken */:
|
|
@@ -78160,12 +78169,14 @@ function createTypeChecker(host) {
|
|
|
78160
78169
|
case 36 /* ExclamationEqualsToken */:
|
|
78161
78170
|
case 37 /* EqualsEqualsEqualsToken */:
|
|
78162
78171
|
case 38 /* ExclamationEqualsEqualsToken */:
|
|
78163
|
-
if (
|
|
78164
|
-
|
|
78165
|
-
|
|
78172
|
+
if (!(checkMode && checkMode & 128 /* TypeOnly */)) {
|
|
78173
|
+
if (isLiteralExpressionOfObject(left) || isLiteralExpressionOfObject(right)) {
|
|
78174
|
+
const eqType = operator === 35 /* EqualsEqualsToken */ || operator === 37 /* EqualsEqualsEqualsToken */;
|
|
78175
|
+
error(errorNode, Diagnostics.This_condition_will_always_return_0_since_JavaScript_compares_objects_by_reference_not_value, eqType ? "false" : "true");
|
|
78176
|
+
}
|
|
78177
|
+
checkNaNEquality(errorNode, operator, left, right);
|
|
78178
|
+
reportOperatorErrorUnless((left2, right2) => isTypeEqualityComparableTo(left2, right2) || isTypeEqualityComparableTo(right2, left2));
|
|
78166
78179
|
}
|
|
78167
|
-
checkNaNEquality(errorNode, operator, left, right);
|
|
78168
|
-
reportOperatorErrorUnless((left2, right2) => isTypeEqualityComparableTo(left2, right2) || isTypeEqualityComparableTo(right2, left2));
|
|
78169
78180
|
return booleanType;
|
|
78170
78181
|
case 104 /* InstanceOfKeyword */:
|
|
78171
78182
|
return checkInstanceOfExpression(left, right, leftType, rightType);
|
|
@@ -78476,7 +78487,7 @@ function createTypeChecker(host) {
|
|
|
78476
78487
|
}
|
|
78477
78488
|
}
|
|
78478
78489
|
function checkConditionalExpression(node, checkMode) {
|
|
78479
|
-
const type = checkTruthinessExpression(node.condition);
|
|
78490
|
+
const type = checkTruthinessExpression(node.condition, checkMode);
|
|
78480
78491
|
checkTestingKnownTruthyCallableOrAwaitableType(node.condition, type, node.whenTrue);
|
|
78481
78492
|
const type1 = checkExpression(node.whenTrue, checkMode);
|
|
78482
78493
|
const type2 = checkExpression(node.whenFalse, checkMode);
|
|
@@ -78817,7 +78828,7 @@ function createTypeChecker(host) {
|
|
|
78817
78828
|
}
|
|
78818
78829
|
}
|
|
78819
78830
|
const startInvocationCount = flowInvocationCount;
|
|
78820
|
-
const type = checkExpression(node);
|
|
78831
|
+
const type = checkExpression(node, 128 /* TypeOnly */);
|
|
78821
78832
|
if (flowInvocationCount !== startInvocationCount) {
|
|
78822
78833
|
const cache = flowTypeCache || (flowTypeCache = []);
|
|
78823
78834
|
cache[getNodeId(node)] = type;
|
|
@@ -78893,7 +78904,7 @@ function createTypeChecker(host) {
|
|
|
78893
78904
|
if (getIsolatedModules(compilerOptions)) {
|
|
78894
78905
|
Debug.assert(!!(type.symbol.flags & 128 /* ConstEnum */));
|
|
78895
78906
|
const constEnumDeclaration = type.symbol.valueDeclaration;
|
|
78896
|
-
if (constEnumDeclaration.flags & 16777216 /* Ambient */) {
|
|
78907
|
+
if (constEnumDeclaration.flags & 16777216 /* Ambient */ && !isValidTypeOnlyAliasUseSite(node)) {
|
|
78897
78908
|
error(node, Diagnostics.Cannot_access_ambient_const_enums_when_0_is_enabled, isolatedModulesLikeFlagName);
|
|
78898
78909
|
}
|
|
78899
78910
|
}
|
|
@@ -79322,6 +79333,9 @@ function createTypeChecker(host) {
|
|
|
79322
79333
|
case "length":
|
|
79323
79334
|
case "caller":
|
|
79324
79335
|
case "arguments":
|
|
79336
|
+
if (compilerOptions.useDefineForClassFields) {
|
|
79337
|
+
break;
|
|
79338
|
+
}
|
|
79325
79339
|
case "prototype":
|
|
79326
79340
|
const message = Diagnostics.Static_property_0_conflicts_with_built_in_property_Function_0_of_constructor_function_1;
|
|
79327
79341
|
const className = getNameOfSymbolAsWritten(getSymbolOfDeclaration(node));
|
|
@@ -86328,7 +86342,7 @@ function createTypeChecker(host) {
|
|
|
86328
86342
|
if (requestedExternalEmitHelperNames.has(name))
|
|
86329
86343
|
continue;
|
|
86330
86344
|
requestedExternalEmitHelperNames.add(name);
|
|
86331
|
-
const symbol = getSymbol2(helpersModule
|
|
86345
|
+
const symbol = getSymbol2(getExportsOfModule(helpersModule), escapeLeadingUnderscores(name), 111551 /* Value */);
|
|
86332
86346
|
if (!symbol) {
|
|
86333
86347
|
error(location, Diagnostics.This_syntax_requires_an_imported_helper_named_1_which_does_not_exist_in_0_Consider_upgrading_your_version_of_0, externalHelpersModuleNameText, name);
|
|
86334
86348
|
} else if (helper & 524288 /* ClassPrivateFieldGet */) {
|
|
@@ -123677,7 +123691,7 @@ function createResolutionCache(resolutionHost, rootDirForResolution, logChangesW
|
|
|
123677
123691
|
let filesWithChangedSetOfUnresolvedImports;
|
|
123678
123692
|
let filesWithInvalidatedResolutions;
|
|
123679
123693
|
let filesWithInvalidatedNonRelativeUnresolvedImports;
|
|
123680
|
-
const nonRelativeExternalModuleResolutions =
|
|
123694
|
+
const nonRelativeExternalModuleResolutions = createMultiMap();
|
|
123681
123695
|
const resolutionsWithFailedLookups = /* @__PURE__ */ new Set();
|
|
123682
123696
|
const resolutionsWithOnlyAffectingLocations = /* @__PURE__ */ new Set();
|
|
123683
123697
|
const resolvedFileToResolution = /* @__PURE__ */ new Map();
|
|
@@ -123811,7 +123825,8 @@ function createResolutionCache(resolutionHost, rootDirForResolution, logChangesW
|
|
|
123811
123825
|
moduleResolutionCache.clearAllExceptPackageJsonInfoCache();
|
|
123812
123826
|
typeReferenceDirectiveResolutionCache.clearAllExceptPackageJsonInfoCache();
|
|
123813
123827
|
libraryResolutionCache.clearAllExceptPackageJsonInfoCache();
|
|
123814
|
-
watchFailedLookupLocationOfNonRelativeModuleResolutions
|
|
123828
|
+
nonRelativeExternalModuleResolutions.forEach(watchFailedLookupLocationOfNonRelativeModuleResolutions);
|
|
123829
|
+
nonRelativeExternalModuleResolutions.clear();
|
|
123815
123830
|
}
|
|
123816
123831
|
function cleanupLibResolutionWatching(newProgram) {
|
|
123817
123832
|
resolvedLibraries.forEach((resolution, libFileName) => {
|
|
@@ -123829,7 +123844,8 @@ function createResolutionCache(resolutionHost, rootDirForResolution, logChangesW
|
|
|
123829
123844
|
function finishCachingPerDirectoryResolution(newProgram, oldProgram) {
|
|
123830
123845
|
filesWithInvalidatedNonRelativeUnresolvedImports = void 0;
|
|
123831
123846
|
allModuleAndTypeResolutionsAreInvalidated = false;
|
|
123832
|
-
watchFailedLookupLocationOfNonRelativeModuleResolutions
|
|
123847
|
+
nonRelativeExternalModuleResolutions.forEach(watchFailedLookupLocationOfNonRelativeModuleResolutions);
|
|
123848
|
+
nonRelativeExternalModuleResolutions.clear();
|
|
123833
123849
|
if (newProgram !== oldProgram) {
|
|
123834
123850
|
cleanupLibResolutionWatching(newProgram);
|
|
123835
123851
|
newProgram == null ? void 0 : newProgram.getSourceFiles().forEach((newFile) => {
|
|
@@ -124110,7 +124126,7 @@ function createResolutionCache(resolutionHost, rootDirForResolution, logChangesW
|
|
|
124110
124126
|
if (!deferWatchingNonRelativeResolution || isExternalModuleNameRelative(name)) {
|
|
124111
124127
|
watchFailedLookupLocationOfResolution(resolution);
|
|
124112
124128
|
} else {
|
|
124113
|
-
nonRelativeExternalModuleResolutions.add(resolution);
|
|
124129
|
+
nonRelativeExternalModuleResolutions.add(name, resolution);
|
|
124114
124130
|
}
|
|
124115
124131
|
const resolved = getResolutionWithResolvedFileName(resolution);
|
|
124116
124132
|
if (resolved && resolved.resolvedFileName) {
|
|
@@ -124240,9 +124256,17 @@ function createResolutionCache(resolutionHost, rootDirForResolution, logChangesW
|
|
|
124240
124256
|
paths.add(affectingLocation);
|
|
124241
124257
|
}
|
|
124242
124258
|
}
|
|
124243
|
-
function watchFailedLookupLocationOfNonRelativeModuleResolutions() {
|
|
124244
|
-
|
|
124245
|
-
|
|
124259
|
+
function watchFailedLookupLocationOfNonRelativeModuleResolutions(resolutions, name) {
|
|
124260
|
+
const program = resolutionHost.getCurrentProgram();
|
|
124261
|
+
if (!program || !program.getTypeChecker().tryFindAmbientModuleWithoutAugmentations(name)) {
|
|
124262
|
+
resolutions.forEach(watchFailedLookupLocationOfResolution);
|
|
124263
|
+
} else {
|
|
124264
|
+
resolutions.forEach((resolution) => watchAffectingLocationsOfResolution(
|
|
124265
|
+
resolution,
|
|
124266
|
+
/*addToResolutionsWithOnlyAffectingLocations*/
|
|
124267
|
+
true
|
|
124268
|
+
));
|
|
124269
|
+
}
|
|
124246
124270
|
}
|
|
124247
124271
|
function setDirectoryWatcher(dir, dirPath, nonRecursive) {
|
|
124248
124272
|
const dirWatcher = directoryWatchesOfFailedLookups.get(dirPath);
|
|
@@ -135582,12 +135606,12 @@ function getEditsForRefactor(context, refactorName13, actionName2, interactiveRe
|
|
|
135582
135606
|
var refactorName = "Convert export";
|
|
135583
135607
|
var defaultToNamedAction = {
|
|
135584
135608
|
name: "Convert default export to named export",
|
|
135585
|
-
description: Diagnostics.Convert_default_export_to_named_export
|
|
135609
|
+
description: getLocaleSpecificMessage(Diagnostics.Convert_default_export_to_named_export),
|
|
135586
135610
|
kind: "refactor.rewrite.export.named"
|
|
135587
135611
|
};
|
|
135588
135612
|
var namedToDefaultAction = {
|
|
135589
135613
|
name: "Convert named export to default export",
|
|
135590
|
-
description: Diagnostics.Convert_named_export_to_default_export
|
|
135614
|
+
description: getLocaleSpecificMessage(Diagnostics.Convert_named_export_to_default_export),
|
|
135591
135615
|
kind: "refactor.rewrite.export.default"
|
|
135592
135616
|
};
|
|
135593
135617
|
registerRefactor(refactorName, {
|
|
@@ -135605,7 +135629,7 @@ registerRefactor(refactorName, {
|
|
|
135605
135629
|
}
|
|
135606
135630
|
if (context.preferences.provideRefactorNotApplicableReason) {
|
|
135607
135631
|
return [
|
|
135608
|
-
{ name: refactorName, description: Diagnostics.Convert_default_export_to_named_export
|
|
135632
|
+
{ name: refactorName, description: getLocaleSpecificMessage(Diagnostics.Convert_default_export_to_named_export), actions: [
|
|
135609
135633
|
{ ...defaultToNamedAction, notApplicableReason: info.error },
|
|
135610
135634
|
{ ...namedToDefaultAction, notApplicableReason: info.error }
|
|
135611
135635
|
] }
|
|
@@ -135828,17 +135852,17 @@ var refactorName2 = "Convert import";
|
|
|
135828
135852
|
var actions = {
|
|
135829
135853
|
[0 /* Named */]: {
|
|
135830
135854
|
name: "Convert namespace import to named imports",
|
|
135831
|
-
description: Diagnostics.Convert_namespace_import_to_named_imports
|
|
135855
|
+
description: getLocaleSpecificMessage(Diagnostics.Convert_namespace_import_to_named_imports),
|
|
135832
135856
|
kind: "refactor.rewrite.import.named"
|
|
135833
135857
|
},
|
|
135834
135858
|
[2 /* Namespace */]: {
|
|
135835
135859
|
name: "Convert named imports to namespace import",
|
|
135836
|
-
description: Diagnostics.Convert_named_imports_to_namespace_import
|
|
135860
|
+
description: getLocaleSpecificMessage(Diagnostics.Convert_named_imports_to_namespace_import),
|
|
135837
135861
|
kind: "refactor.rewrite.import.namespace"
|
|
135838
135862
|
},
|
|
135839
135863
|
[1 /* Default */]: {
|
|
135840
135864
|
name: "Convert named imports to default import",
|
|
135841
|
-
description: Diagnostics.Convert_named_imports_to_default_import
|
|
135865
|
+
description: getLocaleSpecificMessage(Diagnostics.Convert_named_imports_to_default_import),
|
|
135842
135866
|
kind: "refactor.rewrite.import.default"
|
|
135843
135867
|
}
|
|
135844
135868
|
};
|
|
@@ -136494,10 +136518,9 @@ registerRefactor(refactorNameForMoveToFile, {
|
|
|
136494
136518
|
}
|
|
136495
136519
|
});
|
|
136496
136520
|
function doChange4(context, oldFile, targetFile, program, toMove, changes, host, preferences) {
|
|
136497
|
-
var _a;
|
|
136498
136521
|
const checker = program.getTypeChecker();
|
|
136499
136522
|
const usage = getUsageInfo(oldFile, toMove.all, checker);
|
|
136500
|
-
if (!host.fileExists(targetFile)
|
|
136523
|
+
if (!host.fileExists(targetFile)) {
|
|
136501
136524
|
changes.createNewFile(oldFile, targetFile, getNewStatementsAndRemoveFromOldFile2(oldFile, targetFile, usage, changes, toMove, program, host, preferences));
|
|
136502
136525
|
addNewFileToTsconfig(program, changes, oldFile.fileName, targetFile, hostGetCanonicalFileName(host));
|
|
136503
136526
|
} else {
|
|
@@ -136535,6 +136558,13 @@ function getNewStatementsAndRemoveFromOldFile2(oldFile, targetFile, usage, chang
|
|
|
136535
136558
|
if (typeof targetFile !== "string") {
|
|
136536
136559
|
if (targetFile.statements.length > 0) {
|
|
136537
136560
|
changes.insertNodesAfter(targetFile, targetFile.statements[targetFile.statements.length - 1], body);
|
|
136561
|
+
} else {
|
|
136562
|
+
changes.insertNodesAtEndOfFile(
|
|
136563
|
+
targetFile,
|
|
136564
|
+
body,
|
|
136565
|
+
/*blankLineBetween*/
|
|
136566
|
+
false
|
|
136567
|
+
);
|
|
136538
136568
|
}
|
|
136539
136569
|
if (imports.length > 0) {
|
|
136540
136570
|
insertImports(
|
|
@@ -137121,6 +137151,10 @@ function getRangeToMove(context) {
|
|
|
137121
137151
|
if (isNamedDeclaration(startStatement) && startStatement.name && rangeContainsRange(startStatement.name, range)) {
|
|
137122
137152
|
return { toMove: [statements[startNodeIndex]], afterLast: statements[startNodeIndex + 1] };
|
|
137123
137153
|
}
|
|
137154
|
+
const overloadRangeToMove = getOverloadRangeToMove(file, startStatement);
|
|
137155
|
+
if (overloadRangeToMove) {
|
|
137156
|
+
return overloadRangeToMove;
|
|
137157
|
+
}
|
|
137124
137158
|
if (range.pos > startStatement.getStart(file))
|
|
137125
137159
|
return void 0;
|
|
137126
137160
|
const afterEndNodeIndex = findIndex(statements, (s) => s.end > range.end, startNodeIndex);
|
|
@@ -137316,13 +137350,26 @@ function isNonVariableTopLevelDeclaration(node) {
|
|
|
137316
137350
|
return false;
|
|
137317
137351
|
}
|
|
137318
137352
|
}
|
|
137353
|
+
function getOverloadRangeToMove(sourceFile, statement) {
|
|
137354
|
+
if (isFunctionLikeDeclaration(statement)) {
|
|
137355
|
+
const declarations = statement.symbol.declarations;
|
|
137356
|
+
if (declarations === void 0 || length(declarations) <= 1 || !contains(declarations, statement)) {
|
|
137357
|
+
return void 0;
|
|
137358
|
+
}
|
|
137359
|
+
const lastDecl = declarations[length(declarations) - 1];
|
|
137360
|
+
const statementsToMove = mapDefined(declarations, (d) => getSourceFileOfNode(d) === sourceFile && isStatement(d) ? d : void 0);
|
|
137361
|
+
const end = findLastIndex(sourceFile.statements, (s) => s.end > lastDecl.end);
|
|
137362
|
+
return { toMove: statementsToMove, afterLast: end >= 0 ? sourceFile.statements[end] : void 0 };
|
|
137363
|
+
}
|
|
137364
|
+
return void 0;
|
|
137365
|
+
}
|
|
137319
137366
|
|
|
137320
137367
|
// src/services/_namespaces/ts.refactor.addOrRemoveBracesToArrowFunction.ts
|
|
137321
137368
|
var ts_refactor_addOrRemoveBracesToArrowFunction_exports = {};
|
|
137322
137369
|
|
|
137323
137370
|
// src/services/refactors/convertOverloadListToSingleSignature.ts
|
|
137324
137371
|
var refactorName5 = "Convert overload list to single signature";
|
|
137325
|
-
var refactorDescription = Diagnostics.Convert_overload_list_to_single_signature
|
|
137372
|
+
var refactorDescription = getLocaleSpecificMessage(Diagnostics.Convert_overload_list_to_single_signature);
|
|
137326
137373
|
var functionOverloadAction = {
|
|
137327
137374
|
name: refactorName5,
|
|
137328
137375
|
description: refactorDescription,
|
|
@@ -137534,15 +137581,15 @@ function getConvertableOverloadListAtPosition(file, startPosition, program) {
|
|
|
137534
137581
|
|
|
137535
137582
|
// src/services/refactors/addOrRemoveBracesToArrowFunction.ts
|
|
137536
137583
|
var refactorName6 = "Add or remove braces in an arrow function";
|
|
137537
|
-
var refactorDescription2 = Diagnostics.Add_or_remove_braces_in_an_arrow_function
|
|
137584
|
+
var refactorDescription2 = getLocaleSpecificMessage(Diagnostics.Add_or_remove_braces_in_an_arrow_function);
|
|
137538
137585
|
var addBracesAction = {
|
|
137539
137586
|
name: "Add braces to arrow function",
|
|
137540
|
-
description: Diagnostics.Add_braces_to_arrow_function
|
|
137587
|
+
description: getLocaleSpecificMessage(Diagnostics.Add_braces_to_arrow_function),
|
|
137541
137588
|
kind: "refactor.rewrite.arrow.braces.add"
|
|
137542
137589
|
};
|
|
137543
137590
|
var removeBracesAction = {
|
|
137544
137591
|
name: "Remove braces from arrow function",
|
|
137545
|
-
description: Diagnostics.Remove_braces_from_arrow_function
|
|
137592
|
+
description: getLocaleSpecificMessage(Diagnostics.Remove_braces_from_arrow_function),
|
|
137546
137593
|
kind: "refactor.rewrite.arrow.braces.remove"
|
|
137547
137594
|
};
|
|
137548
137595
|
registerRefactor(refactorName6, {
|
|
@@ -138496,7 +138543,7 @@ function getEditsForToTemplateLiteral(context, node) {
|
|
|
138496
138543
|
}
|
|
138497
138544
|
}
|
|
138498
138545
|
function isNotEqualsOperator(node) {
|
|
138499
|
-
return node.operatorToken.kind
|
|
138546
|
+
return !(node.operatorToken.kind === 64 /* EqualsToken */ || node.operatorToken.kind === 65 /* PlusEqualsToken */);
|
|
138500
138547
|
}
|
|
138501
138548
|
function getParentBinaryExpression(expr) {
|
|
138502
138549
|
const container = findAncestor(expr.parent, (n) => {
|
|
@@ -140472,7 +140519,7 @@ var ts_refactor_generateGetAccessorAndSetAccessor_exports = {};
|
|
|
140472
140519
|
|
|
140473
140520
|
// src/services/refactors/generateGetAccessorAndSetAccessor.ts
|
|
140474
140521
|
var actionName = "Generate 'get' and 'set' accessors";
|
|
140475
|
-
var actionDescription = Diagnostics.Generate_get_and_set_accessors
|
|
140522
|
+
var actionDescription = getLocaleSpecificMessage(Diagnostics.Generate_get_and_set_accessors);
|
|
140476
140523
|
var generateGetSetAction = {
|
|
140477
140524
|
name: actionName,
|
|
140478
140525
|
description: actionDescription,
|
|
@@ -140529,7 +140576,7 @@ var ts_refactor_inferFunctionReturnType_exports = {};
|
|
|
140529
140576
|
|
|
140530
140577
|
// src/services/refactors/inferFunctionReturnType.ts
|
|
140531
140578
|
var refactorName12 = "Infer function return type";
|
|
140532
|
-
var refactorDescription6 = Diagnostics.Infer_function_return_type
|
|
140579
|
+
var refactorDescription6 = getLocaleSpecificMessage(Diagnostics.Infer_function_return_type);
|
|
140533
140580
|
var inferReturnTypeAction = {
|
|
140534
140581
|
name: refactorName12,
|
|
140535
140582
|
description: refactorDescription6,
|
|
@@ -141872,7 +141919,11 @@ function createLanguageService(host, documentRegistry = createDocumentRegistry(h
|
|
|
141872
141919
|
onUnRecoverableConfigFileDiagnostic: noop
|
|
141873
141920
|
};
|
|
141874
141921
|
const documentRegistryBucketKey = documentRegistry.getKeyForCompilationSettings(newSettings);
|
|
141922
|
+
let releasedScriptKinds = /* @__PURE__ */ new Set();
|
|
141875
141923
|
if (isProgramUptoDate(program, rootFileNames, newSettings, (_path, fileName) => host.getScriptVersion(fileName), (fileName) => compilerHost.fileExists(fileName), hasInvalidatedResolutions, hasInvalidatedLibResolutions, hasChangedAutomaticTypeDirectiveNames, getParsedCommandLine, projectReferences)) {
|
|
141924
|
+
compilerHost = void 0;
|
|
141925
|
+
parsedCommandLines = void 0;
|
|
141926
|
+
releasedScriptKinds = void 0;
|
|
141876
141927
|
return;
|
|
141877
141928
|
}
|
|
141878
141929
|
const options = {
|
|
@@ -141885,6 +141936,7 @@ function createLanguageService(host, documentRegistry = createDocumentRegistry(h
|
|
|
141885
141936
|
program = createProgram(options);
|
|
141886
141937
|
compilerHost = void 0;
|
|
141887
141938
|
parsedCommandLines = void 0;
|
|
141939
|
+
releasedScriptKinds = void 0;
|
|
141888
141940
|
sourceMapper.clearCache();
|
|
141889
141941
|
program.getTypeChecker();
|
|
141890
141942
|
return;
|
|
@@ -141939,10 +141991,11 @@ function createLanguageService(host, documentRegistry = createDocumentRegistry(h
|
|
|
141939
141991
|
if (!shouldCreateNewSourceFile) {
|
|
141940
141992
|
const oldSourceFile = program && program.getSourceFileByPath(path);
|
|
141941
141993
|
if (oldSourceFile) {
|
|
141942
|
-
if (scriptKind === oldSourceFile.scriptKind) {
|
|
141994
|
+
if (scriptKind === oldSourceFile.scriptKind || releasedScriptKinds.has(oldSourceFile.resolvedPath)) {
|
|
141943
141995
|
return documentRegistry.updateDocumentWithKey(fileName, path, host, documentRegistryBucketKey, scriptSnapshot, scriptVersion, scriptKind, languageVersionOrOptions);
|
|
141944
141996
|
} else {
|
|
141945
141997
|
documentRegistry.releaseDocumentWithKey(oldSourceFile.resolvedPath, documentRegistry.getKeyForCompilationSettings(program.getCompilerOptions()), oldSourceFile.scriptKind, oldSourceFile.impliedNodeFormat);
|
|
141998
|
+
releasedScriptKinds.add(oldSourceFile.resolvedPath);
|
|
141946
141999
|
}
|
|
141947
142000
|
}
|
|
141948
142001
|
}
|
|
@@ -150422,9 +150475,6 @@ function getActionsForMissingMethodDeclaration(context, info) {
|
|
|
150422
150475
|
if (call === void 0) {
|
|
150423
150476
|
return void 0;
|
|
150424
150477
|
}
|
|
150425
|
-
if (isPrivateIdentifier(token)) {
|
|
150426
|
-
return void 0;
|
|
150427
|
-
}
|
|
150428
150478
|
const methodName = token.text;
|
|
150429
150479
|
const addMethodDeclarationChanges = (modifierFlags2) => ts_textChanges_exports.ChangeTracker.with(context, (t) => addMethodDeclaration(context, t, call, token, modifierFlags2, parentDeclaration, declSourceFile));
|
|
150430
150480
|
const actions2 = [createCodeFixAction(fixMissingMember, addMethodDeclarationChanges(modifierFlags & 32 /* Static */), [modifierFlags & 32 /* Static */ ? Diagnostics.Declare_static_method_0 : Diagnostics.Declare_method_0, methodName], fixMissingMember, Diagnostics.Add_all_missing_members)];
|
|
@@ -153474,6 +153524,7 @@ function createSignatureDeclarationFromCallExpression(kind, context, importAdder
|
|
|
153474
153524
|
type === void 0 ? factory.createKeywordTypeNode(159 /* UnknownKeyword */) : type
|
|
153475
153525
|
);
|
|
153476
153526
|
case 261 /* FunctionDeclaration */:
|
|
153527
|
+
Debug.assert(typeof name === "string" || isIdentifier(name), "Unexpected name");
|
|
153477
153528
|
return factory.createFunctionDeclaration(
|
|
153478
153529
|
modifiers,
|
|
153479
153530
|
asteriskToken,
|
|
@@ -161495,9 +161546,9 @@ var Core;
|
|
|
161495
161546
|
if (refNode.parent.kind === 303 /* ShorthandPropertyAssignment */) {
|
|
161496
161547
|
getReferenceEntriesForShorthandPropertyAssignment(refNode, state.checker, addReference2);
|
|
161497
161548
|
}
|
|
161498
|
-
const
|
|
161499
|
-
if (
|
|
161500
|
-
addReference2(
|
|
161549
|
+
const containingNode = getContainingNodeIfInHeritageClause(refNode);
|
|
161550
|
+
if (containingNode) {
|
|
161551
|
+
addReference2(containingNode);
|
|
161501
161552
|
return;
|
|
161502
161553
|
}
|
|
161503
161554
|
const typeNode = findAncestor(refNode, (a) => !isQualifiedName(a.parent) && !isTypeNode(a.parent) && !isTypeElement(a.parent));
|
|
@@ -161524,8 +161575,8 @@ var Core;
|
|
|
161524
161575
|
addReference2(e);
|
|
161525
161576
|
}
|
|
161526
161577
|
}
|
|
161527
|
-
function
|
|
161528
|
-
return isIdentifier(node) || isPropertyAccessExpression(node) ?
|
|
161578
|
+
function getContainingNodeIfInHeritageClause(node) {
|
|
161579
|
+
return isIdentifier(node) || isPropertyAccessExpression(node) ? getContainingNodeIfInHeritageClause(node.parent) : isExpressionWithTypeArguments(node) ? tryCast(node.parent.parent, or(isClassLike, isInterfaceDeclaration)) : void 0;
|
|
161529
161580
|
}
|
|
161530
161581
|
function isImplementationExpression(node) {
|
|
161531
161582
|
switch (node.kind) {
|
|
@@ -163076,7 +163127,7 @@ function getDocCommentTemplateAtPosition(newLine, sourceFile, position, options)
|
|
|
163076
163127
|
const tags = (parameters ? parameterDocComments(parameters || [], isJavaScriptFile, indentationStr, newLine) : "") + (hasReturn2 ? returnsDocComment(indentationStr, newLine) : "");
|
|
163077
163128
|
const openComment = "/**";
|
|
163078
163129
|
const closeComment = " */";
|
|
163079
|
-
const hasTag = (
|
|
163130
|
+
const hasTag = length(getJSDocTags(commentOwner)) > 0;
|
|
163080
163131
|
if (tags && !hasTag) {
|
|
163081
163132
|
const preamble = openComment + newLine + indentationStr + " * ";
|
|
163082
163133
|
const endLine = tokenStart === position ? newLine + indentationStr : "";
|
|
@@ -165999,6 +166050,17 @@ var ChangeTracker = class {
|
|
|
165999
166050
|
this.insertNodeAt(sourceFile, pos, insert, options);
|
|
166000
166051
|
}
|
|
166001
166052
|
}
|
|
166053
|
+
insertNodesAtEndOfFile(sourceFile, newNodes, blankLineBetween) {
|
|
166054
|
+
this.insertAtEndOfFile(sourceFile, newNodes, blankLineBetween);
|
|
166055
|
+
}
|
|
166056
|
+
insertAtEndOfFile(sourceFile, insert, blankLineBetween) {
|
|
166057
|
+
const pos = sourceFile.end + 1;
|
|
166058
|
+
const options = {
|
|
166059
|
+
prefix: this.newLineCharacter,
|
|
166060
|
+
suffix: this.newLineCharacter + (blankLineBetween ? this.newLineCharacter : "")
|
|
166061
|
+
};
|
|
166062
|
+
this.insertNodesAt(sourceFile, pos, insert, options);
|
|
166063
|
+
}
|
|
166002
166064
|
insertStatementsInNewFile(fileName, statements, oldFile) {
|
|
166003
166065
|
if (!this.newFileChanges) {
|
|
166004
166066
|
this.newFileChanges = createMultiMap();
|
|
@@ -168416,7 +168478,8 @@ function formatSpanWorker(originalRange, enclosingNode, initialIndentation, delt
|
|
|
168416
168478
|
}
|
|
168417
168479
|
processNode(enclosingNode, enclosingNode, startLine, undecoratedStartLine, initialIndentation, delta);
|
|
168418
168480
|
}
|
|
168419
|
-
|
|
168481
|
+
const remainingTrivia = formattingScanner.getCurrentLeadingTrivia();
|
|
168482
|
+
if (remainingTrivia) {
|
|
168420
168483
|
const indentation = SmartIndenter.nodeWillIndentChild(
|
|
168421
168484
|
options,
|
|
168422
168485
|
enclosingNode,
|
|
@@ -168426,25 +168489,30 @@ function formatSpanWorker(originalRange, enclosingNode, initialIndentation, delt
|
|
|
168426
168489
|
/*indentByDefault*/
|
|
168427
168490
|
false
|
|
168428
168491
|
) ? initialIndentation + options.indentSize : initialIndentation;
|
|
168429
|
-
|
|
168430
|
-
|
|
168431
|
-
|
|
168432
|
-
|
|
168433
|
-
|
|
168434
|
-
|
|
168435
|
-
|
|
168436
|
-
(item) => processRange(
|
|
168492
|
+
indentTriviaItems(
|
|
168493
|
+
remainingTrivia,
|
|
168494
|
+
indentation,
|
|
168495
|
+
/*indentNextTokenOrTrivia*/
|
|
168496
|
+
true,
|
|
168497
|
+
(item) => {
|
|
168498
|
+
processRange(
|
|
168437
168499
|
item,
|
|
168438
168500
|
sourceFile.getLineAndCharacterOfPosition(item.pos),
|
|
168439
168501
|
enclosingNode,
|
|
168440
168502
|
enclosingNode,
|
|
168441
168503
|
/*dynamicIndentation*/
|
|
168442
168504
|
void 0
|
|
168443
|
-
)
|
|
168444
|
-
|
|
168445
|
-
|
|
168446
|
-
|
|
168505
|
+
);
|
|
168506
|
+
insertIndentation(
|
|
168507
|
+
item.pos,
|
|
168508
|
+
indentation,
|
|
168509
|
+
/*lineAdded*/
|
|
168510
|
+
false
|
|
168511
|
+
);
|
|
168447
168512
|
}
|
|
168513
|
+
);
|
|
168514
|
+
if (options.trimTrailingWhitespace !== false) {
|
|
168515
|
+
trimTrailingWhitespacesForRemainingRange(remainingTrivia);
|
|
168448
168516
|
}
|
|
168449
168517
|
}
|
|
168450
168518
|
if (previousRange && formattingScanner.getTokenFullStart() >= originalRange.end) {
|