typescript 5.4.0-dev.20231120 → 5.4.0-dev.20231122
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 +135 -77
- package/lib/tsserver.js +171 -91
- package/lib/typescript.d.ts +5 -3
- package/lib/typescript.js +170 -91
- package/lib/typingsInstaller.js +23 -23
- package/package.json +2 -2
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.4";
|
|
38
|
-
version = `${versionMajorMinor}.0-dev.
|
|
38
|
+
version = `${versionMajorMinor}.0-dev.20231122`;
|
|
39
39
|
Comparison = /* @__PURE__ */ ((Comparison3) => {
|
|
40
40
|
Comparison3[Comparison3["LessThan"] = -1] = "LessThan";
|
|
41
41
|
Comparison3[Comparison3["EqualTo"] = 0] = "EqualTo";
|
|
@@ -4437,7 +4437,7 @@ ${lanes.join("\n")}
|
|
|
4437
4437
|
TypeFlags2[TypeFlags2["InstantiablePrimitive"] = 406847488] = "InstantiablePrimitive";
|
|
4438
4438
|
TypeFlags2[TypeFlags2["Instantiable"] = 465829888] = "Instantiable";
|
|
4439
4439
|
TypeFlags2[TypeFlags2["StructuredOrInstantiable"] = 469499904] = "StructuredOrInstantiable";
|
|
4440
|
-
TypeFlags2[TypeFlags2["ObjectFlagsType"] =
|
|
4440
|
+
TypeFlags2[TypeFlags2["ObjectFlagsType"] = 3899393] = "ObjectFlagsType";
|
|
4441
4441
|
TypeFlags2[TypeFlags2["Simplifiable"] = 25165824] = "Simplifiable";
|
|
4442
4442
|
TypeFlags2[TypeFlags2["Singleton"] = 67358815] = "Singleton";
|
|
4443
4443
|
TypeFlags2[TypeFlags2["Narrowable"] = 536624127] = "Narrowable";
|
|
@@ -7264,6 +7264,10 @@ ${lanes.join("\n")}
|
|
|
7264
7264
|
ESM_syntax_is_not_allowed_in_a_CommonJS_module_when_verbatimModuleSyntax_is_enabled: diag(1286, 1 /* Error */, "ESM_syntax_is_not_allowed_in_a_CommonJS_module_when_verbatimModuleSyntax_is_enabled_1286", "ESM syntax is not allowed in a CommonJS module when 'verbatimModuleSyntax' is enabled."),
|
|
7265
7265
|
A_top_level_export_modifier_cannot_be_used_on_value_declarations_in_a_CommonJS_module_when_verbatimModuleSyntax_is_enabled: diag(1287, 1 /* Error */, "A_top_level_export_modifier_cannot_be_used_on_value_declarations_in_a_CommonJS_module_when_verbatimM_1287", "A top-level 'export' modifier cannot be used on value declarations in a CommonJS module when 'verbatimModuleSyntax' is enabled."),
|
|
7266
7266
|
An_import_alias_cannot_resolve_to_a_type_or_type_only_declaration_when_verbatimModuleSyntax_is_enabled: diag(1288, 1 /* Error */, "An_import_alias_cannot_resolve_to_a_type_or_type_only_declaration_when_verbatimModuleSyntax_is_enabl_1288", "An import alias cannot resolve to a type or type-only declaration when 'verbatimModuleSyntax' is enabled."),
|
|
7267
|
+
_0_resolves_to_a_type_only_declaration_and_must_be_marked_type_only_in_this_file_before_re_exporting_when_1_is_enabled_Consider_using_import_type_where_0_is_imported: diag(1289, 1 /* Error */, "_0_resolves_to_a_type_only_declaration_and_must_be_marked_type_only_in_this_file_before_re_exporting_1289", "'{0}' resolves to a type-only declaration and must be marked type-only in this file before re-exporting when '{1}' is enabled. Consider using 'import type' where '{0}' is imported."),
|
|
7268
|
+
_0_resolves_to_a_type_only_declaration_and_must_be_marked_type_only_in_this_file_before_re_exporting_when_1_is_enabled_Consider_using_export_type_0_as_default: diag(1290, 1 /* Error */, "_0_resolves_to_a_type_only_declaration_and_must_be_marked_type_only_in_this_file_before_re_exporting_1290", "'{0}' resolves to a type-only declaration and must be marked type-only in this file before re-exporting when '{1}' is enabled. Consider using 'export type { {0} as default }'."),
|
|
7269
|
+
_0_resolves_to_a_type_and_must_be_marked_type_only_in_this_file_before_re_exporting_when_1_is_enabled_Consider_using_import_type_where_0_is_imported: diag(1291, 1 /* Error */, "_0_resolves_to_a_type_and_must_be_marked_type_only_in_this_file_before_re_exporting_when_1_is_enable_1291", "'{0}' resolves to a type and must be marked type-only in this file before re-exporting when '{1}' is enabled. Consider using 'import type' where '{0}' is imported."),
|
|
7270
|
+
_0_resolves_to_a_type_and_must_be_marked_type_only_in_this_file_before_re_exporting_when_1_is_enabled_Consider_using_export_type_0_as_default: diag(1292, 1 /* Error */, "_0_resolves_to_a_type_and_must_be_marked_type_only_in_this_file_before_re_exporting_when_1_is_enable_1292", "'{0}' resolves to a type and must be marked type-only in this file before re-exporting when '{1}' is enabled. Consider using 'export type { {0} as default }'."),
|
|
7267
7271
|
with_statements_are_not_allowed_in_an_async_function_block: diag(1300, 1 /* Error */, "with_statements_are_not_allowed_in_an_async_function_block_1300", "'with' statements are not allowed in an async function block."),
|
|
7268
7272
|
await_expressions_are_only_allowed_within_async_functions_and_at_the_top_levels_of_modules: diag(1308, 1 /* Error */, "await_expressions_are_only_allowed_within_async_functions_and_at_the_top_levels_of_modules_1308", "'await' expressions are only allowed within async functions and at the top levels of modules."),
|
|
7269
7273
|
The_current_file_is_a_CommonJS_module_and_cannot_use_await_at_the_top_level: diag(1309, 1 /* Error */, "The_current_file_is_a_CommonJS_module_and_cannot_use_await_at_the_top_level_1309", "The current file is a CommonJS module and cannot use 'await' at the top level."),
|
|
@@ -17355,7 +17359,7 @@ ${lanes.join("\n")}
|
|
|
17355
17359
|
return (_a = symbol.declarations) == null ? void 0 : _a.find(isClassLike);
|
|
17356
17360
|
}
|
|
17357
17361
|
function getObjectFlags(type) {
|
|
17358
|
-
return type.flags &
|
|
17362
|
+
return type.flags & 3899393 /* ObjectFlagsType */ ? type.objectFlags : 0;
|
|
17359
17363
|
}
|
|
17360
17364
|
function forSomeAncestorDirectory(directory, callback) {
|
|
17361
17365
|
return !!forEachAncestorDirectory(directory, (d) => callback(d) ? true : void 0);
|
|
@@ -20156,7 +20160,7 @@ ${lanes.join("\n")}
|
|
|
20156
20160
|
nodeFactoryPatchers.push(fn);
|
|
20157
20161
|
}
|
|
20158
20162
|
function createNodeFactory(flags, baseFactory2) {
|
|
20159
|
-
const
|
|
20163
|
+
const setOriginal = flags & 8 /* NoOriginalNode */ ? identity : setOriginalNode;
|
|
20160
20164
|
const parenthesizerRules = memoize(() => flags & 1 /* NoParenthesizerRules */ ? nullParenthesizerRules : createParenthesizerRules(factory2));
|
|
20161
20165
|
const converters = memoize(() => flags & 2 /* NoNodeConverters */ ? nullNodeConverters : createNodeConverters(factory2));
|
|
20162
20166
|
const getBinaryCreateFunction = memoizeOne((operator) => (left, right) => createBinaryExpression(left, operator, right));
|
|
@@ -23654,7 +23658,7 @@ ${lanes.join("\n")}
|
|
|
23654
23658
|
}
|
|
23655
23659
|
function cloneSourceFile(source) {
|
|
23656
23660
|
const node = source.redirectInfo ? cloneRedirectedSourceFile(source) : cloneSourceFileWorker(source);
|
|
23657
|
-
|
|
23661
|
+
setOriginal(node, source);
|
|
23658
23662
|
return node;
|
|
23659
23663
|
}
|
|
23660
23664
|
function cloneSourceFileWithChanges(source, statements, isDeclarationFile, referencedFiles, typeReferences, hasNoDefaultLib, libReferences) {
|
|
@@ -23787,7 +23791,7 @@ ${lanes.join("\n")}
|
|
|
23787
23791
|
const clone2 = createBaseIdentifier(node.escapedText);
|
|
23788
23792
|
clone2.flags |= node.flags & ~16 /* Synthesized */;
|
|
23789
23793
|
clone2.transformFlags = node.transformFlags;
|
|
23790
|
-
|
|
23794
|
+
setOriginal(clone2, node);
|
|
23791
23795
|
setIdentifierAutoGenerate(clone2, { ...node.emitNode.autoGenerate });
|
|
23792
23796
|
return clone2;
|
|
23793
23797
|
}
|
|
@@ -23798,7 +23802,7 @@ ${lanes.join("\n")}
|
|
|
23798
23802
|
clone2.flowNode = node.flowNode;
|
|
23799
23803
|
clone2.symbol = node.symbol;
|
|
23800
23804
|
clone2.transformFlags = node.transformFlags;
|
|
23801
|
-
|
|
23805
|
+
setOriginal(clone2, node);
|
|
23802
23806
|
const typeArguments = getIdentifierTypeArguments(node);
|
|
23803
23807
|
if (typeArguments)
|
|
23804
23808
|
setIdentifierTypeArguments(clone2, typeArguments);
|
|
@@ -23808,7 +23812,7 @@ ${lanes.join("\n")}
|
|
|
23808
23812
|
const clone2 = createBasePrivateIdentifier(node.escapedText);
|
|
23809
23813
|
clone2.flags |= node.flags & ~16 /* Synthesized */;
|
|
23810
23814
|
clone2.transformFlags = node.transformFlags;
|
|
23811
|
-
|
|
23815
|
+
setOriginal(clone2, node);
|
|
23812
23816
|
setIdentifierAutoGenerate(clone2, { ...node.emitNode.autoGenerate });
|
|
23813
23817
|
return clone2;
|
|
23814
23818
|
}
|
|
@@ -23816,7 +23820,7 @@ ${lanes.join("\n")}
|
|
|
23816
23820
|
const clone2 = createBasePrivateIdentifier(node.escapedText);
|
|
23817
23821
|
clone2.flags |= node.flags & ~16 /* Synthesized */;
|
|
23818
23822
|
clone2.transformFlags = node.transformFlags;
|
|
23819
|
-
|
|
23823
|
+
setOriginal(clone2, node);
|
|
23820
23824
|
return clone2;
|
|
23821
23825
|
}
|
|
23822
23826
|
function cloneNode(node) {
|
|
@@ -23841,7 +23845,7 @@ ${lanes.join("\n")}
|
|
|
23841
23845
|
const clone2 = !isNodeKind(node.kind) ? baseFactory2.createBaseTokenNode(node.kind) : baseFactory2.createBaseNode(node.kind);
|
|
23842
23846
|
clone2.flags |= node.flags & ~16 /* Synthesized */;
|
|
23843
23847
|
clone2.transformFlags = node.transformFlags;
|
|
23844
|
-
|
|
23848
|
+
setOriginal(clone2, node);
|
|
23845
23849
|
for (const key in node) {
|
|
23846
23850
|
if (hasProperty(clone2, key) || !hasProperty(node, key)) {
|
|
23847
23851
|
continue;
|
|
@@ -24366,7 +24370,7 @@ ${lanes.join("\n")}
|
|
|
24366
24370
|
return typeof value === "number" ? createToken(value) : value;
|
|
24367
24371
|
}
|
|
24368
24372
|
function asEmbeddedStatement(statement) {
|
|
24369
|
-
return statement && isNotEmittedStatement(statement) ? setTextRange(
|
|
24373
|
+
return statement && isNotEmittedStatement(statement) ? setTextRange(setOriginal(createEmptyStatement(), statement), statement) : statement;
|
|
24370
24374
|
}
|
|
24371
24375
|
function asVariableDeclaration(variableDeclaration) {
|
|
24372
24376
|
if (typeof variableDeclaration === "string" || variableDeclaration && !isVariableDeclaration(variableDeclaration)) {
|
|
@@ -24382,19 +24386,13 @@ ${lanes.join("\n")}
|
|
|
24382
24386
|
}
|
|
24383
24387
|
return variableDeclaration;
|
|
24384
24388
|
}
|
|
24385
|
-
|
|
24386
|
-
|
|
24387
|
-
|
|
24388
|
-
|
|
24389
|
-
|
|
24390
|
-
|
|
24391
|
-
}
|
|
24392
|
-
function updateWithOriginal(updated, original) {
|
|
24393
|
-
if (updated !== original) {
|
|
24394
|
-
setOriginalNode(updated, original);
|
|
24395
|
-
setTextRange(updated, original);
|
|
24389
|
+
function update(updated, original) {
|
|
24390
|
+
if (updated !== original) {
|
|
24391
|
+
setOriginal(updated, original);
|
|
24392
|
+
setTextRange(updated, original);
|
|
24393
|
+
}
|
|
24394
|
+
return updated;
|
|
24396
24395
|
}
|
|
24397
|
-
return updated;
|
|
24398
24396
|
}
|
|
24399
24397
|
function getDefaultTagNameForKind(kind) {
|
|
24400
24398
|
switch (kind) {
|
|
@@ -29388,8 +29386,10 @@ ${lanes.join("\n")}
|
|
|
29388
29386
|
setTextRangePosWidth(sourceFile, 0, sourceText.length);
|
|
29389
29387
|
setFields(sourceFile);
|
|
29390
29388
|
if (!isDeclarationFile && isExternalModule(sourceFile) && sourceFile.transformFlags & 67108864 /* ContainsPossibleTopLevelAwait */) {
|
|
29389
|
+
const oldSourceFile = sourceFile;
|
|
29391
29390
|
sourceFile = reparseTopLevelAwait(sourceFile);
|
|
29392
|
-
|
|
29391
|
+
if (oldSourceFile !== sourceFile)
|
|
29392
|
+
setFields(sourceFile);
|
|
29393
29393
|
}
|
|
29394
29394
|
return sourceFile;
|
|
29395
29395
|
function setFields(sourceFile2) {
|
|
@@ -56687,7 +56687,12 @@ ${lanes.join("\n")}
|
|
|
56687
56687
|
const checkType = type.checkType;
|
|
56688
56688
|
const constraint = getLowerBoundOfKeyType(checkType);
|
|
56689
56689
|
if (constraint !== checkType) {
|
|
56690
|
-
return getConditionalTypeInstantiation(
|
|
56690
|
+
return getConditionalTypeInstantiation(
|
|
56691
|
+
type,
|
|
56692
|
+
prependTypeMapping(type.root.checkType, constraint, type.mapper),
|
|
56693
|
+
/*forConstraint*/
|
|
56694
|
+
false
|
|
56695
|
+
);
|
|
56691
56696
|
}
|
|
56692
56697
|
}
|
|
56693
56698
|
return type;
|
|
@@ -57039,7 +57044,12 @@ ${lanes.join("\n")}
|
|
|
57039
57044
|
);
|
|
57040
57045
|
const constraint = simplified === type.checkType ? getConstraintOfType(simplified) : simplified;
|
|
57041
57046
|
if (constraint && constraint !== type.checkType) {
|
|
57042
|
-
const instantiated = getConditionalTypeInstantiation(
|
|
57047
|
+
const instantiated = getConditionalTypeInstantiation(
|
|
57048
|
+
type,
|
|
57049
|
+
prependTypeMapping(type.root.checkType, constraint, type.mapper),
|
|
57050
|
+
/*forConstraint*/
|
|
57051
|
+
true
|
|
57052
|
+
);
|
|
57043
57053
|
if (!(instantiated.flags & 131072 /* Never */)) {
|
|
57044
57054
|
type.resolvedConstraintOfDistributive = instantiated;
|
|
57045
57055
|
return instantiated;
|
|
@@ -59473,7 +59483,7 @@ ${lanes.join("\n")}
|
|
|
59473
59483
|
}
|
|
59474
59484
|
}
|
|
59475
59485
|
function removeStringLiteralsMatchedByTemplateLiterals(types) {
|
|
59476
|
-
const templates = filter(types, (t) => !!(t.flags & 134217728 /* TemplateLiteral */) && isPatternLiteralType(t)
|
|
59486
|
+
const templates = filter(types, (t) => !!(t.flags & 134217728 /* TemplateLiteral */) && isPatternLiteralType(t));
|
|
59477
59487
|
if (templates.length) {
|
|
59478
59488
|
let i = types.length;
|
|
59479
59489
|
while (i > 0) {
|
|
@@ -59873,19 +59883,14 @@ ${lanes.join("\n")}
|
|
|
59873
59883
|
function getConstituentCountOfTypes(types) {
|
|
59874
59884
|
return reduceLeft(types, (n, t) => n + getConstituentCount(t), 0);
|
|
59875
59885
|
}
|
|
59876
|
-
function areIntersectedTypesAvoidingPrimitiveReduction(types, primitiveFlags = 4 /* String */ | 8 /* Number */ | 64 /* BigInt */) {
|
|
59877
|
-
if (types.length !== 2) {
|
|
59878
|
-
return false;
|
|
59879
|
-
}
|
|
59880
|
-
const [t1, t2] = types;
|
|
59881
|
-
return !!(t1.flags & primitiveFlags) && t2 === emptyTypeLiteralType || !!(t2.flags & primitiveFlags) && t1 === emptyTypeLiteralType;
|
|
59882
|
-
}
|
|
59883
59886
|
function getTypeFromIntersectionTypeNode(node) {
|
|
59884
59887
|
const links = getNodeLinks(node);
|
|
59885
59888
|
if (!links.resolvedType) {
|
|
59886
59889
|
const aliasSymbol = getAliasSymbolForTypeNode(node);
|
|
59887
59890
|
const types = map(node.types, getTypeFromTypeNode);
|
|
59888
|
-
const
|
|
59891
|
+
const emptyIndex = types.length === 2 ? types.indexOf(emptyTypeLiteralType) : -1;
|
|
59892
|
+
const t = emptyIndex >= 0 ? types[1 - emptyIndex] : unknownType;
|
|
59893
|
+
const noSupertypeReduction = !!(t.flags & (4 /* String */ | 8 /* Number */ | 64 /* BigInt */) || t.flags & 134217728 /* TemplateLiteral */ && isPatternLiteralType(t));
|
|
59889
59894
|
links.resolvedType = getIntersectionType(types, aliasSymbol, getTypeArgumentsForAliasSymbol(aliasSymbol), noSupertypeReduction);
|
|
59890
59895
|
}
|
|
59891
59896
|
return links.resolvedType;
|
|
@@ -59912,19 +59917,17 @@ ${lanes.join("\n")}
|
|
|
59912
59917
|
return constraintType;
|
|
59913
59918
|
}
|
|
59914
59919
|
const keyTypes = [];
|
|
59915
|
-
if (
|
|
59916
|
-
if (
|
|
59917
|
-
const modifiersType = getApparentType(getModifiersTypeFromMappedType(type));
|
|
59918
|
-
forEachMappedTypePropertyKeyTypeAndIndexSignatureKeyType(modifiersType, 8576 /* StringOrNumberLiteralOrUnique */, !!(indexFlags & 1 /* StringsOnly */), addMemberForKeyType);
|
|
59919
|
-
} else {
|
|
59920
|
+
if (isGenericIndexType(constraintType)) {
|
|
59921
|
+
if (isMappedTypeWithKeyofConstraintDeclaration(type)) {
|
|
59920
59922
|
return getIndexTypeForGenericType(type, indexFlags);
|
|
59921
59923
|
}
|
|
59924
|
+
forEachType(constraintType, addMemberForKeyType);
|
|
59925
|
+
} else if (isMappedTypeWithKeyofConstraintDeclaration(type)) {
|
|
59926
|
+
const modifiersType = getApparentType(getModifiersTypeFromMappedType(type));
|
|
59927
|
+
forEachMappedTypePropertyKeyTypeAndIndexSignatureKeyType(modifiersType, 8576 /* StringOrNumberLiteralOrUnique */, !!(indexFlags & 1 /* StringsOnly */), addMemberForKeyType);
|
|
59922
59928
|
} else {
|
|
59923
59929
|
forEachType(getLowerBoundOfKeyType(constraintType), addMemberForKeyType);
|
|
59924
59930
|
}
|
|
59925
|
-
if (isGenericIndexType(constraintType)) {
|
|
59926
|
-
forEachType(constraintType, addMemberForKeyType);
|
|
59927
|
-
}
|
|
59928
59931
|
const result = indexFlags & 2 /* NoIndexSignatures */ ? filterType(getUnionType(keyTypes), (t) => !(t.flags & (1 /* Any */ | 4 /* String */))) : getUnionType(keyTypes);
|
|
59929
59932
|
if (result.flags & 1048576 /* Union */ && constraintType.flags & 1048576 /* Union */ && getTypeListId(result.types) === getTypeListId(constraintType.types)) {
|
|
59930
59933
|
return constraintType;
|
|
@@ -60097,11 +60100,6 @@ ${lanes.join("\n")}
|
|
|
60097
60100
|
}
|
|
60098
60101
|
function createTemplateLiteralType(texts, types) {
|
|
60099
60102
|
const type = createType(134217728 /* TemplateLiteral */);
|
|
60100
|
-
type.objectFlags = getPropagatingFlagsOfTypes(
|
|
60101
|
-
types,
|
|
60102
|
-
/*excludeKinds*/
|
|
60103
|
-
98304 /* Nullable */
|
|
60104
|
-
);
|
|
60105
60103
|
type.texts = texts;
|
|
60106
60104
|
type.types = types;
|
|
60107
60105
|
return type;
|
|
@@ -60396,7 +60394,15 @@ ${lanes.join("\n")}
|
|
|
60396
60394
|
}
|
|
60397
60395
|
function isPatternLiteralPlaceholderType(type) {
|
|
60398
60396
|
if (type.flags & 2097152 /* Intersection */) {
|
|
60399
|
-
|
|
60397
|
+
let seenPlaceholder = false;
|
|
60398
|
+
for (const t of type.types) {
|
|
60399
|
+
if (t.flags & (2944 /* Literal */ | 98304 /* Nullable */) || isPatternLiteralPlaceholderType(t)) {
|
|
60400
|
+
seenPlaceholder = true;
|
|
60401
|
+
} else if (!(t.flags & 524288 /* Object */)) {
|
|
60402
|
+
return false;
|
|
60403
|
+
}
|
|
60404
|
+
}
|
|
60405
|
+
return seenPlaceholder;
|
|
60400
60406
|
}
|
|
60401
60407
|
return !!(type.flags & (1 /* Any */ | 4 /* String */ | 8 /* Number */ | 64 /* BigInt */)) || isPatternLiteralType(type);
|
|
60402
60408
|
}
|
|
@@ -60413,7 +60419,7 @@ ${lanes.join("\n")}
|
|
|
60413
60419
|
return !!(getGenericObjectFlags(type) & 8388608 /* IsGenericIndexType */);
|
|
60414
60420
|
}
|
|
60415
60421
|
function getGenericObjectFlags(type) {
|
|
60416
|
-
if (type.flags &
|
|
60422
|
+
if (type.flags & 3145728 /* UnionOrIntersection */) {
|
|
60417
60423
|
if (!(type.objectFlags & 2097152 /* IsGenericTypeComputed */)) {
|
|
60418
60424
|
type.objectFlags |= 2097152 /* IsGenericTypeComputed */ | reduceLeft(type.types, (flags, t) => flags | getGenericObjectFlags(t), 0);
|
|
60419
60425
|
}
|
|
@@ -60425,7 +60431,7 @@ ${lanes.join("\n")}
|
|
|
60425
60431
|
}
|
|
60426
60432
|
return type.objectFlags & 12582912 /* IsGenericType */;
|
|
60427
60433
|
}
|
|
60428
|
-
return (type.flags & 58982400 /* InstantiableNonPrimitive */ || isGenericMappedType(type) || isGenericTupleType(type) ? 4194304 /* IsGenericObjectType */ : 0) | (type.flags & (58982400 /* InstantiableNonPrimitive */ | 4194304 /* Index */ | 268435456 /* StringMapping */) && !isPatternLiteralType(type) ? 8388608 /* IsGenericIndexType */ : 0);
|
|
60434
|
+
return (type.flags & 58982400 /* InstantiableNonPrimitive */ || isGenericMappedType(type) || isGenericTupleType(type) ? 4194304 /* IsGenericObjectType */ : 0) | (type.flags & (58982400 /* InstantiableNonPrimitive */ | 4194304 /* Index */ | 134217728 /* TemplateLiteral */ | 268435456 /* StringMapping */) && !isPatternLiteralType(type) ? 8388608 /* IsGenericIndexType */ : 0);
|
|
60429
60435
|
}
|
|
60430
60436
|
function getSimplifiedType(type, writing) {
|
|
60431
60437
|
return type.flags & 8388608 /* IndexedAccess */ ? getSimplifiedIndexedAccessType(type, writing) : type.flags & 16777216 /* Conditional */ ? getSimplifiedConditionalType(type, writing) : type;
|
|
@@ -60606,7 +60612,7 @@ ${lanes.join("\n")}
|
|
|
60606
60612
|
function isDeferredType(type, checkTuples) {
|
|
60607
60613
|
return isGenericType(type) || checkTuples && isTupleType(type) && some(getElementTypes(type), isGenericType);
|
|
60608
60614
|
}
|
|
60609
|
-
function getConditionalType(root, mapper, aliasSymbol, aliasTypeArguments) {
|
|
60615
|
+
function getConditionalType(root, mapper, forConstraint, aliasSymbol, aliasTypeArguments) {
|
|
60610
60616
|
let result;
|
|
60611
60617
|
let extraTypes;
|
|
60612
60618
|
let tailCount = 0;
|
|
@@ -60652,7 +60658,7 @@ ${lanes.join("\n")}
|
|
|
60652
60658
|
const inferredExtendsType = combinedMapper ? instantiateType(root.extendsType, combinedMapper) : extendsType;
|
|
60653
60659
|
if (!checkTypeDeferred && !isDeferredType(inferredExtendsType, checkTuples)) {
|
|
60654
60660
|
if (!(inferredExtendsType.flags & 3 /* AnyOrUnknown */) && (checkType.flags & 1 /* Any */ || !isTypeAssignableTo(getPermissiveInstantiation(checkType), getPermissiveInstantiation(inferredExtendsType)))) {
|
|
60655
|
-
if (checkType.flags & 1 /* Any */) {
|
|
60661
|
+
if (checkType.flags & 1 /* Any */ || forConstraint && !(inferredExtendsType.flags & 131072 /* Never */) && someType(getPermissiveInstantiation(inferredExtendsType), (t) => isTypeAssignableTo(t, getPermissiveInstantiation(checkType)))) {
|
|
60656
60662
|
(extraTypes || (extraTypes = [])).push(instantiateType(getTypeFromTypeNode(root.node.trueType), combinedMapper || mapper));
|
|
60657
60663
|
}
|
|
60658
60664
|
const falseType2 = getTypeFromTypeNode(root.node.falseType);
|
|
@@ -60762,7 +60768,9 @@ ${lanes.join("\n")}
|
|
|
60762
60768
|
links.resolvedType = getConditionalType(
|
|
60763
60769
|
root,
|
|
60764
60770
|
/*mapper*/
|
|
60765
|
-
void 0
|
|
60771
|
+
void 0,
|
|
60772
|
+
/*forConstraint*/
|
|
60773
|
+
false
|
|
60766
60774
|
);
|
|
60767
60775
|
if (outerTypeParameters) {
|
|
60768
60776
|
root.instantiations = /* @__PURE__ */ new Map();
|
|
@@ -61451,7 +61459,7 @@ ${lanes.join("\n")}
|
|
|
61451
61459
|
result = target.objectFlags & 4 /* Reference */ ? createDeferredTypeReference(type.target, type.node, newMapper, newAliasSymbol, newAliasTypeArguments) : target.objectFlags & 32 /* Mapped */ ? instantiateMappedType(target, newMapper, newAliasSymbol, newAliasTypeArguments) : instantiateAnonymousType(target, newMapper, newAliasSymbol, newAliasTypeArguments);
|
|
61452
61460
|
target.instantiations.set(id, result);
|
|
61453
61461
|
const resultObjectFlags = getObjectFlags(result);
|
|
61454
|
-
if (result.flags &
|
|
61462
|
+
if (result.flags & 3899393 /* ObjectFlagsType */ && !(resultObjectFlags & 524288 /* CouldContainTypeVariablesComputed */)) {
|
|
61455
61463
|
const resultCouldContainTypeVariables = some(typeArguments, couldContainTypeVariables);
|
|
61456
61464
|
if (!(getObjectFlags(result) & 524288 /* CouldContainTypeVariablesComputed */)) {
|
|
61457
61465
|
if (resultObjectFlags & (32 /* Mapped */ | 16 /* Anonymous */ | 4 /* Reference */)) {
|
|
@@ -61617,17 +61625,17 @@ ${lanes.join("\n")}
|
|
|
61617
61625
|
result.objectFlags |= result.aliasTypeArguments ? getPropagatingFlagsOfTypes(result.aliasTypeArguments) : 0;
|
|
61618
61626
|
return result;
|
|
61619
61627
|
}
|
|
61620
|
-
function getConditionalTypeInstantiation(type, mapper, aliasSymbol, aliasTypeArguments) {
|
|
61628
|
+
function getConditionalTypeInstantiation(type, mapper, forConstraint, aliasSymbol, aliasTypeArguments) {
|
|
61621
61629
|
const root = type.root;
|
|
61622
61630
|
if (root.outerTypeParameters) {
|
|
61623
61631
|
const typeArguments = map(root.outerTypeParameters, (t) => getMappedType(t, mapper));
|
|
61624
|
-
const id = getTypeListId(typeArguments) + getAliasId(aliasSymbol, aliasTypeArguments);
|
|
61632
|
+
const id = (forConstraint ? "C" : "") + getTypeListId(typeArguments) + getAliasId(aliasSymbol, aliasTypeArguments);
|
|
61625
61633
|
let result = root.instantiations.get(id);
|
|
61626
61634
|
if (!result) {
|
|
61627
61635
|
const newMapper = createTypeMapper(root.outerTypeParameters, typeArguments);
|
|
61628
61636
|
const checkType = root.checkType;
|
|
61629
61637
|
const distributionType = root.isDistributive ? getMappedType(checkType, newMapper) : void 0;
|
|
61630
|
-
result = distributionType && checkType !== distributionType && distributionType.flags & (1048576 /* Union */ | 131072 /* Never */) ? mapTypeWithAlias(getReducedType(distributionType), (t) => getConditionalType(root, prependTypeMapping(checkType, t, newMapper)), aliasSymbol, aliasTypeArguments) : getConditionalType(root, newMapper, aliasSymbol, aliasTypeArguments);
|
|
61638
|
+
result = distributionType && checkType !== distributionType && distributionType.flags & (1048576 /* Union */ | 131072 /* Never */) ? mapTypeWithAlias(getReducedType(distributionType), (t) => getConditionalType(root, prependTypeMapping(checkType, t, newMapper), forConstraint), aliasSymbol, aliasTypeArguments) : getConditionalType(root, newMapper, forConstraint, aliasSymbol, aliasTypeArguments);
|
|
61631
61639
|
root.instantiations.set(id, result);
|
|
61632
61640
|
}
|
|
61633
61641
|
return result;
|
|
@@ -61715,7 +61723,14 @@ ${lanes.join("\n")}
|
|
|
61715
61723
|
);
|
|
61716
61724
|
}
|
|
61717
61725
|
if (flags & 16777216 /* Conditional */) {
|
|
61718
|
-
return getConditionalTypeInstantiation(
|
|
61726
|
+
return getConditionalTypeInstantiation(
|
|
61727
|
+
type,
|
|
61728
|
+
combineTypeMappers(type.mapper, mapper),
|
|
61729
|
+
/*forConstraint*/
|
|
61730
|
+
false,
|
|
61731
|
+
aliasSymbol,
|
|
61732
|
+
aliasTypeArguments
|
|
61733
|
+
);
|
|
61719
61734
|
}
|
|
61720
61735
|
if (flags & 33554432 /* Substitution */) {
|
|
61721
61736
|
const newBaseType = instantiateType(type.baseType, mapper);
|
|
@@ -63359,7 +63374,7 @@ ${lanes.join("\n")}
|
|
|
63359
63374
|
return relation === comparableRelation ? someTypeRelatedToType(source2, target2, reportErrors2 && !(source2.flags & 402784252 /* Primitive */), intersectionState) : eachTypeRelatedToType(source2, target2, reportErrors2 && !(source2.flags & 402784252 /* Primitive */), intersectionState);
|
|
63360
63375
|
}
|
|
63361
63376
|
if (target2.flags & 1048576 /* Union */) {
|
|
63362
|
-
return typeRelatedToSomeType(getRegularTypeOfObjectLiteral(source2), target2, reportErrors2 && !(source2.flags & 402784252 /* Primitive */) && !(target2.flags & 402784252 /* Primitive */));
|
|
63377
|
+
return typeRelatedToSomeType(getRegularTypeOfObjectLiteral(source2), target2, reportErrors2 && !(source2.flags & 402784252 /* Primitive */) && !(target2.flags & 402784252 /* Primitive */), intersectionState);
|
|
63363
63378
|
}
|
|
63364
63379
|
if (target2.flags & 2097152 /* Intersection */) {
|
|
63365
63380
|
return typeRelatedToEachType(source2, target2, reportErrors2, 2 /* Target */);
|
|
@@ -63404,7 +63419,8 @@ ${lanes.join("\n")}
|
|
|
63404
63419
|
sourceType,
|
|
63405
63420
|
target2,
|
|
63406
63421
|
/*reportErrors*/
|
|
63407
|
-
false
|
|
63422
|
+
false,
|
|
63423
|
+
0 /* None */
|
|
63408
63424
|
);
|
|
63409
63425
|
if (!related) {
|
|
63410
63426
|
return 0 /* False */;
|
|
@@ -63413,7 +63429,7 @@ ${lanes.join("\n")}
|
|
|
63413
63429
|
}
|
|
63414
63430
|
return result2;
|
|
63415
63431
|
}
|
|
63416
|
-
function typeRelatedToSomeType(source2, target2, reportErrors2) {
|
|
63432
|
+
function typeRelatedToSomeType(source2, target2, reportErrors2, intersectionState) {
|
|
63417
63433
|
const targetTypes = target2.types;
|
|
63418
63434
|
if (target2.flags & 1048576 /* Union */) {
|
|
63419
63435
|
if (containsType(targetTypes, source2)) {
|
|
@@ -63431,7 +63447,10 @@ ${lanes.join("\n")}
|
|
|
63431
63447
|
match,
|
|
63432
63448
|
2 /* Target */,
|
|
63433
63449
|
/*reportErrors*/
|
|
63434
|
-
false
|
|
63450
|
+
false,
|
|
63451
|
+
/*headMessage*/
|
|
63452
|
+
void 0,
|
|
63453
|
+
intersectionState
|
|
63435
63454
|
);
|
|
63436
63455
|
if (related) {
|
|
63437
63456
|
return related;
|
|
@@ -63444,7 +63463,10 @@ ${lanes.join("\n")}
|
|
|
63444
63463
|
type,
|
|
63445
63464
|
2 /* Target */,
|
|
63446
63465
|
/*reportErrors*/
|
|
63447
|
-
false
|
|
63466
|
+
false,
|
|
63467
|
+
/*headMessage*/
|
|
63468
|
+
void 0,
|
|
63469
|
+
intersectionState
|
|
63448
63470
|
);
|
|
63449
63471
|
if (related) {
|
|
63450
63472
|
return related;
|
|
@@ -63458,7 +63480,10 @@ ${lanes.join("\n")}
|
|
|
63458
63480
|
bestMatchingType,
|
|
63459
63481
|
2 /* Target */,
|
|
63460
63482
|
/*reportErrors*/
|
|
63461
|
-
true
|
|
63483
|
+
true,
|
|
63484
|
+
/*headMessage*/
|
|
63485
|
+
void 0,
|
|
63486
|
+
intersectionState
|
|
63462
63487
|
);
|
|
63463
63488
|
}
|
|
63464
63489
|
}
|
|
@@ -64256,13 +64281,6 @@ ${lanes.join("\n")}
|
|
|
64256
64281
|
return result2;
|
|
64257
64282
|
}
|
|
64258
64283
|
}
|
|
64259
|
-
} else {
|
|
64260
|
-
const distributiveConstraint = hasNonCircularBaseConstraint(source2) ? getConstraintOfDistributiveConditionalType(source2) : void 0;
|
|
64261
|
-
if (distributiveConstraint) {
|
|
64262
|
-
if (result2 = isRelatedTo(distributiveConstraint, target2, 1 /* Source */, reportErrors2)) {
|
|
64263
|
-
return result2;
|
|
64264
|
-
}
|
|
64265
|
-
}
|
|
64266
64284
|
}
|
|
64267
64285
|
const defaultConstraint = getDefaultConstraintOfConditionalType(source2);
|
|
64268
64286
|
if (defaultConstraint) {
|
|
@@ -64270,6 +64288,13 @@ ${lanes.join("\n")}
|
|
|
64270
64288
|
return result2;
|
|
64271
64289
|
}
|
|
64272
64290
|
}
|
|
64291
|
+
const distributiveConstraint = !(targetFlags & 16777216 /* Conditional */) && hasNonCircularBaseConstraint(source2) ? getConstraintOfDistributiveConditionalType(source2) : void 0;
|
|
64292
|
+
if (distributiveConstraint) {
|
|
64293
|
+
resetErrorInfo(saveErrorInfo);
|
|
64294
|
+
if (result2 = isRelatedTo(distributiveConstraint, target2, 1 /* Source */, reportErrors2)) {
|
|
64295
|
+
return result2;
|
|
64296
|
+
}
|
|
64297
|
+
}
|
|
64273
64298
|
} else {
|
|
64274
64299
|
if (relation !== subtypeRelation && relation !== strictSubtypeRelation && isPartialMappedType(target2) && isEmptyObjectType(source2)) {
|
|
64275
64300
|
return -1 /* True */;
|
|
@@ -66167,8 +66192,8 @@ ${lanes.join("\n")}
|
|
|
66167
66192
|
if (objectFlags & 524288 /* CouldContainTypeVariablesComputed */) {
|
|
66168
66193
|
return !!(objectFlags & 1048576 /* CouldContainTypeVariables */);
|
|
66169
66194
|
}
|
|
66170
|
-
const result = !!(type.flags & 465829888 /* Instantiable */ || type.flags & 524288 /* Object */ && !isNonGenericTopLevelType(type) && (objectFlags & 4 /* Reference */ && (type.node || some(getTypeArguments(type), couldContainTypeVariables)) || objectFlags & 16 /* Anonymous */ && type.symbol && type.symbol.flags & (16 /* Function */ | 8192 /* Method */ | 32 /* Class */ | 2048 /* TypeLiteral */ | 4096 /* ObjectLiteral */) && type.symbol.declarations || objectFlags & (32 /* Mapped */ | 1024 /* ReverseMapped */ | 4194304 /* ObjectRestType */ | 8388608 /* InstantiationExpressionType */)) || type.flags &
|
|
66171
|
-
if (type.flags &
|
|
66195
|
+
const result = !!(type.flags & 465829888 /* Instantiable */ || type.flags & 524288 /* Object */ && !isNonGenericTopLevelType(type) && (objectFlags & 4 /* Reference */ && (type.node || some(getTypeArguments(type), couldContainTypeVariables)) || objectFlags & 16 /* Anonymous */ && type.symbol && type.symbol.flags & (16 /* Function */ | 8192 /* Method */ | 32 /* Class */ | 2048 /* TypeLiteral */ | 4096 /* ObjectLiteral */) && type.symbol.declarations || objectFlags & (32 /* Mapped */ | 1024 /* ReverseMapped */ | 4194304 /* ObjectRestType */ | 8388608 /* InstantiationExpressionType */)) || type.flags & 3145728 /* UnionOrIntersection */ && !(type.flags & 1024 /* EnumLiteral */) && !isNonGenericTopLevelType(type) && some(type.types, couldContainTypeVariables));
|
|
66196
|
+
if (type.flags & 3899393 /* ObjectFlagsType */) {
|
|
66172
66197
|
type.objectFlags |= 524288 /* CouldContainTypeVariablesComputed */ | (result ? 1048576 /* CouldContainTypeVariables */ : 0);
|
|
66173
66198
|
}
|
|
66174
66199
|
return result;
|
|
@@ -67295,7 +67320,8 @@ ${lanes.join("\n")}
|
|
|
67295
67320
|
if (hasOnlyExpressionInitializer(declaration) && isBlockScopedNameDeclaredBeforeUse(declaration, node)) {
|
|
67296
67321
|
const initializer = getEffectiveInitializer(declaration);
|
|
67297
67322
|
if (initializer) {
|
|
67298
|
-
|
|
67323
|
+
const initializerType = isBindingPattern(declaration.parent) ? getTypeForBindingElement(declaration) : getTypeOfExpression(initializer);
|
|
67324
|
+
return initializerType && tryGetNameFromType(initializerType);
|
|
67299
67325
|
}
|
|
67300
67326
|
if (isEnumMember(declaration)) {
|
|
67301
67327
|
return getTextOfPropertyName(declaration.name);
|
|
@@ -83141,10 +83167,11 @@ ${lanes.join("\n")}
|
|
|
83141
83167
|
node
|
|
83142
83168
|
));
|
|
83143
83169
|
if (sym) {
|
|
83170
|
+
const typeOnlyDeclaration = getTypeOnlyAliasDeclaration(sym, 111551 /* Value */);
|
|
83144
83171
|
markAliasReferenced(sym, id);
|
|
83145
83172
|
if (getSymbolFlags(sym) & 111551 /* Value */) {
|
|
83146
83173
|
checkExpressionCached(id);
|
|
83147
|
-
if (!isIllegalExportDefaultInCJS && !(node.flags & 33554432 /* Ambient */) && compilerOptions.verbatimModuleSyntax &&
|
|
83174
|
+
if (!isIllegalExportDefaultInCJS && !(node.flags & 33554432 /* Ambient */) && compilerOptions.verbatimModuleSyntax && typeOnlyDeclaration) {
|
|
83148
83175
|
error2(
|
|
83149
83176
|
id,
|
|
83150
83177
|
node.isExportEquals ? Diagnostics.An_export_declaration_must_reference_a_real_value_when_verbatimModuleSyntax_is_enabled_but_0_resolves_to_a_type_only_declaration : Diagnostics.An_export_default_must_reference_a_real_value_when_verbatimModuleSyntax_is_enabled_but_0_resolves_to_a_type_only_declaration,
|
|
@@ -83158,6 +83185,33 @@ ${lanes.join("\n")}
|
|
|
83158
83185
|
idText(id)
|
|
83159
83186
|
);
|
|
83160
83187
|
}
|
|
83188
|
+
if (!isIllegalExportDefaultInCJS && getIsolatedModules(compilerOptions) && !(sym.flags & 111551 /* Value */)) {
|
|
83189
|
+
if (sym.flags & 2097152 /* Alias */ && resolveAlias(sym) !== unknownSymbol && getSymbolFlags(
|
|
83190
|
+
sym,
|
|
83191
|
+
/*excludeTypeOnlyMeanings*/
|
|
83192
|
+
false,
|
|
83193
|
+
/*excludeLocalMeanings*/
|
|
83194
|
+
true
|
|
83195
|
+
) & 788968 /* Type */ && (!typeOnlyDeclaration || getSourceFileOfNode(typeOnlyDeclaration) !== getSourceFileOfNode(node))) {
|
|
83196
|
+
error2(
|
|
83197
|
+
id,
|
|
83198
|
+
node.isExportEquals ? Diagnostics._0_resolves_to_a_type_and_must_be_marked_type_only_in_this_file_before_re_exporting_when_1_is_enabled_Consider_using_import_type_where_0_is_imported : Diagnostics._0_resolves_to_a_type_and_must_be_marked_type_only_in_this_file_before_re_exporting_when_1_is_enabled_Consider_using_export_type_0_as_default,
|
|
83199
|
+
idText(id),
|
|
83200
|
+
isolatedModulesLikeFlagName
|
|
83201
|
+
);
|
|
83202
|
+
} else if (typeOnlyDeclaration && getSourceFileOfNode(typeOnlyDeclaration) !== getSourceFileOfNode(node)) {
|
|
83203
|
+
addTypeOnlyDeclarationRelatedInfo(
|
|
83204
|
+
error2(
|
|
83205
|
+
id,
|
|
83206
|
+
node.isExportEquals ? Diagnostics._0_resolves_to_a_type_only_declaration_and_must_be_marked_type_only_in_this_file_before_re_exporting_when_1_is_enabled_Consider_using_import_type_where_0_is_imported : Diagnostics._0_resolves_to_a_type_only_declaration_and_must_be_marked_type_only_in_this_file_before_re_exporting_when_1_is_enabled_Consider_using_export_type_0_as_default,
|
|
83207
|
+
idText(id),
|
|
83208
|
+
isolatedModulesLikeFlagName
|
|
83209
|
+
),
|
|
83210
|
+
typeOnlyDeclaration,
|
|
83211
|
+
idText(id)
|
|
83212
|
+
);
|
|
83213
|
+
}
|
|
83214
|
+
}
|
|
83161
83215
|
} else {
|
|
83162
83216
|
checkExpressionCached(id);
|
|
83163
83217
|
}
|
|
@@ -84552,7 +84606,11 @@ ${lanes.join("\n")}
|
|
|
84552
84606
|
const exportClause = node.exportClause;
|
|
84553
84607
|
return !!exportClause && (isNamespaceExport(exportClause) || some(exportClause.elements, isValueAliasDeclaration));
|
|
84554
84608
|
case 277 /* ExportAssignment */:
|
|
84555
|
-
return node.expression && node.expression.kind === 80 /* Identifier */ ? isAliasResolvedToValue(
|
|
84609
|
+
return node.expression && node.expression.kind === 80 /* Identifier */ ? isAliasResolvedToValue(
|
|
84610
|
+
getSymbolOfDeclaration(node),
|
|
84611
|
+
/*excludeTypeOnlyValues*/
|
|
84612
|
+
true
|
|
84613
|
+
) : true;
|
|
84556
84614
|
}
|
|
84557
84615
|
return false;
|
|
84558
84616
|
}
|
|
@@ -131437,8 +131495,11 @@ ${lanes.join("\n")}
|
|
|
131437
131495
|
function textSpansEqual(a, b) {
|
|
131438
131496
|
return !!a && !!b && a.start === b.start && a.length === b.length;
|
|
131439
131497
|
}
|
|
131440
|
-
function documentSpansEqual(a, b) {
|
|
131441
|
-
return a.fileName
|
|
131498
|
+
function documentSpansEqual(a, b, useCaseSensitiveFileNames2) {
|
|
131499
|
+
return (useCaseSensitiveFileNames2 ? equateStringsCaseSensitive : equateStringsCaseInsensitive)(a.fileName, b.fileName) && textSpansEqual(a.textSpan, b.textSpan);
|
|
131500
|
+
}
|
|
131501
|
+
function getDocumentSpansEqualityComparer(useCaseSensitiveFileNames2) {
|
|
131502
|
+
return (a, b) => documentSpansEqual(a, b, useCaseSensitiveFileNames2);
|
|
131442
131503
|
}
|
|
131443
131504
|
function forEachUnique(array, callback) {
|
|
131444
131505
|
if (array) {
|
|
@@ -159628,6 +159689,9 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
|
|
|
159628
159689
|
}
|
|
159629
159690
|
return void 0;
|
|
159630
159691
|
}
|
|
159692
|
+
function isInDifferentLineThanContextToken(contextToken2, position2) {
|
|
159693
|
+
return sourceFile.getLineEndOfPosition(contextToken2.getEnd()) < position2;
|
|
159694
|
+
}
|
|
159631
159695
|
function isSolelyIdentifierDefinitionLocation(contextToken2) {
|
|
159632
159696
|
const parent2 = contextToken2.parent;
|
|
159633
159697
|
const containingNodeKind = parent2.kind;
|
|
@@ -159669,11 +159733,19 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
|
|
|
159669
159733
|
case 139 /* GetKeyword */:
|
|
159670
159734
|
case 153 /* SetKeyword */:
|
|
159671
159735
|
return !isFromObjectTypeDeclaration(contextToken2);
|
|
159672
|
-
case 80 /* Identifier */:
|
|
159736
|
+
case 80 /* Identifier */: {
|
|
159673
159737
|
if (containingNodeKind === 276 /* ImportSpecifier */ && contextToken2 === parent2.name && contextToken2.text === "type") {
|
|
159674
159738
|
return false;
|
|
159675
159739
|
}
|
|
159740
|
+
const ancestorVariableDeclaration = findAncestor(
|
|
159741
|
+
contextToken2.parent,
|
|
159742
|
+
isVariableDeclaration
|
|
159743
|
+
);
|
|
159744
|
+
if (ancestorVariableDeclaration && isInDifferentLineThanContextToken(contextToken2, position)) {
|
|
159745
|
+
return false;
|
|
159746
|
+
}
|
|
159676
159747
|
break;
|
|
159748
|
+
}
|
|
159677
159749
|
case 86 /* ClassKeyword */:
|
|
159678
159750
|
case 94 /* EnumKeyword */:
|
|
159679
159751
|
case 120 /* InterfaceKeyword */:
|
|
@@ -180060,10 +180132,10 @@ ${json}${newLine}`;
|
|
|
180060
180132
|
}
|
|
180061
180133
|
return deduplicate(outputs, equateValues);
|
|
180062
180134
|
}
|
|
180063
|
-
function createDocumentSpanSet() {
|
|
180064
|
-
return createSet(({ textSpan }) => textSpan.start + 100003 * textSpan.length,
|
|
180135
|
+
function createDocumentSpanSet(useCaseSensitiveFileNames2) {
|
|
180136
|
+
return createSet(({ textSpan }) => textSpan.start + 100003 * textSpan.length, getDocumentSpansEqualityComparer(useCaseSensitiveFileNames2));
|
|
180065
180137
|
}
|
|
180066
|
-
function getRenameLocationsWorker(projects, defaultProject, initialLocation, findInStrings, findInComments, preferences) {
|
|
180138
|
+
function getRenameLocationsWorker(projects, defaultProject, initialLocation, findInStrings, findInComments, preferences, useCaseSensitiveFileNames2) {
|
|
180067
180139
|
const perProjectResults = getPerProjectReferences(
|
|
180068
180140
|
projects,
|
|
180069
180141
|
defaultProject,
|
|
@@ -180077,7 +180149,7 @@ ${json}${newLine}`;
|
|
|
180077
180149
|
return perProjectResults;
|
|
180078
180150
|
}
|
|
180079
180151
|
const results = [];
|
|
180080
|
-
const seen = createDocumentSpanSet();
|
|
180152
|
+
const seen = createDocumentSpanSet(useCaseSensitiveFileNames2);
|
|
180081
180153
|
perProjectResults.forEach((projectResults, project) => {
|
|
180082
180154
|
for (const result of projectResults) {
|
|
180083
180155
|
if (!seen.has(result) && !getMappedLocationForProject(documentSpanLocation(result), project)) {
|
|
@@ -180100,7 +180172,7 @@ ${json}${newLine}`;
|
|
|
180100
180172
|
const info = infos && firstOrUndefined(infos);
|
|
180101
180173
|
return info && !info.isLocal ? { fileName: info.fileName, pos: info.textSpan.start } : void 0;
|
|
180102
180174
|
}
|
|
180103
|
-
function getReferencesWorker(projects, defaultProject, initialLocation, logger) {
|
|
180175
|
+
function getReferencesWorker(projects, defaultProject, initialLocation, useCaseSensitiveFileNames2, logger) {
|
|
180104
180176
|
var _a, _b;
|
|
180105
180177
|
const perProjectResults = getPerProjectReferences(
|
|
180106
180178
|
projects,
|
|
@@ -180132,7 +180204,7 @@ ${json}${newLine}`;
|
|
|
180132
180204
|
}
|
|
180133
180205
|
});
|
|
180134
180206
|
} else {
|
|
180135
|
-
const knownSymbolSpans = createDocumentSpanSet();
|
|
180207
|
+
const knownSymbolSpans = createDocumentSpanSet(useCaseSensitiveFileNames2);
|
|
180136
180208
|
for (const referencedSymbol of defaultProjectResults) {
|
|
180137
180209
|
for (const ref of referencedSymbol.references) {
|
|
180138
180210
|
if (ref.isDefinition) {
|
|
@@ -180167,7 +180239,7 @@ ${json}${newLine}`;
|
|
|
180167
180239
|
});
|
|
180168
180240
|
}
|
|
180169
180241
|
const results = [];
|
|
180170
|
-
const seenRefs = createDocumentSpanSet();
|
|
180242
|
+
const seenRefs = createDocumentSpanSet(useCaseSensitiveFileNames2);
|
|
180171
180243
|
perProjectResults.forEach((projectResults, project) => {
|
|
180172
180244
|
for (const referencedSymbol of projectResults) {
|
|
180173
180245
|
const mappedDefinitionFile = getMappedLocationForProject(documentSpanLocation(referencedSymbol.definition), project);
|
|
@@ -180178,7 +180250,7 @@ ${json}${newLine}`;
|
|
|
180178
180250
|
fileName: mappedDefinitionFile.fileName,
|
|
180179
180251
|
contextSpan: getMappedContextSpanForProject(referencedSymbol.definition, project)
|
|
180180
180252
|
};
|
|
180181
|
-
let symbolToAddTo = find(results, (o) => documentSpansEqual(o.definition, definition));
|
|
180253
|
+
let symbolToAddTo = find(results, (o) => documentSpansEqual(o.definition, definition, useCaseSensitiveFileNames2));
|
|
180182
180254
|
if (!symbolToAddTo) {
|
|
180183
180255
|
symbolToAddTo = { definition, references: [] };
|
|
180184
180256
|
results.push(symbolToAddTo);
|
|
@@ -181709,7 +181781,10 @@ Project '${project.projectName}' (${ProjectKind[project.projectKind]}) ${counter
|
|
|
181709
181781
|
let definitions = this.mapDefinitionInfoLocations(unmappedDefinitions || emptyArray2, project).slice();
|
|
181710
181782
|
const needsJsResolution = this.projectService.serverMode === 0 /* Semantic */ && (!some(definitions, (d) => toNormalizedPath(d.fileName) !== file && !d.isAmbient) || some(definitions, (d) => !!d.failedAliasResolution));
|
|
181711
181783
|
if (needsJsResolution) {
|
|
181712
|
-
const definitionSet = createSet(
|
|
181784
|
+
const definitionSet = createSet(
|
|
181785
|
+
(d) => d.textSpan.start,
|
|
181786
|
+
getDocumentSpansEqualityComparer(this.host.useCaseSensitiveFileNames)
|
|
181787
|
+
);
|
|
181713
181788
|
definitions == null ? void 0 : definitions.forEach((d) => definitionSet.add(d));
|
|
181714
181789
|
const noDtsProject = project.getNoDtsResolutionProject(file);
|
|
181715
181790
|
const ls = noDtsProject.getLanguageService();
|
|
@@ -182150,7 +182225,8 @@ Project '${project.projectName}' (${ProjectKind[project.projectKind]}) ${counter
|
|
|
182150
182225
|
{ fileName: args.file, pos: position },
|
|
182151
182226
|
!!args.findInStrings,
|
|
182152
182227
|
!!args.findInComments,
|
|
182153
|
-
preferences
|
|
182228
|
+
preferences,
|
|
182229
|
+
this.host.useCaseSensitiveFileNames
|
|
182154
182230
|
);
|
|
182155
182231
|
if (!simplifiedResult)
|
|
182156
182232
|
return locations;
|
|
@@ -182185,6 +182261,7 @@ Project '${project.projectName}' (${ProjectKind[project.projectKind]}) ${counter
|
|
|
182185
182261
|
projects,
|
|
182186
182262
|
this.getDefaultProject(args),
|
|
182187
182263
|
{ fileName: args.file, pos: position },
|
|
182264
|
+
this.host.useCaseSensitiveFileNames,
|
|
182188
182265
|
this.logger
|
|
182189
182266
|
);
|
|
182190
182267
|
if (!simplifiedResult)
|
|
@@ -182207,7 +182284,7 @@ Project '${project.projectName}' (${ProjectKind[project.projectKind]}) ${counter
|
|
|
182207
182284
|
const fileName = args.file;
|
|
182208
182285
|
const preferences = this.getPreferences(toNormalizedPath(fileName));
|
|
182209
182286
|
const references = [];
|
|
182210
|
-
const seen = createDocumentSpanSet();
|
|
182287
|
+
const seen = createDocumentSpanSet(this.host.useCaseSensitiveFileNames);
|
|
182211
182288
|
forEachProjectInProjects(
|
|
182212
182289
|
projects,
|
|
182213
182290
|
/*path*/
|
|
@@ -185036,6 +185113,7 @@ ${e.message}`;
|
|
|
185036
185113
|
getDirectoryToWatchFailedLookupLocation: () => getDirectoryToWatchFailedLookupLocation,
|
|
185037
185114
|
getDirectoryToWatchFailedLookupLocationFromTypeRoot: () => getDirectoryToWatchFailedLookupLocationFromTypeRoot,
|
|
185038
185115
|
getDocumentPositionMapper: () => getDocumentPositionMapper,
|
|
185116
|
+
getDocumentSpansEqualityComparer: () => getDocumentSpansEqualityComparer,
|
|
185039
185117
|
getESModuleInterop: () => getESModuleInterop,
|
|
185040
185118
|
getEditsForFileRename: () => getEditsForFileRename,
|
|
185041
185119
|
getEffectiveBaseTypeNode: () => getEffectiveBaseTypeNode,
|
|
@@ -187447,6 +187525,7 @@ ${e.message}`;
|
|
|
187447
187525
|
getDirectoryToWatchFailedLookupLocation: () => getDirectoryToWatchFailedLookupLocation,
|
|
187448
187526
|
getDirectoryToWatchFailedLookupLocationFromTypeRoot: () => getDirectoryToWatchFailedLookupLocationFromTypeRoot,
|
|
187449
187527
|
getDocumentPositionMapper: () => getDocumentPositionMapper,
|
|
187528
|
+
getDocumentSpansEqualityComparer: () => getDocumentSpansEqualityComparer,
|
|
187450
187529
|
getESModuleInterop: () => getESModuleInterop,
|
|
187451
187530
|
getEditsForFileRename: () => getEditsForFileRename,
|
|
187452
187531
|
getEffectiveBaseTypeNode: () => getEffectiveBaseTypeNode,
|