@typescript-deploys/pr-build 5.6.0-pr-59217-23 → 5.6.0-pr-59421-2
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 +58 -37
- package/lib/typescript.d.ts +8 -0
- package/lib/typescript.js +186 -117
- package/package.json +7 -7
package/lib/tsc.js
CHANGED
|
@@ -18,7 +18,7 @@ and limitations under the License.
|
|
|
18
18
|
|
|
19
19
|
// src/compiler/corePublic.ts
|
|
20
20
|
var versionMajorMinor = "5.6";
|
|
21
|
-
var version = `${versionMajorMinor}.0-insiders.
|
|
21
|
+
var version = `${versionMajorMinor}.0-insiders.20240725`;
|
|
22
22
|
|
|
23
23
|
// src/compiler/core.ts
|
|
24
24
|
var emptyArray = [];
|
|
@@ -463,7 +463,7 @@ function insertSorted(array, insert, compare, equalityComparer, allowDuplicates)
|
|
|
463
463
|
return false;
|
|
464
464
|
}
|
|
465
465
|
function sortAndDeduplicate(array, comparer, equalityComparer) {
|
|
466
|
-
return deduplicateSorted(
|
|
466
|
+
return deduplicateSorted(toSorted(array, comparer), equalityComparer ?? comparer ?? compareStringsCaseSensitive);
|
|
467
467
|
}
|
|
468
468
|
function arrayIsEqualTo(array1, array2, equalityComparer = equateValues) {
|
|
469
469
|
if (array1 === void 0 || array2 === void 0) {
|
|
@@ -560,13 +560,8 @@ function appendIfUnique(array, toAdd, equalityComparer) {
|
|
|
560
560
|
function stableSortIndices(array, indices, comparer) {
|
|
561
561
|
indices.sort((x, y) => comparer(array[x], array[y]) || compareValues(x, y));
|
|
562
562
|
}
|
|
563
|
-
function
|
|
564
|
-
return array.length === 0 ?
|
|
565
|
-
}
|
|
566
|
-
function stableSort(array, comparer) {
|
|
567
|
-
const indices = indicesOf(array);
|
|
568
|
-
stableSortIndices(array, indices, comparer);
|
|
569
|
-
return indices.map((i) => array[i]);
|
|
563
|
+
function toSorted(array, comparer) {
|
|
564
|
+
return array.length === 0 ? emptyArray : array.slice().sort(comparer);
|
|
570
565
|
}
|
|
571
566
|
function rangeEquals(array1, array2, pos, end) {
|
|
572
567
|
while (pos < end) {
|
|
@@ -1484,7 +1479,7 @@ Node ${formatSyntaxKind(node.kind)} was unexpected.`,
|
|
|
1484
1479
|
result.push([value, name]);
|
|
1485
1480
|
}
|
|
1486
1481
|
}
|
|
1487
|
-
const sorted =
|
|
1482
|
+
const sorted = toSorted(result, (x, y) => compareValues(x[0], y[0]));
|
|
1488
1483
|
enumMemberCache.set(enumObject, sorted);
|
|
1489
1484
|
return sorted;
|
|
1490
1485
|
}
|
|
@@ -4969,7 +4964,7 @@ var sys = (() => {
|
|
|
4969
4964
|
setTimeout,
|
|
4970
4965
|
clearTimeout,
|
|
4971
4966
|
clearScreen: () => {
|
|
4972
|
-
process.stdout.write("\
|
|
4967
|
+
process.stdout.write("\x1B[2J\x1B[3J\x1B[H");
|
|
4973
4968
|
},
|
|
4974
4969
|
setBlocking: () => {
|
|
4975
4970
|
var _a;
|
|
@@ -6125,6 +6120,18 @@ var Diagnostics = {
|
|
|
6125
6120
|
Decimal_escape_sequences_and_backreferences_are_not_allowed_in_a_character_class: diag(1537, 1 /* Error */, "Decimal_escape_sequences_and_backreferences_are_not_allowed_in_a_character_class_1537", "Decimal escape sequences and backreferences are not allowed in a character class."),
|
|
6126
6121
|
Unicode_escape_sequences_are_only_available_when_the_Unicode_u_flag_or_the_Unicode_Sets_v_flag_is_set: diag(1538, 1 /* Error */, "Unicode_escape_sequences_are_only_available_when_the_Unicode_u_flag_or_the_Unicode_Sets_v_flag_is_se_1538", "Unicode escape sequences are only available when the Unicode (u) flag or the Unicode Sets (v) flag is set."),
|
|
6127
6122
|
A_bigint_literal_cannot_be_used_as_a_property_name: diag(1539, 1 /* Error */, "A_bigint_literal_cannot_be_used_as_a_property_name_1539", "A 'bigint' literal cannot be used as a property name."),
|
|
6123
|
+
A_namespace_declaration_should_not_be_declared_using_the_module_keyword_Please_use_the_namespace_keyword_instead: diag(
|
|
6124
|
+
1540,
|
|
6125
|
+
2 /* Suggestion */,
|
|
6126
|
+
"A_namespace_declaration_should_not_be_declared_using_the_module_keyword_Please_use_the_namespace_key_1540",
|
|
6127
|
+
"A 'namespace' declaration should not be declared using the 'module' keyword. Please use the 'namespace' keyword instead.",
|
|
6128
|
+
/*reportsUnnecessary*/
|
|
6129
|
+
void 0,
|
|
6130
|
+
/*elidedInCompatabilityPyramid*/
|
|
6131
|
+
void 0,
|
|
6132
|
+
/*reportsDeprecated*/
|
|
6133
|
+
true
|
|
6134
|
+
),
|
|
6128
6135
|
The_types_of_0_are_incompatible_between_these_types: diag(2200, 1 /* Error */, "The_types_of_0_are_incompatible_between_these_types_2200", "The types of '{0}' are incompatible between these types."),
|
|
6129
6136
|
The_types_returned_by_0_are_incompatible_between_these_types: diag(2201, 1 /* Error */, "The_types_returned_by_0_are_incompatible_between_these_types_2201", "The types returned by '{0}' are incompatible between these types."),
|
|
6130
6137
|
Call_signature_return_types_0_and_1_are_incompatible: diag(
|
|
@@ -12820,6 +12827,13 @@ function getTokenPosOfNode(node, sourceFile, includeJsDoc) {
|
|
|
12820
12827
|
isInJSDoc(node)
|
|
12821
12828
|
);
|
|
12822
12829
|
}
|
|
12830
|
+
function getNonModifierTokenPosOfNode(node, sourceFile) {
|
|
12831
|
+
const lastModifier = !nodeIsMissing(node) && canHaveModifiers(node) && node.modifiers ? last(node.modifiers) : void 0;
|
|
12832
|
+
if (!lastModifier) {
|
|
12833
|
+
return getTokenPosOfNode(node, sourceFile);
|
|
12834
|
+
}
|
|
12835
|
+
return skipTrivia((sourceFile || getSourceFileOfNode(node)).text, lastModifier.end);
|
|
12836
|
+
}
|
|
12823
12837
|
function getSourceTextOfNodeFromSourceFile(sourceFile, node, includeTrivia = false) {
|
|
12824
12838
|
return getTextOfNodeFromSourceText(sourceFile.text, node, includeTrivia);
|
|
12825
12839
|
}
|
|
@@ -18120,7 +18134,7 @@ function matchFiles(path, extensions, excludes, includes, useCaseSensitiveFileNa
|
|
|
18120
18134
|
if (visited.has(canonicalPath)) return;
|
|
18121
18135
|
visited.set(canonicalPath, true);
|
|
18122
18136
|
const { files, directories } = getFileSystemEntries(path2);
|
|
18123
|
-
for (const current of
|
|
18137
|
+
for (const current of toSorted(files, compareStringsCaseSensitive)) {
|
|
18124
18138
|
const name = combinePaths(path2, current);
|
|
18125
18139
|
const absoluteName = combinePaths(absolutePath, current);
|
|
18126
18140
|
if (extensions && !fileExtensionIsOneOf(name, extensions)) continue;
|
|
@@ -18140,7 +18154,7 @@ function matchFiles(path, extensions, excludes, includes, useCaseSensitiveFileNa
|
|
|
18140
18154
|
return;
|
|
18141
18155
|
}
|
|
18142
18156
|
}
|
|
18143
|
-
for (const current of
|
|
18157
|
+
for (const current of toSorted(directories, compareStringsCaseSensitive)) {
|
|
18144
18158
|
const name = combinePaths(path2, current);
|
|
18145
18159
|
const absoluteName = combinePaths(absolutePath, current);
|
|
18146
18160
|
if ((!includeDirectoryRegex || includeDirectoryRegex.test(absoluteName)) && (!excludeRegex || !excludeRegex.test(absoluteName))) {
|
|
@@ -40567,7 +40581,7 @@ function loadModuleFromImportsOrExports(extensions, state, cache, redirectedRefe
|
|
|
40567
40581
|
moduleName
|
|
40568
40582
|
);
|
|
40569
40583
|
}
|
|
40570
|
-
const expandingKeys =
|
|
40584
|
+
const expandingKeys = toSorted(filter(getOwnKeys(lookupTable), (k) => hasOneAsterisk(k) || endsWith(k, "/")), comparePatternKeys);
|
|
40571
40585
|
for (const potentialTarget of expandingKeys) {
|
|
40572
40586
|
if (state.features & 16 /* ExportsPatternTrailers */ && matchesPatternWithTrailer(potentialTarget, moduleName)) {
|
|
40573
40587
|
const target = lookupTable[potentialTarget];
|
|
@@ -77808,6 +77822,7 @@ function createTypeChecker(host) {
|
|
|
77808
77822
|
}
|
|
77809
77823
|
}
|
|
77810
77824
|
function getSyntacticNullishnessSemantics(node) {
|
|
77825
|
+
node = skipOuterExpressions(node);
|
|
77811
77826
|
switch (node.kind) {
|
|
77812
77827
|
case 223 /* AwaitExpression */:
|
|
77813
77828
|
case 213 /* CallExpression */:
|
|
@@ -77828,10 +77843,6 @@ function createTypeChecker(host) {
|
|
|
77828
77843
|
return 3 /* Sometimes */;
|
|
77829
77844
|
}
|
|
77830
77845
|
return 2 /* Never */;
|
|
77831
|
-
case 216 /* TypeAssertionExpression */:
|
|
77832
|
-
case 234 /* AsExpression */:
|
|
77833
|
-
case 217 /* ParenthesizedExpression */:
|
|
77834
|
-
return getSyntacticNullishnessSemantics(node.expression);
|
|
77835
77846
|
case 227 /* ConditionalExpression */:
|
|
77836
77847
|
return getSyntacticNullishnessSemantics(node.whenTrue) | getSyntacticNullishnessSemantics(node.whenFalse);
|
|
77837
77848
|
case 106 /* NullKeyword */:
|
|
@@ -81468,6 +81479,7 @@ function createTypeChecker(host) {
|
|
|
81468
81479
|
return type;
|
|
81469
81480
|
}
|
|
81470
81481
|
function getSyntacticTruthySemantics(node) {
|
|
81482
|
+
node = skipOuterExpressions(node);
|
|
81471
81483
|
switch (node.kind) {
|
|
81472
81484
|
case 9 /* NumericLiteral */:
|
|
81473
81485
|
if (node.text === "0" || node.text === "1") {
|
|
@@ -81490,10 +81502,6 @@ function createTypeChecker(host) {
|
|
|
81490
81502
|
case 15 /* NoSubstitutionTemplateLiteral */:
|
|
81491
81503
|
case 11 /* StringLiteral */:
|
|
81492
81504
|
return !!node.text ? 1 /* Always */ : 2 /* Never */;
|
|
81493
|
-
case 216 /* TypeAssertionExpression */:
|
|
81494
|
-
case 234 /* AsExpression */:
|
|
81495
|
-
case 217 /* ParenthesizedExpression */:
|
|
81496
|
-
return getSyntacticTruthySemantics(node.expression);
|
|
81497
81505
|
case 227 /* ConditionalExpression */:
|
|
81498
81506
|
return getSyntacticTruthySemantics(node.whenTrue) | getSyntacticTruthySemantics(node.whenFalse);
|
|
81499
81507
|
case 80 /* Identifier */:
|
|
@@ -83487,6 +83495,14 @@ function createTypeChecker(host) {
|
|
|
83487
83495
|
}
|
|
83488
83496
|
if (isIdentifier(node.name)) {
|
|
83489
83497
|
checkCollisionsForDeclarationName(node, node.name);
|
|
83498
|
+
if (!(node.flags & (32 /* Namespace */ | 2048 /* GlobalAugmentation */))) {
|
|
83499
|
+
const sourceFile = getSourceFileOfNode(node);
|
|
83500
|
+
const pos = getNonModifierTokenPosOfNode(node);
|
|
83501
|
+
const span = getSpanOfTokenAtPosition(sourceFile, pos);
|
|
83502
|
+
suggestionDiagnostics.add(
|
|
83503
|
+
createFileDiagnostic(sourceFile, span.start, span.length, Diagnostics.A_namespace_declaration_should_not_be_declared_using_the_module_keyword_Please_use_the_namespace_keyword_instead)
|
|
83504
|
+
);
|
|
83505
|
+
}
|
|
83490
83506
|
}
|
|
83491
83507
|
checkExportsOnMergedDeclarations(node);
|
|
83492
83508
|
const symbol = getSymbolOfDeclaration(node);
|
|
@@ -85660,11 +85676,14 @@ function createTypeChecker(host) {
|
|
|
85660
85676
|
}
|
|
85661
85677
|
function checkSingleIdentifier(node2) {
|
|
85662
85678
|
const nodeLinks2 = getNodeLinks(node2);
|
|
85663
|
-
nodeLinks2.calculatedFlags |= 536870912 /* ConstructorReference
|
|
85664
|
-
if (isIdentifier(node2)
|
|
85665
|
-
|
|
85666
|
-
if (
|
|
85667
|
-
|
|
85679
|
+
nodeLinks2.calculatedFlags |= 536870912 /* ConstructorReference */;
|
|
85680
|
+
if (isIdentifier(node2)) {
|
|
85681
|
+
nodeLinks2.calculatedFlags |= 32768 /* BlockScopedBindingInLoop */ | 16384 /* CapturedBlockScopedBinding */;
|
|
85682
|
+
if (isExpressionNodeOrShorthandPropertyAssignmentName(node2) && !(isPropertyAccessExpression(node2.parent) && node2.parent.name === node2)) {
|
|
85683
|
+
const s = getResolvedSymbol(node2);
|
|
85684
|
+
if (s && s !== unknownSymbol) {
|
|
85685
|
+
checkIdentifierCalculateNodeCheckFlags(node2, s);
|
|
85686
|
+
}
|
|
85668
85687
|
}
|
|
85669
85688
|
}
|
|
85670
85689
|
}
|
|
@@ -89958,7 +89977,7 @@ function collectExternalModuleInfo(context, sourceFile) {
|
|
|
89958
89977
|
}
|
|
89959
89978
|
}
|
|
89960
89979
|
function addExportedFunctionDeclaration(node, name, isDefault) {
|
|
89961
|
-
exportedFunctions.add(node);
|
|
89980
|
+
exportedFunctions.add(getOriginalNode(node, isFunctionDeclaration));
|
|
89962
89981
|
if (isDefault) {
|
|
89963
89982
|
if (!hasExportDefault) {
|
|
89964
89983
|
multiMapSparseArrayAdd(exportedBindings, getOriginalNodeId(node), name ?? context.factory.getDeclarationName(node));
|
|
@@ -94361,6 +94380,7 @@ function transformClassFields(context) {
|
|
|
94361
94380
|
addRange(statementsOut, visitNodes2(statementsIn, visitor, isStatement, statementOffset));
|
|
94362
94381
|
}
|
|
94363
94382
|
function transformConstructorBody(node, constructor, isDerivedClass) {
|
|
94383
|
+
var _a;
|
|
94364
94384
|
const instanceProperties = getProperties(
|
|
94365
94385
|
node,
|
|
94366
94386
|
/*requireInitializer*/
|
|
@@ -94454,12 +94474,12 @@ function transformClassFields(context) {
|
|
|
94454
94474
|
setTextRange(
|
|
94455
94475
|
factory2.createNodeArray(statements),
|
|
94456
94476
|
/*location*/
|
|
94457
|
-
constructor ? constructor.body.statements
|
|
94477
|
+
((_a = constructor == null ? void 0 : constructor.body) == null ? void 0 : _a.statements) ?? node.members
|
|
94458
94478
|
),
|
|
94459
94479
|
multiLine
|
|
94460
94480
|
),
|
|
94461
94481
|
/*location*/
|
|
94462
|
-
constructor
|
|
94482
|
+
constructor == null ? void 0 : constructor.body
|
|
94463
94483
|
);
|
|
94464
94484
|
}
|
|
94465
94485
|
function addPropertyOrClassStaticBlockStatements(statements, properties, receiver) {
|
|
@@ -107893,7 +107913,7 @@ function transformModule(context) {
|
|
|
107893
107913
|
return factory2.updateLabeledStatement(
|
|
107894
107914
|
node,
|
|
107895
107915
|
node.label,
|
|
107896
|
-
|
|
107916
|
+
visitNode(node.statement, topLevelNestedVisitor, isStatement, factory2.liftToBlock) ?? factory2.createExpressionStatement(factory2.createIdentifier(""))
|
|
107897
107917
|
);
|
|
107898
107918
|
}
|
|
107899
107919
|
function visitWithStatement(node) {
|
|
@@ -107907,7 +107927,7 @@ function transformModule(context) {
|
|
|
107907
107927
|
return factory2.updateIfStatement(
|
|
107908
107928
|
node,
|
|
107909
107929
|
visitNode(node.expression, visitor, isExpression),
|
|
107910
|
-
|
|
107930
|
+
visitNode(node.thenStatement, topLevelNestedVisitor, isStatement, factory2.liftToBlock) ?? factory2.createBlock([]),
|
|
107911
107931
|
visitNode(node.elseStatement, topLevelNestedVisitor, isStatement, factory2.liftToBlock)
|
|
107912
107932
|
);
|
|
107913
107933
|
}
|
|
@@ -110010,7 +110030,7 @@ function transformSystemModule(context) {
|
|
|
110010
110030
|
return factory2.updateLabeledStatement(
|
|
110011
110031
|
node,
|
|
110012
110032
|
node.label,
|
|
110013
|
-
|
|
110033
|
+
visitNode(node.statement, topLevelNestedVisitor, isStatement, factory2.liftToBlock) ?? factory2.createExpressionStatement(factory2.createIdentifier(""))
|
|
110014
110034
|
);
|
|
110015
110035
|
}
|
|
110016
110036
|
function visitWithStatement(node) {
|
|
@@ -110024,7 +110044,7 @@ function transformSystemModule(context) {
|
|
|
110024
110044
|
return factory2.updateIfStatement(
|
|
110025
110045
|
node,
|
|
110026
110046
|
visitNode(node.expression, visitor, isExpression),
|
|
110027
|
-
|
|
110047
|
+
visitNode(node.thenStatement, topLevelNestedVisitor, isStatement, factory2.liftToBlock) ?? factory2.createBlock([]),
|
|
110028
110048
|
visitNode(node.elseStatement, topLevelNestedVisitor, isStatement, factory2.liftToBlock)
|
|
110029
110049
|
);
|
|
110030
110050
|
}
|
|
@@ -113717,6 +113737,7 @@ function emitFiles(resolver, host, targetSourceFile, { scriptTransformers, decla
|
|
|
113717
113737
|
forEachChild(node, collectLinkedAliases);
|
|
113718
113738
|
}
|
|
113719
113739
|
function markLinkedReferences(file) {
|
|
113740
|
+
if (isSourceFileJS(file)) return;
|
|
113720
113741
|
forEachChildRecursively(file, (n) => {
|
|
113721
113742
|
if (isImportEqualsDeclaration(n) && !(getSyntacticModifierFlags(n) & 32 /* Export */)) return "skip";
|
|
113722
113743
|
if (isImportDeclaration(n)) return "skip";
|
|
@@ -114700,7 +114721,7 @@ function createPrinter(printerOptions = {}, handlers = {}) {
|
|
|
114700
114721
|
}
|
|
114701
114722
|
function getSortedEmitHelpers(node) {
|
|
114702
114723
|
const helpers = getEmitHelpers(node);
|
|
114703
|
-
return helpers &&
|
|
114724
|
+
return helpers && toSorted(helpers, compareEmitHelpers);
|
|
114704
114725
|
}
|
|
114705
114726
|
function emitNumericOrBigIntLiteral(node) {
|
|
114706
114727
|
emitLiteral(
|
|
@@ -119783,7 +119804,7 @@ function createProgram(rootNamesOrOptions, _options, _host, _oldProgram, _config
|
|
|
119783
119804
|
});
|
|
119784
119805
|
}
|
|
119785
119806
|
}
|
|
119786
|
-
files =
|
|
119807
|
+
files = toSorted(processingDefaultLibFiles, compareDefaultLibFiles).concat(processingOtherFiles);
|
|
119787
119808
|
processingDefaultLibFiles = void 0;
|
|
119788
119809
|
processingOtherFiles = void 0;
|
|
119789
119810
|
filesWithReferencesProcessed = void 0;
|
|
@@ -128931,7 +128952,7 @@ function shouldBePretty(sys2, options) {
|
|
|
128931
128952
|
return options.pretty;
|
|
128932
128953
|
}
|
|
128933
128954
|
function getOptionsForHelp(commandLine) {
|
|
128934
|
-
return !!commandLine.options.all ?
|
|
128955
|
+
return !!commandLine.options.all ? toSorted(optionDeclarations, (a, b) => compareStringsCaseInsensitive(a.name, b.name)) : filter(optionDeclarations.slice(), (v) => !!v.showInSimplifiedHelpView);
|
|
128935
128956
|
}
|
|
128936
128957
|
function printVersion(sys2) {
|
|
128937
128958
|
sys2.write(getDiagnosticText(Diagnostics.Version_0, version) + sys2.newLine);
|
package/lib/typescript.d.ts
CHANGED
|
@@ -10764,6 +10764,10 @@ declare namespace ts {
|
|
|
10764
10764
|
*/
|
|
10765
10765
|
isIncomplete?: true;
|
|
10766
10766
|
entries: CompletionEntry[];
|
|
10767
|
+
/**
|
|
10768
|
+
* Default commit characters for the completion entries.
|
|
10769
|
+
*/
|
|
10770
|
+
defaultCommitCharacters?: string[];
|
|
10767
10771
|
}
|
|
10768
10772
|
interface CompletionEntryDataAutoImport {
|
|
10769
10773
|
/**
|
|
@@ -10870,6 +10874,10 @@ declare namespace ts {
|
|
|
10870
10874
|
* is an auto-import.
|
|
10871
10875
|
*/
|
|
10872
10876
|
data?: CompletionEntryData;
|
|
10877
|
+
/**
|
|
10878
|
+
* If this completion entry is selected, typing a commit character will cause the entry to be accepted.
|
|
10879
|
+
*/
|
|
10880
|
+
commitCharacters?: string[];
|
|
10873
10881
|
}
|
|
10874
10882
|
interface CompletionEntryLabelDetails {
|
|
10875
10883
|
/**
|
package/lib/typescript.js
CHANGED
|
@@ -899,6 +899,7 @@ __export(typescript_exports, {
|
|
|
899
899
|
getNonAugmentationDeclaration: () => getNonAugmentationDeclaration,
|
|
900
900
|
getNonDecoratorTokenPosOfNode: () => getNonDecoratorTokenPosOfNode,
|
|
901
901
|
getNonIncrementalBuildInfoRoots: () => getNonIncrementalBuildInfoRoots,
|
|
902
|
+
getNonModifierTokenPosOfNode: () => getNonModifierTokenPosOfNode,
|
|
902
903
|
getNormalizedAbsolutePath: () => getNormalizedAbsolutePath,
|
|
903
904
|
getNormalizedAbsolutePathWithoutRoot: () => getNormalizedAbsolutePathWithoutRoot,
|
|
904
905
|
getNormalizedPathComponents: () => getNormalizedPathComponents,
|
|
@@ -2077,7 +2078,6 @@ __export(typescript_exports, {
|
|
|
2077
2078
|
skipWhile: () => skipWhile,
|
|
2078
2079
|
sliceAfter: () => sliceAfter,
|
|
2079
2080
|
some: () => some,
|
|
2080
|
-
sort: () => sort,
|
|
2081
2081
|
sortAndDeduplicate: () => sortAndDeduplicate,
|
|
2082
2082
|
sortAndDeduplicateDiagnostics: () => sortAndDeduplicateDiagnostics,
|
|
2083
2083
|
sourceFileAffectingCompilerOptions: () => sourceFileAffectingCompilerOptions,
|
|
@@ -2086,7 +2086,6 @@ __export(typescript_exports, {
|
|
|
2086
2086
|
sourceMapCommentRegExpDontCareLineStart: () => sourceMapCommentRegExpDontCareLineStart,
|
|
2087
2087
|
spacePart: () => spacePart,
|
|
2088
2088
|
spanMap: () => spanMap,
|
|
2089
|
-
stableSort: () => stableSort,
|
|
2090
2089
|
startEndContainsRange: () => startEndContainsRange,
|
|
2091
2090
|
startEndOverlapsWithStartEnd: () => startEndOverlapsWithStartEnd,
|
|
2092
2091
|
startOnNewLine: () => startOnNewLine,
|
|
@@ -2145,6 +2144,7 @@ __export(typescript_exports, {
|
|
|
2145
2144
|
toFileNameLowerCase: () => toFileNameLowerCase,
|
|
2146
2145
|
toPath: () => toPath,
|
|
2147
2146
|
toProgramEmitPending: () => toProgramEmitPending,
|
|
2147
|
+
toSorted: () => toSorted,
|
|
2148
2148
|
tokenIsIdentifierOrKeyword: () => tokenIsIdentifierOrKeyword,
|
|
2149
2149
|
tokenIsIdentifierOrKeywordOrGreaterThan: () => tokenIsIdentifierOrKeywordOrGreaterThan,
|
|
2150
2150
|
tokenToString: () => tokenToString,
|
|
@@ -2259,7 +2259,7 @@ module.exports = __toCommonJS(typescript_exports);
|
|
|
2259
2259
|
|
|
2260
2260
|
// src/compiler/corePublic.ts
|
|
2261
2261
|
var versionMajorMinor = "5.6";
|
|
2262
|
-
var version = `${versionMajorMinor}.0-insiders.
|
|
2262
|
+
var version = `${versionMajorMinor}.0-insiders.20240725`;
|
|
2263
2263
|
var Comparison = /* @__PURE__ */ ((Comparison3) => {
|
|
2264
2264
|
Comparison3[Comparison3["LessThan"] = -1] = "LessThan";
|
|
2265
2265
|
Comparison3[Comparison3["EqualTo"] = 0] = "EqualTo";
|
|
@@ -2767,7 +2767,7 @@ function insertSorted(array, insert, compare, equalityComparer, allowDuplicates)
|
|
|
2767
2767
|
return false;
|
|
2768
2768
|
}
|
|
2769
2769
|
function sortAndDeduplicate(array, comparer, equalityComparer) {
|
|
2770
|
-
return deduplicateSorted(
|
|
2770
|
+
return deduplicateSorted(toSorted(array, comparer), equalityComparer ?? comparer ?? compareStringsCaseSensitive);
|
|
2771
2771
|
}
|
|
2772
2772
|
function arrayIsEqualTo(array1, array2, equalityComparer = equateValues) {
|
|
2773
2773
|
if (array1 === void 0 || array2 === void 0) {
|
|
@@ -2871,19 +2871,14 @@ function appendIfUnique(array, toAdd, equalityComparer) {
|
|
|
2871
2871
|
function stableSortIndices(array, indices, comparer) {
|
|
2872
2872
|
indices.sort((x, y) => comparer(array[x], array[y]) || compareValues(x, y));
|
|
2873
2873
|
}
|
|
2874
|
-
function
|
|
2875
|
-
return array.length === 0 ?
|
|
2874
|
+
function toSorted(array, comparer) {
|
|
2875
|
+
return array.length === 0 ? emptyArray : array.slice().sort(comparer);
|
|
2876
2876
|
}
|
|
2877
2877
|
function* arrayReverseIterator(array) {
|
|
2878
2878
|
for (let i = array.length - 1; i >= 0; i--) {
|
|
2879
2879
|
yield array[i];
|
|
2880
2880
|
}
|
|
2881
2881
|
}
|
|
2882
|
-
function stableSort(array, comparer) {
|
|
2883
|
-
const indices = indicesOf(array);
|
|
2884
|
-
stableSortIndices(array, indices, comparer);
|
|
2885
|
-
return indices.map((i) => array[i]);
|
|
2886
|
-
}
|
|
2887
2882
|
function rangeEquals(array1, array2, pos, end) {
|
|
2888
2883
|
while (pos < end) {
|
|
2889
2884
|
if (array1[pos] !== array2[pos]) {
|
|
@@ -4028,7 +4023,7 @@ Node ${formatSyntaxKind(node.kind)} was unexpected.`,
|
|
|
4028
4023
|
result.push([value, name]);
|
|
4029
4024
|
}
|
|
4030
4025
|
}
|
|
4031
|
-
const sorted =
|
|
4026
|
+
const sorted = toSorted(result, (x, y) => compareValues(x[0], y[0]));
|
|
4032
4027
|
enumMemberCache.set(enumObject, sorted);
|
|
4033
4028
|
return sorted;
|
|
4034
4029
|
}
|
|
@@ -8346,7 +8341,7 @@ var sys = (() => {
|
|
|
8346
8341
|
setTimeout,
|
|
8347
8342
|
clearTimeout,
|
|
8348
8343
|
clearScreen: () => {
|
|
8349
|
-
process.stdout.write("\
|
|
8344
|
+
process.stdout.write("\x1B[2J\x1B[3J\x1B[H");
|
|
8350
8345
|
},
|
|
8351
8346
|
setBlocking: () => {
|
|
8352
8347
|
var _a;
|
|
@@ -9521,6 +9516,18 @@ var Diagnostics = {
|
|
|
9521
9516
|
Decimal_escape_sequences_and_backreferences_are_not_allowed_in_a_character_class: diag(1537, 1 /* Error */, "Decimal_escape_sequences_and_backreferences_are_not_allowed_in_a_character_class_1537", "Decimal escape sequences and backreferences are not allowed in a character class."),
|
|
9522
9517
|
Unicode_escape_sequences_are_only_available_when_the_Unicode_u_flag_or_the_Unicode_Sets_v_flag_is_set: diag(1538, 1 /* Error */, "Unicode_escape_sequences_are_only_available_when_the_Unicode_u_flag_or_the_Unicode_Sets_v_flag_is_se_1538", "Unicode escape sequences are only available when the Unicode (u) flag or the Unicode Sets (v) flag is set."),
|
|
9523
9518
|
A_bigint_literal_cannot_be_used_as_a_property_name: diag(1539, 1 /* Error */, "A_bigint_literal_cannot_be_used_as_a_property_name_1539", "A 'bigint' literal cannot be used as a property name."),
|
|
9519
|
+
A_namespace_declaration_should_not_be_declared_using_the_module_keyword_Please_use_the_namespace_keyword_instead: diag(
|
|
9520
|
+
1540,
|
|
9521
|
+
2 /* Suggestion */,
|
|
9522
|
+
"A_namespace_declaration_should_not_be_declared_using_the_module_keyword_Please_use_the_namespace_key_1540",
|
|
9523
|
+
"A 'namespace' declaration should not be declared using the 'module' keyword. Please use the 'namespace' keyword instead.",
|
|
9524
|
+
/*reportsUnnecessary*/
|
|
9525
|
+
void 0,
|
|
9526
|
+
/*elidedInCompatabilityPyramid*/
|
|
9527
|
+
void 0,
|
|
9528
|
+
/*reportsDeprecated*/
|
|
9529
|
+
true
|
|
9530
|
+
),
|
|
9524
9531
|
The_types_of_0_are_incompatible_between_these_types: diag(2200, 1 /* Error */, "The_types_of_0_are_incompatible_between_these_types_2200", "The types of '{0}' are incompatible between these types."),
|
|
9525
9532
|
The_types_returned_by_0_are_incompatible_between_these_types: diag(2201, 1 /* Error */, "The_types_returned_by_0_are_incompatible_between_these_types_2201", "The types returned by '{0}' are incompatible between these types."),
|
|
9526
9533
|
Call_signature_return_types_0_and_1_are_incompatible: diag(
|
|
@@ -16457,6 +16464,13 @@ function getNonDecoratorTokenPosOfNode(node, sourceFile) {
|
|
|
16457
16464
|
}
|
|
16458
16465
|
return skipTrivia((sourceFile || getSourceFileOfNode(node)).text, lastDecorator.end);
|
|
16459
16466
|
}
|
|
16467
|
+
function getNonModifierTokenPosOfNode(node, sourceFile) {
|
|
16468
|
+
const lastModifier = !nodeIsMissing(node) && canHaveModifiers(node) && node.modifiers ? last(node.modifiers) : void 0;
|
|
16469
|
+
if (!lastModifier) {
|
|
16470
|
+
return getTokenPosOfNode(node, sourceFile);
|
|
16471
|
+
}
|
|
16472
|
+
return skipTrivia((sourceFile || getSourceFileOfNode(node)).text, lastModifier.end);
|
|
16473
|
+
}
|
|
16460
16474
|
function getSourceTextOfNodeFromSourceFile(sourceFile, node, includeTrivia = false) {
|
|
16461
16475
|
return getTextOfNodeFromSourceText(sourceFile.text, node, includeTrivia);
|
|
16462
16476
|
}
|
|
@@ -22096,7 +22110,7 @@ function matchFiles(path, extensions, excludes, includes, useCaseSensitiveFileNa
|
|
|
22096
22110
|
if (visited.has(canonicalPath)) return;
|
|
22097
22111
|
visited.set(canonicalPath, true);
|
|
22098
22112
|
const { files, directories } = getFileSystemEntries(path2);
|
|
22099
|
-
for (const current of
|
|
22113
|
+
for (const current of toSorted(files, compareStringsCaseSensitive)) {
|
|
22100
22114
|
const name = combinePaths(path2, current);
|
|
22101
22115
|
const absoluteName = combinePaths(absolutePath, current);
|
|
22102
22116
|
if (extensions && !fileExtensionIsOneOf(name, extensions)) continue;
|
|
@@ -22116,7 +22130,7 @@ function matchFiles(path, extensions, excludes, includes, useCaseSensitiveFileNa
|
|
|
22116
22130
|
return;
|
|
22117
22131
|
}
|
|
22118
22132
|
}
|
|
22119
|
-
for (const current of
|
|
22133
|
+
for (const current of toSorted(directories, compareStringsCaseSensitive)) {
|
|
22120
22134
|
const name = combinePaths(path2, current);
|
|
22121
22135
|
const absoluteName = combinePaths(absolutePath, current);
|
|
22122
22136
|
if ((!includeDirectoryRegex || includeDirectoryRegex.test(absoluteName)) && (!excludeRegex || !excludeRegex.test(absoluteName))) {
|
|
@@ -45067,7 +45081,7 @@ function loadModuleFromImportsOrExports(extensions, state, cache, redirectedRefe
|
|
|
45067
45081
|
moduleName
|
|
45068
45082
|
);
|
|
45069
45083
|
}
|
|
45070
|
-
const expandingKeys =
|
|
45084
|
+
const expandingKeys = toSorted(filter(getOwnKeys(lookupTable), (k) => hasOneAsterisk(k) || endsWith(k, "/")), comparePatternKeys);
|
|
45071
45085
|
for (const potentialTarget of expandingKeys) {
|
|
45072
45086
|
if (state.features & 16 /* ExportsPatternTrailers */ && matchesPatternWithTrailer(potentialTarget, moduleName)) {
|
|
45073
45087
|
const target = lookupTable[potentialTarget];
|
|
@@ -82426,6 +82440,7 @@ function createTypeChecker(host) {
|
|
|
82426
82440
|
}
|
|
82427
82441
|
}
|
|
82428
82442
|
function getSyntacticNullishnessSemantics(node) {
|
|
82443
|
+
node = skipOuterExpressions(node);
|
|
82429
82444
|
switch (node.kind) {
|
|
82430
82445
|
case 223 /* AwaitExpression */:
|
|
82431
82446
|
case 213 /* CallExpression */:
|
|
@@ -82446,10 +82461,6 @@ function createTypeChecker(host) {
|
|
|
82446
82461
|
return 3 /* Sometimes */;
|
|
82447
82462
|
}
|
|
82448
82463
|
return 2 /* Never */;
|
|
82449
|
-
case 216 /* TypeAssertionExpression */:
|
|
82450
|
-
case 234 /* AsExpression */:
|
|
82451
|
-
case 217 /* ParenthesizedExpression */:
|
|
82452
|
-
return getSyntacticNullishnessSemantics(node.expression);
|
|
82453
82464
|
case 227 /* ConditionalExpression */:
|
|
82454
82465
|
return getSyntacticNullishnessSemantics(node.whenTrue) | getSyntacticNullishnessSemantics(node.whenFalse);
|
|
82455
82466
|
case 106 /* NullKeyword */:
|
|
@@ -86086,6 +86097,7 @@ function createTypeChecker(host) {
|
|
|
86086
86097
|
return type;
|
|
86087
86098
|
}
|
|
86088
86099
|
function getSyntacticTruthySemantics(node) {
|
|
86100
|
+
node = skipOuterExpressions(node);
|
|
86089
86101
|
switch (node.kind) {
|
|
86090
86102
|
case 9 /* NumericLiteral */:
|
|
86091
86103
|
if (node.text === "0" || node.text === "1") {
|
|
@@ -86108,10 +86120,6 @@ function createTypeChecker(host) {
|
|
|
86108
86120
|
case 15 /* NoSubstitutionTemplateLiteral */:
|
|
86109
86121
|
case 11 /* StringLiteral */:
|
|
86110
86122
|
return !!node.text ? 1 /* Always */ : 2 /* Never */;
|
|
86111
|
-
case 216 /* TypeAssertionExpression */:
|
|
86112
|
-
case 234 /* AsExpression */:
|
|
86113
|
-
case 217 /* ParenthesizedExpression */:
|
|
86114
|
-
return getSyntacticTruthySemantics(node.expression);
|
|
86115
86123
|
case 227 /* ConditionalExpression */:
|
|
86116
86124
|
return getSyntacticTruthySemantics(node.whenTrue) | getSyntacticTruthySemantics(node.whenFalse);
|
|
86117
86125
|
case 80 /* Identifier */:
|
|
@@ -88105,6 +88113,14 @@ function createTypeChecker(host) {
|
|
|
88105
88113
|
}
|
|
88106
88114
|
if (isIdentifier(node.name)) {
|
|
88107
88115
|
checkCollisionsForDeclarationName(node, node.name);
|
|
88116
|
+
if (!(node.flags & (32 /* Namespace */ | 2048 /* GlobalAugmentation */))) {
|
|
88117
|
+
const sourceFile = getSourceFileOfNode(node);
|
|
88118
|
+
const pos = getNonModifierTokenPosOfNode(node);
|
|
88119
|
+
const span = getSpanOfTokenAtPosition(sourceFile, pos);
|
|
88120
|
+
suggestionDiagnostics.add(
|
|
88121
|
+
createFileDiagnostic(sourceFile, span.start, span.length, Diagnostics.A_namespace_declaration_should_not_be_declared_using_the_module_keyword_Please_use_the_namespace_keyword_instead)
|
|
88122
|
+
);
|
|
88123
|
+
}
|
|
88108
88124
|
}
|
|
88109
88125
|
checkExportsOnMergedDeclarations(node);
|
|
88110
88126
|
const symbol = getSymbolOfDeclaration(node);
|
|
@@ -90278,11 +90294,14 @@ function createTypeChecker(host) {
|
|
|
90278
90294
|
}
|
|
90279
90295
|
function checkSingleIdentifier(node2) {
|
|
90280
90296
|
const nodeLinks2 = getNodeLinks(node2);
|
|
90281
|
-
nodeLinks2.calculatedFlags |= 536870912 /* ConstructorReference
|
|
90282
|
-
if (isIdentifier(node2)
|
|
90283
|
-
|
|
90284
|
-
if (
|
|
90285
|
-
|
|
90297
|
+
nodeLinks2.calculatedFlags |= 536870912 /* ConstructorReference */;
|
|
90298
|
+
if (isIdentifier(node2)) {
|
|
90299
|
+
nodeLinks2.calculatedFlags |= 32768 /* BlockScopedBindingInLoop */ | 16384 /* CapturedBlockScopedBinding */;
|
|
90300
|
+
if (isExpressionNodeOrShorthandPropertyAssignmentName(node2) && !(isPropertyAccessExpression(node2.parent) && node2.parent.name === node2)) {
|
|
90301
|
+
const s = getResolvedSymbol(node2);
|
|
90302
|
+
if (s && s !== unknownSymbol) {
|
|
90303
|
+
checkIdentifierCalculateNodeCheckFlags(node2, s);
|
|
90304
|
+
}
|
|
90286
90305
|
}
|
|
90287
90306
|
}
|
|
90288
90307
|
}
|
|
@@ -94748,7 +94767,7 @@ function collectExternalModuleInfo(context, sourceFile) {
|
|
|
94748
94767
|
}
|
|
94749
94768
|
}
|
|
94750
94769
|
function addExportedFunctionDeclaration(node, name, isDefault) {
|
|
94751
|
-
exportedFunctions.add(node);
|
|
94770
|
+
exportedFunctions.add(getOriginalNode(node, isFunctionDeclaration));
|
|
94752
94771
|
if (isDefault) {
|
|
94753
94772
|
if (!hasExportDefault) {
|
|
94754
94773
|
multiMapSparseArrayAdd(exportedBindings, getOriginalNodeId(node), name ?? context.factory.getDeclarationName(node));
|
|
@@ -99161,6 +99180,7 @@ function transformClassFields(context) {
|
|
|
99161
99180
|
addRange(statementsOut, visitNodes2(statementsIn, visitor, isStatement, statementOffset));
|
|
99162
99181
|
}
|
|
99163
99182
|
function transformConstructorBody(node, constructor, isDerivedClass) {
|
|
99183
|
+
var _a;
|
|
99164
99184
|
const instanceProperties = getProperties(
|
|
99165
99185
|
node,
|
|
99166
99186
|
/*requireInitializer*/
|
|
@@ -99254,12 +99274,12 @@ function transformClassFields(context) {
|
|
|
99254
99274
|
setTextRange(
|
|
99255
99275
|
factory2.createNodeArray(statements),
|
|
99256
99276
|
/*location*/
|
|
99257
|
-
constructor ? constructor.body.statements
|
|
99277
|
+
((_a = constructor == null ? void 0 : constructor.body) == null ? void 0 : _a.statements) ?? node.members
|
|
99258
99278
|
),
|
|
99259
99279
|
multiLine
|
|
99260
99280
|
),
|
|
99261
99281
|
/*location*/
|
|
99262
|
-
constructor
|
|
99282
|
+
constructor == null ? void 0 : constructor.body
|
|
99263
99283
|
);
|
|
99264
99284
|
}
|
|
99265
99285
|
function addPropertyOrClassStaticBlockStatements(statements, properties, receiver) {
|
|
@@ -112693,7 +112713,7 @@ function transformModule(context) {
|
|
|
112693
112713
|
return factory2.updateLabeledStatement(
|
|
112694
112714
|
node,
|
|
112695
112715
|
node.label,
|
|
112696
|
-
|
|
112716
|
+
visitNode(node.statement, topLevelNestedVisitor, isStatement, factory2.liftToBlock) ?? factory2.createExpressionStatement(factory2.createIdentifier(""))
|
|
112697
112717
|
);
|
|
112698
112718
|
}
|
|
112699
112719
|
function visitWithStatement(node) {
|
|
@@ -112707,7 +112727,7 @@ function transformModule(context) {
|
|
|
112707
112727
|
return factory2.updateIfStatement(
|
|
112708
112728
|
node,
|
|
112709
112729
|
visitNode(node.expression, visitor, isExpression),
|
|
112710
|
-
|
|
112730
|
+
visitNode(node.thenStatement, topLevelNestedVisitor, isStatement, factory2.liftToBlock) ?? factory2.createBlock([]),
|
|
112711
112731
|
visitNode(node.elseStatement, topLevelNestedVisitor, isStatement, factory2.liftToBlock)
|
|
112712
112732
|
);
|
|
112713
112733
|
}
|
|
@@ -114810,7 +114830,7 @@ function transformSystemModule(context) {
|
|
|
114810
114830
|
return factory2.updateLabeledStatement(
|
|
114811
114831
|
node,
|
|
114812
114832
|
node.label,
|
|
114813
|
-
|
|
114833
|
+
visitNode(node.statement, topLevelNestedVisitor, isStatement, factory2.liftToBlock) ?? factory2.createExpressionStatement(factory2.createIdentifier(""))
|
|
114814
114834
|
);
|
|
114815
114835
|
}
|
|
114816
114836
|
function visitWithStatement(node) {
|
|
@@ -114824,7 +114844,7 @@ function transformSystemModule(context) {
|
|
|
114824
114844
|
return factory2.updateIfStatement(
|
|
114825
114845
|
node,
|
|
114826
114846
|
visitNode(node.expression, visitor, isExpression),
|
|
114827
|
-
|
|
114847
|
+
visitNode(node.thenStatement, topLevelNestedVisitor, isStatement, factory2.liftToBlock) ?? factory2.createBlock([]),
|
|
114828
114848
|
visitNode(node.elseStatement, topLevelNestedVisitor, isStatement, factory2.liftToBlock)
|
|
114829
114849
|
);
|
|
114830
114850
|
}
|
|
@@ -118528,6 +118548,7 @@ function emitFiles(resolver, host, targetSourceFile, { scriptTransformers, decla
|
|
|
118528
118548
|
forEachChild(node, collectLinkedAliases);
|
|
118529
118549
|
}
|
|
118530
118550
|
function markLinkedReferences(file) {
|
|
118551
|
+
if (isSourceFileJS(file)) return;
|
|
118531
118552
|
forEachChildRecursively(file, (n) => {
|
|
118532
118553
|
if (isImportEqualsDeclaration(n) && !(getSyntacticModifierFlags(n) & 32 /* Export */)) return "skip";
|
|
118533
118554
|
if (isImportDeclaration(n)) return "skip";
|
|
@@ -119511,7 +119532,7 @@ function createPrinter(printerOptions = {}, handlers = {}) {
|
|
|
119511
119532
|
}
|
|
119512
119533
|
function getSortedEmitHelpers(node) {
|
|
119513
119534
|
const helpers = getEmitHelpers(node);
|
|
119514
|
-
return helpers &&
|
|
119535
|
+
return helpers && toSorted(helpers, compareEmitHelpers);
|
|
119515
119536
|
}
|
|
119516
119537
|
function emitNumericOrBigIntLiteral(node) {
|
|
119517
119538
|
emitLiteral(
|
|
@@ -124640,7 +124661,7 @@ function createProgram(rootNamesOrOptions, _options, _host, _oldProgram, _config
|
|
|
124640
124661
|
});
|
|
124641
124662
|
}
|
|
124642
124663
|
}
|
|
124643
|
-
files =
|
|
124664
|
+
files = toSorted(processingDefaultLibFiles, compareDefaultLibFiles).concat(processingOtherFiles);
|
|
124644
124665
|
processingDefaultLibFiles = void 0;
|
|
124645
124666
|
processingOtherFiles = void 0;
|
|
124646
124667
|
filesWithReferencesProcessed = void 0;
|
|
@@ -133905,7 +133926,7 @@ function shouldBePretty(sys2, options) {
|
|
|
133905
133926
|
return options.pretty;
|
|
133906
133927
|
}
|
|
133907
133928
|
function getOptionsForHelp(commandLine) {
|
|
133908
|
-
return !!commandLine.options.all ?
|
|
133929
|
+
return !!commandLine.options.all ? toSorted(optionDeclarations, (a, b) => compareStringsCaseInsensitive(a.name, b.name)) : filter(optionDeclarations.slice(), (v) => !!v.showInSimplifiedHelpView);
|
|
133909
133930
|
}
|
|
133910
133931
|
function printVersion(sys2) {
|
|
133911
133932
|
sys2.write(getDiagnosticText(Diagnostics.Version_0, version) + sys2.newLine);
|
|
@@ -137584,7 +137605,7 @@ function insertImports(changes, sourceFile, imports, blankLineBetween, preferenc
|
|
|
137584
137605
|
const importKindPredicate = decl.kind === 243 /* VariableStatement */ ? isRequireVariableStatement : isAnyImportSyntax;
|
|
137585
137606
|
const existingImportStatements = filter(sourceFile.statements, importKindPredicate);
|
|
137586
137607
|
const { comparer, isSorted } = ts_OrganizeImports_exports.getOrganizeImportsStringComparerWithDetection(existingImportStatements, preferences);
|
|
137587
|
-
const sortedNewImports = isArray(imports) ?
|
|
137608
|
+
const sortedNewImports = isArray(imports) ? toSorted(imports, (a, b) => ts_OrganizeImports_exports.compareImportsOrRequireStatements(a, b, comparer)) : [imports];
|
|
137588
137609
|
if (!(existingImportStatements == null ? void 0 : existingImportStatements.length)) {
|
|
137589
137610
|
if (isFullSourceFile(sourceFile)) {
|
|
137590
137611
|
changes.insertNodesAtTopOfFile(sourceFile, sortedNewImports, blankLineBetween);
|
|
@@ -140343,10 +140364,8 @@ var DocumentHighlights;
|
|
|
140343
140364
|
return [...nodes, container];
|
|
140344
140365
|
}
|
|
140345
140366
|
return nodes;
|
|
140346
|
-
case 210 /* ObjectLiteralExpression */:
|
|
140347
|
-
return void 0;
|
|
140348
140367
|
default:
|
|
140349
|
-
|
|
140368
|
+
return void 0;
|
|
140350
140369
|
}
|
|
140351
140370
|
}
|
|
140352
140371
|
function pushKeywordIf(keywordList, token, ...expected) {
|
|
@@ -155607,7 +155626,7 @@ function getFixInfos(context, errorCode, pos, useAutoImportProvider) {
|
|
|
155607
155626
|
}
|
|
155608
155627
|
function sortFixInfo(fixes, sourceFile, program, packageJsonImportFilter, host, preferences) {
|
|
155609
155628
|
const _toPath = (fileName) => toPath(fileName, host.getCurrentDirectory(), hostGetCanonicalFileName(host));
|
|
155610
|
-
return
|
|
155629
|
+
return toSorted(fixes, (a, b) => compareBooleans(!!a.isJsxNamespaceFix, !!b.isJsxNamespaceFix) || compareValues(a.fix.kind, b.fix.kind) || compareModuleSpecifiers(a.fix, b.fix, sourceFile, program, preferences, packageJsonImportFilter.allowsImportingSpecifier, _toPath));
|
|
155611
155630
|
}
|
|
155612
155631
|
function getFixInfosWithoutDiagnostic(context, symbolToken, useAutoImportProvider) {
|
|
155613
155632
|
const info = getFixesInfoForNonUMDImport(context, symbolToken, useAutoImportProvider);
|
|
@@ -156053,7 +156072,7 @@ function doAddExistingFix(changes, sourceFile, clause, defaultImport, namedImpor
|
|
|
156053
156072
|
}
|
|
156054
156073
|
if (namedImports.length) {
|
|
156055
156074
|
const { specifierComparer, isSorted } = ts_OrganizeImports_exports.getNamedImportSpecifierComparerWithDetection(clause.parent, preferences, sourceFile);
|
|
156056
|
-
const newSpecifiers =
|
|
156075
|
+
const newSpecifiers = toSorted(
|
|
156057
156076
|
namedImports.map(
|
|
156058
156077
|
(namedImport) => factory.createImportSpecifier(
|
|
156059
156078
|
(!clause.isTypeOnly || promoteFromTypeOnly2) && shouldUseTypeOnly(namedImport, preferences),
|
|
@@ -156070,7 +156089,7 @@ function doAddExistingFix(changes, sourceFile, clause, defaultImport, namedImpor
|
|
|
156070
156089
|
clause.namedBindings,
|
|
156071
156090
|
factory.updateNamedImports(
|
|
156072
156091
|
clause.namedBindings,
|
|
156073
|
-
|
|
156092
|
+
toSorted([...existingSpecifiers.filter((s) => !removeExistingImportSpecifiers.has(s)), ...newSpecifiers], specifierComparer)
|
|
156074
156093
|
)
|
|
156075
156094
|
);
|
|
156076
156095
|
} else if ((existingSpecifiers == null ? void 0 : existingSpecifiers.length) && isSorted !== false) {
|
|
@@ -163006,6 +163025,7 @@ __export(ts_Completions_exports, {
|
|
|
163006
163025
|
getCompletionEntryDetails: () => getCompletionEntryDetails,
|
|
163007
163026
|
getCompletionEntrySymbol: () => getCompletionEntrySymbol,
|
|
163008
163027
|
getCompletionsAtPosition: () => getCompletionsAtPosition,
|
|
163028
|
+
getDefaultCommitCharacters: () => getDefaultCommitCharacters,
|
|
163009
163029
|
getPropertiesForObjectExpression: () => getPropertiesForObjectExpression,
|
|
163010
163030
|
moduleSpecifierResolutionCacheAttemptLimit: () => moduleSpecifierResolutionCacheAttemptLimit,
|
|
163011
163031
|
moduleSpecifierResolutionLimit: () => moduleSpecifierResolutionLimit
|
|
@@ -163138,6 +163158,12 @@ function resolvingModuleSpecifiers(logPrefix, host, resolver, program, position,
|
|
|
163138
163158
|
return result2 || (needsFullResolution ? "failed" : "skipped");
|
|
163139
163159
|
}
|
|
163140
163160
|
}
|
|
163161
|
+
function getDefaultCommitCharacters(isNewIdentifierLocation) {
|
|
163162
|
+
if (isNewIdentifierLocation) {
|
|
163163
|
+
return [];
|
|
163164
|
+
}
|
|
163165
|
+
return [".", ",", ";"];
|
|
163166
|
+
}
|
|
163141
163167
|
function getCompletionsAtPosition(host, program, log, sourceFile, position, preferences, triggerCharacter, completionKind, cancellationToken, formatContext, includeSymbol = false) {
|
|
163142
163168
|
var _a;
|
|
163143
163169
|
const { previousToken } = getRelevantTokens(position, sourceFile);
|
|
@@ -163146,7 +163172,17 @@ function getCompletionsAtPosition(host, program, log, sourceFile, position, pref
|
|
|
163146
163172
|
}
|
|
163147
163173
|
if (triggerCharacter === " ") {
|
|
163148
163174
|
if (preferences.includeCompletionsForImportStatements && preferences.includeCompletionsWithInsertText) {
|
|
163149
|
-
return {
|
|
163175
|
+
return {
|
|
163176
|
+
isGlobalCompletion: true,
|
|
163177
|
+
isMemberCompletion: false,
|
|
163178
|
+
isNewIdentifierLocation: true,
|
|
163179
|
+
isIncomplete: true,
|
|
163180
|
+
entries: [],
|
|
163181
|
+
defaultCommitCharacters: getDefaultCommitCharacters(
|
|
163182
|
+
/*isNewIdentifierLocation*/
|
|
163183
|
+
true
|
|
163184
|
+
)
|
|
163185
|
+
};
|
|
163150
163186
|
}
|
|
163151
163187
|
return void 0;
|
|
163152
163188
|
}
|
|
@@ -163300,7 +163336,16 @@ function continuePreviousIncompleteResponse(cache, file, location, program, host
|
|
|
163300
163336
|
return previousResponse;
|
|
163301
163337
|
}
|
|
163302
163338
|
function jsdocCompletionInfo(entries) {
|
|
163303
|
-
return {
|
|
163339
|
+
return {
|
|
163340
|
+
isGlobalCompletion: false,
|
|
163341
|
+
isMemberCompletion: false,
|
|
163342
|
+
isNewIdentifierLocation: false,
|
|
163343
|
+
entries,
|
|
163344
|
+
defaultCommitCharacters: getDefaultCommitCharacters(
|
|
163345
|
+
/*isNewIdentifierLocation*/
|
|
163346
|
+
false
|
|
163347
|
+
)
|
|
163348
|
+
};
|
|
163304
163349
|
}
|
|
163305
163350
|
function getJSDocParameterCompletions(sourceFile, position, checker, options, preferences, tagNameOnly) {
|
|
163306
163351
|
const currentToken = getTokenAtPosition(sourceFile, position);
|
|
@@ -163573,7 +163618,8 @@ function specificKeywordCompletionInfo(entries, isNewIdentifierLocation) {
|
|
|
163573
163618
|
isGlobalCompletion: false,
|
|
163574
163619
|
isMemberCompletion: false,
|
|
163575
163620
|
isNewIdentifierLocation,
|
|
163576
|
-
entries: entries.slice()
|
|
163621
|
+
entries: entries.slice(),
|
|
163622
|
+
defaultCommitCharacters: getDefaultCommitCharacters(isNewIdentifierLocation)
|
|
163577
163623
|
};
|
|
163578
163624
|
}
|
|
163579
163625
|
function keywordCompletionData(keywordFilters, filterOutTsOnlyKeywords, isNewIdentifierLocation) {
|
|
@@ -163731,7 +163777,8 @@ function completionInfoFromData(sourceFile, host, program, compilerOptions, log,
|
|
|
163731
163777
|
isMemberCompletion: isMemberCompletionKind(completionKind),
|
|
163732
163778
|
isNewIdentifierLocation,
|
|
163733
163779
|
optionalReplacementSpan: getOptionalReplacementSpan(location),
|
|
163734
|
-
entries
|
|
163780
|
+
entries,
|
|
163781
|
+
defaultCommitCharacters: getDefaultCommitCharacters(isNewIdentifierLocation)
|
|
163735
163782
|
};
|
|
163736
163783
|
}
|
|
163737
163784
|
function isCheckedFile(sourceFile, compilerOptions) {
|
|
@@ -163897,7 +163944,17 @@ function getJsxClosingTagCompletion(location, sourceFile) {
|
|
|
163897
163944
|
kindModifiers: void 0,
|
|
163898
163945
|
sortText: SortText.LocationPriority
|
|
163899
163946
|
};
|
|
163900
|
-
return {
|
|
163947
|
+
return {
|
|
163948
|
+
isGlobalCompletion: false,
|
|
163949
|
+
isMemberCompletion: true,
|
|
163950
|
+
isNewIdentifierLocation: false,
|
|
163951
|
+
optionalReplacementSpan: replacementSpan,
|
|
163952
|
+
entries: [entry],
|
|
163953
|
+
defaultCommitCharacters: getDefaultCommitCharacters(
|
|
163954
|
+
/*isNewIdentifierLocation*/
|
|
163955
|
+
false
|
|
163956
|
+
)
|
|
163957
|
+
};
|
|
163901
163958
|
}
|
|
163902
163959
|
return;
|
|
163903
163960
|
}
|
|
@@ -163914,7 +163971,8 @@ function getJSCompletionEntries(sourceFile, position, uniqueNames, target, entri
|
|
|
163914
163971
|
kind: "warning" /* warning */,
|
|
163915
163972
|
kindModifiers: "",
|
|
163916
163973
|
sortText: SortText.JavascriptIdentifiers,
|
|
163917
|
-
isFromUncheckedFile: true
|
|
163974
|
+
isFromUncheckedFile: true,
|
|
163975
|
+
commitCharacters: []
|
|
163918
163976
|
}, compareCompletionEntries);
|
|
163919
163977
|
}
|
|
163920
163978
|
});
|
|
@@ -163923,7 +163981,13 @@ function completionNameForLiteral(sourceFile, preferences, literal) {
|
|
|
163923
163981
|
return typeof literal === "object" ? pseudoBigIntToString(literal) + "n" : isString(literal) ? quote(sourceFile, preferences, literal) : JSON.stringify(literal);
|
|
163924
163982
|
}
|
|
163925
163983
|
function createCompletionEntryForLiteral(sourceFile, preferences, literal) {
|
|
163926
|
-
return {
|
|
163984
|
+
return {
|
|
163985
|
+
name: completionNameForLiteral(sourceFile, preferences, literal),
|
|
163986
|
+
kind: "string" /* string */,
|
|
163987
|
+
kindModifiers: "" /* none */,
|
|
163988
|
+
sortText: SortText.LocationPriority,
|
|
163989
|
+
commitCharacters: []
|
|
163990
|
+
};
|
|
163927
163991
|
}
|
|
163928
163992
|
function createCompletionEntry(symbol, sortText, replacementToken, contextToken, location, position, sourceFile, host, program, name, needsConvertPropertyAccess, origin, recommendedCompletion, propertyAccessToConvert, isJsxInitializer, importStatementCompletion, useSemicolons, options, preferences, completionKind, formatContext, isJsxIdentifierExpected, isRightOfOpenTag, includeSymbol) {
|
|
163929
163993
|
var _a, _b;
|
|
@@ -164060,9 +164124,11 @@ function createCompletionEntry(symbol, sortText, replacementToken, contextToken,
|
|
|
164060
164124
|
}
|
|
164061
164125
|
}
|
|
164062
164126
|
}
|
|
164127
|
+
const kind = ts_SymbolDisplay_exports.getSymbolKind(typeChecker, symbol, location);
|
|
164128
|
+
const commitCharacters = kind === "warning" /* warning */ || kind === "string" /* string */ ? [] : void 0;
|
|
164063
164129
|
return {
|
|
164064
164130
|
name,
|
|
164065
|
-
kind
|
|
164131
|
+
kind,
|
|
164066
164132
|
kindModifiers: ts_SymbolDisplay_exports.getSymbolModifiers(typeChecker, symbol),
|
|
164067
164133
|
sortText,
|
|
164068
164134
|
source,
|
|
@@ -164077,6 +164143,7 @@ function createCompletionEntry(symbol, sortText, replacementToken, contextToken,
|
|
|
164077
164143
|
isPackageJsonImport: originIsPackageJsonImport(origin) || void 0,
|
|
164078
164144
|
isImportStatementCompletion: !!importStatementCompletion || void 0,
|
|
164079
164145
|
data,
|
|
164146
|
+
commitCharacters,
|
|
164080
164147
|
...includeSymbol ? { symbol } : void 0
|
|
164081
164148
|
};
|
|
164082
164149
|
}
|
|
@@ -164459,7 +164526,7 @@ function createSnippetPrinter(printerOptions) {
|
|
|
164459
164526
|
{ ...formatContext, options: formatOptions }
|
|
164460
164527
|
);
|
|
164461
164528
|
});
|
|
164462
|
-
const allChanges = escapes ?
|
|
164529
|
+
const allChanges = escapes ? toSorted(concatenate(changes, escapes), (a, b) => compareTextSpans(a.span, b.span)) : changes;
|
|
164463
164530
|
return ts_textChanges_exports.applyChanges(syntheticFile.text, allChanges);
|
|
164464
164531
|
}
|
|
164465
164532
|
function printNode(hint, node, sourceFile) {
|
|
@@ -164495,7 +164562,7 @@ function createSnippetPrinter(printerOptions) {
|
|
|
164495
164562
|
0,
|
|
164496
164563
|
{ ...formatContext, options: formatOptions }
|
|
164497
164564
|
);
|
|
164498
|
-
const allChanges = escapes ?
|
|
164565
|
+
const allChanges = escapes ? toSorted(concatenate(changes, escapes), (a, b) => compareTextSpans(a.span, b.span)) : changes;
|
|
164499
164566
|
return ts_textChanges_exports.applyChanges(syntheticFile.text, allChanges);
|
|
164500
164567
|
}
|
|
164501
164568
|
}
|
|
@@ -164707,7 +164774,16 @@ function getCompletionEntriesFromSymbols(symbols, entries, replacementToken, con
|
|
|
164707
164774
|
function getLabelCompletionAtPosition(node) {
|
|
164708
164775
|
const entries = getLabelStatementCompletions(node);
|
|
164709
164776
|
if (entries.length) {
|
|
164710
|
-
return {
|
|
164777
|
+
return {
|
|
164778
|
+
isGlobalCompletion: false,
|
|
164779
|
+
isMemberCompletion: false,
|
|
164780
|
+
isNewIdentifierLocation: false,
|
|
164781
|
+
entries,
|
|
164782
|
+
defaultCommitCharacters: getDefaultCommitCharacters(
|
|
164783
|
+
/*isNewIdentifierLocation*/
|
|
164784
|
+
false
|
|
164785
|
+
)
|
|
164786
|
+
};
|
|
164711
164787
|
}
|
|
164712
164788
|
}
|
|
164713
164789
|
function getLabelStatementCompletions(node) {
|
|
@@ -166996,7 +167072,14 @@ function convertStringLiteralCompletions(completion, contextToken, sourceFile, h
|
|
|
166996
167072
|
void 0,
|
|
166997
167073
|
includeSymbol
|
|
166998
167074
|
);
|
|
166999
|
-
return {
|
|
167075
|
+
return {
|
|
167076
|
+
isGlobalCompletion: false,
|
|
167077
|
+
isMemberCompletion: true,
|
|
167078
|
+
isNewIdentifierLocation: completion.hasIndexSignature,
|
|
167079
|
+
optionalReplacementSpan,
|
|
167080
|
+
entries,
|
|
167081
|
+
defaultCommitCharacters: getDefaultCommitCharacters(completion.hasIndexSignature)
|
|
167082
|
+
};
|
|
167000
167083
|
}
|
|
167001
167084
|
case 2 /* Types */: {
|
|
167002
167085
|
const quoteChar = contextToken.kind === 15 /* NoSubstitutionTemplateLiteral */ ? 96 /* backtick */ : startsWith(getTextOfNode(contextToken), "'") ? 39 /* singleQuote */ : 34 /* doubleQuote */;
|
|
@@ -167005,9 +167088,17 @@ function convertStringLiteralCompletions(completion, contextToken, sourceFile, h
|
|
|
167005
167088
|
kindModifiers: "" /* none */,
|
|
167006
167089
|
kind: "string" /* string */,
|
|
167007
167090
|
sortText: SortText.LocationPriority,
|
|
167008
|
-
replacementSpan: getReplacementSpanForContextToken(contextToken, position)
|
|
167091
|
+
replacementSpan: getReplacementSpanForContextToken(contextToken, position),
|
|
167092
|
+
commitCharacters: []
|
|
167009
167093
|
}));
|
|
167010
|
-
return {
|
|
167094
|
+
return {
|
|
167095
|
+
isGlobalCompletion: false,
|
|
167096
|
+
isMemberCompletion: false,
|
|
167097
|
+
isNewIdentifierLocation: completion.isNewIdentifier,
|
|
167098
|
+
optionalReplacementSpan,
|
|
167099
|
+
entries,
|
|
167100
|
+
defaultCommitCharacters: getDefaultCommitCharacters(completion.isNewIdentifier)
|
|
167101
|
+
};
|
|
167011
167102
|
}
|
|
167012
167103
|
default:
|
|
167013
167104
|
return Debug.assertNever(completion);
|
|
@@ -167038,7 +167129,13 @@ function convertPathCompletions(pathCompletions) {
|
|
|
167038
167129
|
const isGlobalCompletion = false;
|
|
167039
167130
|
const isNewIdentifierLocation = true;
|
|
167040
167131
|
const entries = pathCompletions.map(({ name, kind, span, extension }) => ({ name, kind, kindModifiers: kindModifiersFromExtension(extension), sortText: SortText.LocationPriority, replacementSpan: span }));
|
|
167041
|
-
return {
|
|
167132
|
+
return {
|
|
167133
|
+
isGlobalCompletion,
|
|
167134
|
+
isMemberCompletion: false,
|
|
167135
|
+
isNewIdentifierLocation,
|
|
167136
|
+
entries,
|
|
167137
|
+
defaultCommitCharacters: getDefaultCommitCharacters(isNewIdentifierLocation)
|
|
167138
|
+
};
|
|
167042
167139
|
}
|
|
167043
167140
|
function kindModifiersFromExtension(extension) {
|
|
167044
167141
|
switch (extension) {
|
|
@@ -170372,12 +170469,13 @@ function getDefinitionAtPosition(program, sourceFile, position, searchOtherFiles
|
|
|
170372
170469
|
const calledDeclaration = tryGetSignatureDeclaration(typeChecker, node);
|
|
170373
170470
|
if (calledDeclaration && !(isJsxOpeningLikeElement(node.parent) && isJsxConstructorLike(calledDeclaration))) {
|
|
170374
170471
|
const sigInfo = createDefinitionFromSignatureDeclaration(typeChecker, calledDeclaration, failedAliasResolution);
|
|
170472
|
+
let includeDeclarations;
|
|
170375
170473
|
if (typeChecker.getRootSymbols(symbol).some((s) => symbolMatchesSignature(s, calledDeclaration))) {
|
|
170376
|
-
return [sigInfo];
|
|
170377
|
-
|
|
170378
|
-
const defs = getDefinitionFromSymbol(typeChecker, symbol, node, failedAliasResolution, calledDeclaration) || emptyArray;
|
|
170379
|
-
return node.kind === 108 /* SuperKeyword */ ? [sigInfo, ...defs] : [...defs, sigInfo];
|
|
170474
|
+
if (!isConstructorDeclaration(calledDeclaration)) return [sigInfo];
|
|
170475
|
+
includeDeclarations = (d) => d !== calledDeclaration && (isClassDeclaration(d) || isClassExpression(d));
|
|
170380
170476
|
}
|
|
170477
|
+
const defs = getDefinitionFromSymbol(typeChecker, symbol, node, failedAliasResolution, calledDeclaration, includeDeclarations) || emptyArray;
|
|
170478
|
+
return node.kind === 108 /* SuperKeyword */ ? [sigInfo, ...defs] : [...defs, sigInfo];
|
|
170381
170479
|
}
|
|
170382
170480
|
if (node.parent.kind === 304 /* ShorthandPropertyAssignment */) {
|
|
170383
170481
|
const shorthandSymbol = typeChecker.getShorthandAssignmentValueSymbol(symbol.valueDeclaration);
|
|
@@ -170634,9 +170732,10 @@ function isExpandoDeclaration(node) {
|
|
|
170634
170732
|
});
|
|
170635
170733
|
return !!containingAssignment && getAssignmentDeclarationKind(containingAssignment) === 5 /* Property */;
|
|
170636
170734
|
}
|
|
170637
|
-
function getDefinitionFromSymbol(typeChecker, symbol, node, failedAliasResolution, excludeDeclaration) {
|
|
170638
|
-
const
|
|
170639
|
-
const
|
|
170735
|
+
function getDefinitionFromSymbol(typeChecker, symbol, node, failedAliasResolution, excludeDeclaration, includeDeclarations) {
|
|
170736
|
+
const excludeConstructorDeclaration = excludeDeclaration !== void 0 && isConstructorDeclaration(excludeDeclaration);
|
|
170737
|
+
const filteredDeclarations = filter(symbol.declarations, includeDeclarations ?? ((d) => d !== excludeDeclaration));
|
|
170738
|
+
const signatureDefinition = !excludeConstructorDeclaration && (getConstructSignatureDefinition() || getCallSignatureDefinition());
|
|
170640
170739
|
if (signatureDefinition) {
|
|
170641
170740
|
return signatureDefinition;
|
|
170642
170741
|
}
|
|
@@ -172229,7 +172328,7 @@ function organizeImports(sourceFile, formatContext, host, program, preferences,
|
|
|
172229
172328
|
}
|
|
172230
172329
|
setEmitFlags(oldImportDecls[0], 1024 /* NoLeadingComments */);
|
|
172231
172330
|
const oldImportGroups = shouldCombine ? group(oldImportDecls, (importDecl) => getExternalModuleName2(importDecl.moduleSpecifier)) : [oldImportDecls];
|
|
172232
|
-
const sortedImportGroups = shouldSort ?
|
|
172331
|
+
const sortedImportGroups = shouldSort ? toSorted(oldImportGroups, (group1, group2) => compareModuleSpecifiersWorker(group1[0].moduleSpecifier, group2[0].moduleSpecifier, comparer.moduleSpecifierComparer ?? defaultComparer)) : oldImportGroups;
|
|
172233
172332
|
const newImportDecls = flatMap(sortedImportGroups, (importGroup) => getExternalModuleName2(importGroup[0].moduleSpecifier) || importGroup[0].moduleSpecifier === void 0 ? coalesce(importGroup) : importGroup);
|
|
172234
172333
|
if (newImportDecls.length === 0) {
|
|
172235
172334
|
changeTracker.deleteNodes(
|
|
@@ -172264,7 +172363,7 @@ function organizeImports(sourceFile, formatContext, host, program, preferences,
|
|
|
172264
172363
|
const processImportsOfSameModuleSpecifier = (importGroup) => {
|
|
172265
172364
|
if (shouldRemove) importGroup = removeUnusedImports(importGroup, sourceFile, program);
|
|
172266
172365
|
if (shouldCombine) importGroup = coalesceImportsWorker(importGroup, detectedModuleCaseComparer, specifierComparer, sourceFile);
|
|
172267
|
-
if (shouldSort) importGroup =
|
|
172366
|
+
if (shouldSort) importGroup = toSorted(importGroup, (s1, s2) => compareImportsOrRequireStatements(s1, s2, detectedModuleCaseComparer));
|
|
172268
172367
|
return importGroup;
|
|
172269
172368
|
};
|
|
172270
172369
|
organizeDeclsWorker(oldImportDecls, processImportsOfSameModuleSpecifier);
|
|
@@ -172440,7 +172539,7 @@ function coalesceImportsWorker(importGroup, comparer, specifierComparer, sourceF
|
|
|
172440
172539
|
const importGroupsByAttributes = groupBy(importGroup, (decl) => {
|
|
172441
172540
|
if (decl.attributes) {
|
|
172442
172541
|
let attrs = decl.attributes.token + " ";
|
|
172443
|
-
for (const x of
|
|
172542
|
+
for (const x of toSorted(decl.attributes.elements, (x2, y) => compareStringsCaseSensitive(x2.name.text, y.name.text))) {
|
|
172444
172543
|
attrs += x.name.text + ":";
|
|
172445
172544
|
attrs += isStringLiteralLike(x.value) ? `"${x.value.text}"` : x.value.getText() + " ";
|
|
172446
172545
|
}
|
|
@@ -172465,7 +172564,7 @@ function coalesceImportsWorker(importGroup, comparer, specifierComparer, sourceF
|
|
|
172465
172564
|
);
|
|
172466
172565
|
continue;
|
|
172467
172566
|
}
|
|
172468
|
-
const sortedNamespaceImports =
|
|
172567
|
+
const sortedNamespaceImports = toSorted(namespaceImports, (i1, i2) => comparer(i1.importClause.namedBindings.name.text, i2.importClause.namedBindings.name.text));
|
|
172469
172568
|
for (const namespaceImport of sortedNamespaceImports) {
|
|
172470
172569
|
coalescedImports.push(
|
|
172471
172570
|
updateImportDeclarationAndClause(
|
|
@@ -172500,7 +172599,7 @@ function coalesceImportsWorker(importGroup, comparer, specifierComparer, sourceF
|
|
|
172500
172599
|
}
|
|
172501
172600
|
newImportSpecifiers.push(...getNewImportSpecifiers(namedImports));
|
|
172502
172601
|
const sortedImportSpecifiers = factory.createNodeArray(
|
|
172503
|
-
|
|
172602
|
+
toSorted(newImportSpecifiers, specifierComparer),
|
|
172504
172603
|
firstNamedImport == null ? void 0 : firstNamedImport.importClause.namedBindings.elements.hasTrailingComma
|
|
172505
172604
|
);
|
|
172506
172605
|
const newNamedImports = sortedImportSpecifiers.length === 0 ? newDefaultImport ? void 0 : factory.createNamedImports(emptyArray) : firstNamedImport ? factory.updateNamedImports(firstNamedImport.importClause.namedBindings, sortedImportSpecifiers) : factory.createNamedImports(sortedImportSpecifiers);
|
|
@@ -172548,7 +172647,7 @@ function coalesceExportsWorker(exportGroup, specifierComparer) {
|
|
|
172548
172647
|
}
|
|
172549
172648
|
const newExportSpecifiers = [];
|
|
172550
172649
|
newExportSpecifiers.push(...flatMap(exportGroup2, (i) => i.exportClause && isNamedExports(i.exportClause) ? i.exportClause.elements : emptyArray));
|
|
172551
|
-
const sortedExportSpecifiers =
|
|
172650
|
+
const sortedExportSpecifiers = toSorted(newExportSpecifiers, specifierComparer);
|
|
172552
172651
|
const exportDecl = exportGroup2[0];
|
|
172553
172652
|
coalescedExports.push(
|
|
172554
172653
|
factory.updateExportDeclaration(
|
|
@@ -175564,7 +175663,7 @@ var changesToText;
|
|
|
175564
175663
|
function getTextChangesFromChanges(changes, newLineCharacter, formatContext, validate) {
|
|
175565
175664
|
return mapDefined(group(changes, (c) => c.sourceFile.path), (changesInFile) => {
|
|
175566
175665
|
const sourceFile = changesInFile[0].sourceFile;
|
|
175567
|
-
const normalized =
|
|
175666
|
+
const normalized = toSorted(changesInFile, (a, b) => a.range.pos - b.range.pos || a.range.end - b.range.end);
|
|
175568
175667
|
for (let i = 0; i < normalized.length - 1; i++) {
|
|
175569
175668
|
Debug.assert(normalized[i].range.end <= normalized[i + 1].range.pos, "Changes overlap", () => `${JSON.stringify(normalized[i].range)} and ${JSON.stringify(normalized[i + 1].range)}`);
|
|
175570
175669
|
}
|
|
@@ -179747,6 +179846,7 @@ __export(ts_exports2, {
|
|
|
179747
179846
|
getNonAugmentationDeclaration: () => getNonAugmentationDeclaration,
|
|
179748
179847
|
getNonDecoratorTokenPosOfNode: () => getNonDecoratorTokenPosOfNode,
|
|
179749
179848
|
getNonIncrementalBuildInfoRoots: () => getNonIncrementalBuildInfoRoots,
|
|
179849
|
+
getNonModifierTokenPosOfNode: () => getNonModifierTokenPosOfNode,
|
|
179750
179850
|
getNormalizedAbsolutePath: () => getNormalizedAbsolutePath,
|
|
179751
179851
|
getNormalizedAbsolutePathWithoutRoot: () => getNormalizedAbsolutePathWithoutRoot,
|
|
179752
179852
|
getNormalizedPathComponents: () => getNormalizedPathComponents,
|
|
@@ -180925,7 +181025,6 @@ __export(ts_exports2, {
|
|
|
180925
181025
|
skipWhile: () => skipWhile,
|
|
180926
181026
|
sliceAfter: () => sliceAfter,
|
|
180927
181027
|
some: () => some,
|
|
180928
|
-
sort: () => sort,
|
|
180929
181028
|
sortAndDeduplicate: () => sortAndDeduplicate,
|
|
180930
181029
|
sortAndDeduplicateDiagnostics: () => sortAndDeduplicateDiagnostics,
|
|
180931
181030
|
sourceFileAffectingCompilerOptions: () => sourceFileAffectingCompilerOptions,
|
|
@@ -180934,7 +181033,6 @@ __export(ts_exports2, {
|
|
|
180934
181033
|
sourceMapCommentRegExpDontCareLineStart: () => sourceMapCommentRegExpDontCareLineStart,
|
|
180935
181034
|
spacePart: () => spacePart,
|
|
180936
181035
|
spanMap: () => spanMap,
|
|
180937
|
-
stableSort: () => stableSort,
|
|
180938
181036
|
startEndContainsRange: () => startEndContainsRange,
|
|
180939
181037
|
startEndOverlapsWithStartEnd: () => startEndOverlapsWithStartEnd,
|
|
180940
181038
|
startOnNewLine: () => startOnNewLine,
|
|
@@ -180993,6 +181091,7 @@ __export(ts_exports2, {
|
|
|
180993
181091
|
toFileNameLowerCase: () => toFileNameLowerCase,
|
|
180994
181092
|
toPath: () => toPath,
|
|
180995
181093
|
toProgramEmitPending: () => toProgramEmitPending,
|
|
181094
|
+
toSorted: () => toSorted,
|
|
180996
181095
|
tokenIsIdentifierOrKeyword: () => tokenIsIdentifierOrKeyword,
|
|
180997
181096
|
tokenIsIdentifierOrKeywordOrGreaterThan: () => tokenIsIdentifierOrKeywordOrGreaterThan,
|
|
180998
181097
|
tokenToString: () => tokenToString,
|
|
@@ -183245,7 +183344,7 @@ var Project2 = class _Project {
|
|
|
183245
183344
|
return { ...newTypeAcquisition, include: this.removeExistingTypings(newTypeAcquisition.include) };
|
|
183246
183345
|
}
|
|
183247
183346
|
getExternalFiles(updateLevel) {
|
|
183248
|
-
return
|
|
183347
|
+
return toSorted(flatMap(this.plugins, (plugin) => {
|
|
183249
183348
|
if (typeof plugin.module.getExternalFiles !== "function") return;
|
|
183250
183349
|
try {
|
|
183251
183350
|
return plugin.module.getExternalFiles(this, updateLevel || 0 /* Update */);
|
|
@@ -183582,7 +183681,7 @@ var Project2 = class _Project {
|
|
|
183582
183681
|
typeAcquisition,
|
|
183583
183682
|
unresolvedImports
|
|
183584
183683
|
};
|
|
183585
|
-
const typingFiles = !typeAcquisition || !typeAcquisition.enable ? emptyArray2 :
|
|
183684
|
+
const typingFiles = !typeAcquisition || !typeAcquisition.enable ? emptyArray2 : toSorted(newTypings);
|
|
183586
183685
|
if (enumerateInsertsAndDeletes(
|
|
183587
183686
|
typingFiles,
|
|
183588
183687
|
this.typingFiles,
|
|
@@ -184296,13 +184395,13 @@ var Project2 = class _Project {
|
|
|
184296
184395
|
var _a, _b, _c, _d;
|
|
184297
184396
|
const originalProgram = this.program;
|
|
184298
184397
|
const rootSourceFile = Debug.checkDefined((_a = this.program) == null ? void 0 : _a.getSourceFile(rootFile), "Expected file to be part of program");
|
|
184299
|
-
const originalText = Debug.checkDefined(rootSourceFile.
|
|
184398
|
+
const originalText = Debug.checkDefined(rootSourceFile.getFullText());
|
|
184300
184399
|
(_b = this.getScriptInfo(rootFile)) == null ? void 0 : _b.editContent(0, originalText.length, updatedText);
|
|
184301
184400
|
this.updateGraph();
|
|
184302
184401
|
try {
|
|
184303
184402
|
cb(this.program, originalProgram, (_c = this.program) == null ? void 0 : _c.getSourceFile(rootFile));
|
|
184304
184403
|
} finally {
|
|
184305
|
-
(_d = this.getScriptInfo(rootFile)) == null ? void 0 : _d.editContent(0,
|
|
184404
|
+
(_d = this.getScriptInfo(rootFile)) == null ? void 0 : _d.editContent(0, updatedText.length, originalText);
|
|
184306
184405
|
}
|
|
184307
184406
|
}
|
|
184308
184407
|
getCompilerOptionsForNoDtsResolutionProject() {
|
|
@@ -191270,42 +191369,12 @@ Project '${project.projectName}' (${ProjectKind[project.projectKind]}) ${counter
|
|
|
191270
191369
|
const prefix = args.prefix || "";
|
|
191271
191370
|
const entries = mapDefined(completions.entries, (entry) => {
|
|
191272
191371
|
if (completions.isMemberCompletion || startsWith(entry.name.toLowerCase(), prefix.toLowerCase())) {
|
|
191273
|
-
const
|
|
191274
|
-
name,
|
|
191275
|
-
kind: kind2,
|
|
191276
|
-
kindModifiers,
|
|
191277
|
-
sortText,
|
|
191278
|
-
insertText,
|
|
191279
|
-
filterText,
|
|
191280
|
-
replacementSpan,
|
|
191281
|
-
hasAction,
|
|
191282
|
-
source,
|
|
191283
|
-
sourceDisplay,
|
|
191284
|
-
labelDetails,
|
|
191285
|
-
isSnippet,
|
|
191286
|
-
isRecommended,
|
|
191287
|
-
isPackageJsonImport,
|
|
191288
|
-
isImportStatementCompletion,
|
|
191289
|
-
data
|
|
191290
|
-
} = entry;
|
|
191291
|
-
const convertedSpan = replacementSpan ? toProtocolTextSpan(replacementSpan, scriptInfo) : void 0;
|
|
191372
|
+
const convertedSpan = entry.replacementSpan ? toProtocolTextSpan(entry.replacementSpan, scriptInfo) : void 0;
|
|
191292
191373
|
return {
|
|
191293
|
-
|
|
191294
|
-
kind: kind2,
|
|
191295
|
-
kindModifiers,
|
|
191296
|
-
sortText,
|
|
191297
|
-
insertText,
|
|
191298
|
-
filterText,
|
|
191374
|
+
...entry,
|
|
191299
191375
|
replacementSpan: convertedSpan,
|
|
191300
|
-
|
|
191301
|
-
|
|
191302
|
-
source,
|
|
191303
|
-
sourceDisplay,
|
|
191304
|
-
labelDetails,
|
|
191305
|
-
isRecommended,
|
|
191306
|
-
isPackageJsonImport,
|
|
191307
|
-
isImportStatementCompletion,
|
|
191308
|
-
data
|
|
191376
|
+
hasAction: entry.hasAction || void 0,
|
|
191377
|
+
symbol: void 0
|
|
191309
191378
|
};
|
|
191310
191379
|
}
|
|
191311
191380
|
});
|
|
@@ -194114,6 +194183,7 @@ if (typeof console !== "undefined") {
|
|
|
194114
194183
|
getNonAugmentationDeclaration,
|
|
194115
194184
|
getNonDecoratorTokenPosOfNode,
|
|
194116
194185
|
getNonIncrementalBuildInfoRoots,
|
|
194186
|
+
getNonModifierTokenPosOfNode,
|
|
194117
194187
|
getNormalizedAbsolutePath,
|
|
194118
194188
|
getNormalizedAbsolutePathWithoutRoot,
|
|
194119
194189
|
getNormalizedPathComponents,
|
|
@@ -195292,7 +195362,6 @@ if (typeof console !== "undefined") {
|
|
|
195292
195362
|
skipWhile,
|
|
195293
195363
|
sliceAfter,
|
|
195294
195364
|
some,
|
|
195295
|
-
sort,
|
|
195296
195365
|
sortAndDeduplicate,
|
|
195297
195366
|
sortAndDeduplicateDiagnostics,
|
|
195298
195367
|
sourceFileAffectingCompilerOptions,
|
|
@@ -195301,7 +195370,6 @@ if (typeof console !== "undefined") {
|
|
|
195301
195370
|
sourceMapCommentRegExpDontCareLineStart,
|
|
195302
195371
|
spacePart,
|
|
195303
195372
|
spanMap,
|
|
195304
|
-
stableSort,
|
|
195305
195373
|
startEndContainsRange,
|
|
195306
195374
|
startEndOverlapsWithStartEnd,
|
|
195307
195375
|
startOnNewLine,
|
|
@@ -195360,6 +195428,7 @@ if (typeof console !== "undefined") {
|
|
|
195360
195428
|
toFileNameLowerCase,
|
|
195361
195429
|
toPath,
|
|
195362
195430
|
toProgramEmitPending,
|
|
195431
|
+
toSorted,
|
|
195363
195432
|
tokenIsIdentifierOrKeyword,
|
|
195364
195433
|
tokenIsIdentifierOrKeywordOrGreaterThan,
|
|
195365
195434
|
tokenToString,
|
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "@typescript-deploys/pr-build",
|
|
3
3
|
"author": "Microsoft Corp.",
|
|
4
4
|
"homepage": "https://www.typescriptlang.org/",
|
|
5
|
-
"version": "5.6.0-pr-
|
|
5
|
+
"version": "5.6.0-pr-59421-2",
|
|
6
6
|
"license": "Apache-2.0",
|
|
7
7
|
"description": "TypeScript is a language for application scale JavaScript development",
|
|
8
8
|
"keywords": [
|
|
@@ -40,7 +40,7 @@
|
|
|
40
40
|
],
|
|
41
41
|
"devDependencies": {
|
|
42
42
|
"@dprint/formatter": "^0.4.1",
|
|
43
|
-
"@dprint/typescript": "0.91.
|
|
43
|
+
"@dprint/typescript": "0.91.4",
|
|
44
44
|
"@esfx/canceltoken": "^1.0.0",
|
|
45
45
|
"@eslint/js": "^8.57.0",
|
|
46
46
|
"@octokit/rest": "^21.0.1",
|
|
@@ -52,7 +52,7 @@
|
|
|
52
52
|
"@types/node": "latest",
|
|
53
53
|
"@types/source-map-support": "^0.5.10",
|
|
54
54
|
"@types/which": "^3.0.4",
|
|
55
|
-
"@typescript-eslint/utils": "^7.
|
|
55
|
+
"@typescript-eslint/utils": "^7.17.0",
|
|
56
56
|
"azure-devops-node-api": "^14.0.1",
|
|
57
57
|
"c8": "^10.1.2",
|
|
58
58
|
"chai": "^4.4.1",
|
|
@@ -70,16 +70,16 @@
|
|
|
70
70
|
"jsonc-parser": "^3.3.1",
|
|
71
71
|
"knip": "^5.26.0",
|
|
72
72
|
"minimist": "^1.2.8",
|
|
73
|
-
"mocha": "^10.
|
|
73
|
+
"mocha": "^10.7.0",
|
|
74
74
|
"mocha-fivemat-progress-reporter": "^0.1.0",
|
|
75
75
|
"monocart-coverage-reports": "^2.9.3",
|
|
76
76
|
"ms": "^2.1.3",
|
|
77
77
|
"node-fetch": "^3.3.2",
|
|
78
|
-
"playwright": "^1.45.
|
|
78
|
+
"playwright": "^1.45.3",
|
|
79
79
|
"source-map-support": "^0.5.21",
|
|
80
80
|
"tslib": "^2.6.3",
|
|
81
|
-
"typescript": "^5.5.
|
|
82
|
-
"typescript-eslint": "^7.
|
|
81
|
+
"typescript": "^5.5.4",
|
|
82
|
+
"typescript-eslint": "^7.17.0",
|
|
83
83
|
"which": "^3.0.1"
|
|
84
84
|
},
|
|
85
85
|
"overrides": {
|