typescript 5.6.0-dev.20240723 → 5.6.0-dev.20240725
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 +47 -21
- package/lib/typescript.d.ts +8 -0
- package/lib/typescript.js +164 -90
- package/package.json +8 -8
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-dev.
|
|
21
|
+
var version = `${versionMajorMinor}.0-dev.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
|
}
|
|
@@ -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];
|
|
@@ -83481,6 +83495,14 @@ function createTypeChecker(host) {
|
|
|
83481
83495
|
}
|
|
83482
83496
|
if (isIdentifier(node.name)) {
|
|
83483
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
|
+
}
|
|
83484
83506
|
}
|
|
83485
83507
|
checkExportsOnMergedDeclarations(node);
|
|
83486
83508
|
const symbol = getSymbolOfDeclaration(node);
|
|
@@ -85654,11 +85676,14 @@ function createTypeChecker(host) {
|
|
|
85654
85676
|
}
|
|
85655
85677
|
function checkSingleIdentifier(node2) {
|
|
85656
85678
|
const nodeLinks2 = getNodeLinks(node2);
|
|
85657
|
-
nodeLinks2.calculatedFlags |= 536870912 /* ConstructorReference
|
|
85658
|
-
if (isIdentifier(node2)
|
|
85659
|
-
|
|
85660
|
-
if (
|
|
85661
|
-
|
|
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
|
+
}
|
|
85662
85687
|
}
|
|
85663
85688
|
}
|
|
85664
85689
|
}
|
|
@@ -113712,6 +113737,7 @@ function emitFiles(resolver, host, targetSourceFile, { scriptTransformers, decla
|
|
|
113712
113737
|
forEachChild(node, collectLinkedAliases);
|
|
113713
113738
|
}
|
|
113714
113739
|
function markLinkedReferences(file) {
|
|
113740
|
+
if (isSourceFileJS(file)) return;
|
|
113715
113741
|
forEachChildRecursively(file, (n) => {
|
|
113716
113742
|
if (isImportEqualsDeclaration(n) && !(getSyntacticModifierFlags(n) & 32 /* Export */)) return "skip";
|
|
113717
113743
|
if (isImportDeclaration(n)) return "skip";
|
|
@@ -114695,7 +114721,7 @@ function createPrinter(printerOptions = {}, handlers = {}) {
|
|
|
114695
114721
|
}
|
|
114696
114722
|
function getSortedEmitHelpers(node) {
|
|
114697
114723
|
const helpers = getEmitHelpers(node);
|
|
114698
|
-
return helpers &&
|
|
114724
|
+
return helpers && toSorted(helpers, compareEmitHelpers);
|
|
114699
114725
|
}
|
|
114700
114726
|
function emitNumericOrBigIntLiteral(node) {
|
|
114701
114727
|
emitLiteral(
|
|
@@ -119778,7 +119804,7 @@ function createProgram(rootNamesOrOptions, _options, _host, _oldProgram, _config
|
|
|
119778
119804
|
});
|
|
119779
119805
|
}
|
|
119780
119806
|
}
|
|
119781
|
-
files =
|
|
119807
|
+
files = toSorted(processingDefaultLibFiles, compareDefaultLibFiles).concat(processingOtherFiles);
|
|
119782
119808
|
processingDefaultLibFiles = void 0;
|
|
119783
119809
|
processingOtherFiles = void 0;
|
|
119784
119810
|
filesWithReferencesProcessed = void 0;
|
|
@@ -128926,7 +128952,7 @@ function shouldBePretty(sys2, options) {
|
|
|
128926
128952
|
return options.pretty;
|
|
128927
128953
|
}
|
|
128928
128954
|
function getOptionsForHelp(commandLine) {
|
|
128929
|
-
return !!commandLine.options.all ?
|
|
128955
|
+
return !!commandLine.options.all ? toSorted(optionDeclarations, (a, b) => compareStringsCaseInsensitive(a.name, b.name)) : filter(optionDeclarations.slice(), (v) => !!v.showInSimplifiedHelpView);
|
|
128930
128956
|
}
|
|
128931
128957
|
function printVersion(sys2) {
|
|
128932
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-dev.
|
|
2262
|
+
var version = `${versionMajorMinor}.0-dev.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
|
}
|
|
@@ -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];
|
|
@@ -88099,6 +88113,14 @@ function createTypeChecker(host) {
|
|
|
88099
88113
|
}
|
|
88100
88114
|
if (isIdentifier(node.name)) {
|
|
88101
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
|
+
}
|
|
88102
88124
|
}
|
|
88103
88125
|
checkExportsOnMergedDeclarations(node);
|
|
88104
88126
|
const symbol = getSymbolOfDeclaration(node);
|
|
@@ -90272,11 +90294,14 @@ function createTypeChecker(host) {
|
|
|
90272
90294
|
}
|
|
90273
90295
|
function checkSingleIdentifier(node2) {
|
|
90274
90296
|
const nodeLinks2 = getNodeLinks(node2);
|
|
90275
|
-
nodeLinks2.calculatedFlags |= 536870912 /* ConstructorReference
|
|
90276
|
-
if (isIdentifier(node2)
|
|
90277
|
-
|
|
90278
|
-
if (
|
|
90279
|
-
|
|
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
|
+
}
|
|
90280
90305
|
}
|
|
90281
90306
|
}
|
|
90282
90307
|
}
|
|
@@ -118523,6 +118548,7 @@ function emitFiles(resolver, host, targetSourceFile, { scriptTransformers, decla
|
|
|
118523
118548
|
forEachChild(node, collectLinkedAliases);
|
|
118524
118549
|
}
|
|
118525
118550
|
function markLinkedReferences(file) {
|
|
118551
|
+
if (isSourceFileJS(file)) return;
|
|
118526
118552
|
forEachChildRecursively(file, (n) => {
|
|
118527
118553
|
if (isImportEqualsDeclaration(n) && !(getSyntacticModifierFlags(n) & 32 /* Export */)) return "skip";
|
|
118528
118554
|
if (isImportDeclaration(n)) return "skip";
|
|
@@ -119506,7 +119532,7 @@ function createPrinter(printerOptions = {}, handlers = {}) {
|
|
|
119506
119532
|
}
|
|
119507
119533
|
function getSortedEmitHelpers(node) {
|
|
119508
119534
|
const helpers = getEmitHelpers(node);
|
|
119509
|
-
return helpers &&
|
|
119535
|
+
return helpers && toSorted(helpers, compareEmitHelpers);
|
|
119510
119536
|
}
|
|
119511
119537
|
function emitNumericOrBigIntLiteral(node) {
|
|
119512
119538
|
emitLiteral(
|
|
@@ -124635,7 +124661,7 @@ function createProgram(rootNamesOrOptions, _options, _host, _oldProgram, _config
|
|
|
124635
124661
|
});
|
|
124636
124662
|
}
|
|
124637
124663
|
}
|
|
124638
|
-
files =
|
|
124664
|
+
files = toSorted(processingDefaultLibFiles, compareDefaultLibFiles).concat(processingOtherFiles);
|
|
124639
124665
|
processingDefaultLibFiles = void 0;
|
|
124640
124666
|
processingOtherFiles = void 0;
|
|
124641
124667
|
filesWithReferencesProcessed = void 0;
|
|
@@ -133900,7 +133926,7 @@ function shouldBePretty(sys2, options) {
|
|
|
133900
133926
|
return options.pretty;
|
|
133901
133927
|
}
|
|
133902
133928
|
function getOptionsForHelp(commandLine) {
|
|
133903
|
-
return !!commandLine.options.all ?
|
|
133929
|
+
return !!commandLine.options.all ? toSorted(optionDeclarations, (a, b) => compareStringsCaseInsensitive(a.name, b.name)) : filter(optionDeclarations.slice(), (v) => !!v.showInSimplifiedHelpView);
|
|
133904
133930
|
}
|
|
133905
133931
|
function printVersion(sys2) {
|
|
133906
133932
|
sys2.write(getDiagnosticText(Diagnostics.Version_0, version) + sys2.newLine);
|
|
@@ -137579,7 +137605,7 @@ function insertImports(changes, sourceFile, imports, blankLineBetween, preferenc
|
|
|
137579
137605
|
const importKindPredicate = decl.kind === 243 /* VariableStatement */ ? isRequireVariableStatement : isAnyImportSyntax;
|
|
137580
137606
|
const existingImportStatements = filter(sourceFile.statements, importKindPredicate);
|
|
137581
137607
|
const { comparer, isSorted } = ts_OrganizeImports_exports.getOrganizeImportsStringComparerWithDetection(existingImportStatements, preferences);
|
|
137582
|
-
const sortedNewImports = isArray(imports) ?
|
|
137608
|
+
const sortedNewImports = isArray(imports) ? toSorted(imports, (a, b) => ts_OrganizeImports_exports.compareImportsOrRequireStatements(a, b, comparer)) : [imports];
|
|
137583
137609
|
if (!(existingImportStatements == null ? void 0 : existingImportStatements.length)) {
|
|
137584
137610
|
if (isFullSourceFile(sourceFile)) {
|
|
137585
137611
|
changes.insertNodesAtTopOfFile(sourceFile, sortedNewImports, blankLineBetween);
|
|
@@ -155600,7 +155626,7 @@ function getFixInfos(context, errorCode, pos, useAutoImportProvider) {
|
|
|
155600
155626
|
}
|
|
155601
155627
|
function sortFixInfo(fixes, sourceFile, program, packageJsonImportFilter, host, preferences) {
|
|
155602
155628
|
const _toPath = (fileName) => toPath(fileName, host.getCurrentDirectory(), hostGetCanonicalFileName(host));
|
|
155603
|
-
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));
|
|
155604
155630
|
}
|
|
155605
155631
|
function getFixInfosWithoutDiagnostic(context, symbolToken, useAutoImportProvider) {
|
|
155606
155632
|
const info = getFixesInfoForNonUMDImport(context, symbolToken, useAutoImportProvider);
|
|
@@ -156046,7 +156072,7 @@ function doAddExistingFix(changes, sourceFile, clause, defaultImport, namedImpor
|
|
|
156046
156072
|
}
|
|
156047
156073
|
if (namedImports.length) {
|
|
156048
156074
|
const { specifierComparer, isSorted } = ts_OrganizeImports_exports.getNamedImportSpecifierComparerWithDetection(clause.parent, preferences, sourceFile);
|
|
156049
|
-
const newSpecifiers =
|
|
156075
|
+
const newSpecifiers = toSorted(
|
|
156050
156076
|
namedImports.map(
|
|
156051
156077
|
(namedImport) => factory.createImportSpecifier(
|
|
156052
156078
|
(!clause.isTypeOnly || promoteFromTypeOnly2) && shouldUseTypeOnly(namedImport, preferences),
|
|
@@ -156063,7 +156089,7 @@ function doAddExistingFix(changes, sourceFile, clause, defaultImport, namedImpor
|
|
|
156063
156089
|
clause.namedBindings,
|
|
156064
156090
|
factory.updateNamedImports(
|
|
156065
156091
|
clause.namedBindings,
|
|
156066
|
-
|
|
156092
|
+
toSorted([...existingSpecifiers.filter((s) => !removeExistingImportSpecifiers.has(s)), ...newSpecifiers], specifierComparer)
|
|
156067
156093
|
)
|
|
156068
156094
|
);
|
|
156069
156095
|
} else if ((existingSpecifiers == null ? void 0 : existingSpecifiers.length) && isSorted !== false) {
|
|
@@ -157324,7 +157350,7 @@ function getInfo10(sourceFile, tokenPos, errorCode, checker, program) {
|
|
|
157324
157350
|
const moduleDeclaration = find(symbol.declarations, isModuleDeclaration);
|
|
157325
157351
|
const moduleDeclarationSourceFile = moduleDeclaration == null ? void 0 : moduleDeclaration.getSourceFile();
|
|
157326
157352
|
if (moduleDeclaration && moduleDeclarationSourceFile && !isSourceFileFromLibrary(program, moduleDeclarationSourceFile)) {
|
|
157327
|
-
return { kind: 2 /* Function */, token, call: parent2.parent, sourceFile, modifierFlags: 32 /* Export */, parentDeclaration: moduleDeclaration };
|
|
157353
|
+
return { kind: 2 /* Function */, token, call: parent2.parent, sourceFile: moduleDeclarationSourceFile, modifierFlags: 32 /* Export */, parentDeclaration: moduleDeclaration };
|
|
157328
157354
|
}
|
|
157329
157355
|
const moduleSourceFile = find(symbol.declarations, isSourceFile);
|
|
157330
157356
|
if (sourceFile.commonJsModuleIndicator) return void 0;
|
|
@@ -162999,6 +163025,7 @@ __export(ts_Completions_exports, {
|
|
|
162999
163025
|
getCompletionEntryDetails: () => getCompletionEntryDetails,
|
|
163000
163026
|
getCompletionEntrySymbol: () => getCompletionEntrySymbol,
|
|
163001
163027
|
getCompletionsAtPosition: () => getCompletionsAtPosition,
|
|
163028
|
+
getDefaultCommitCharacters: () => getDefaultCommitCharacters,
|
|
163002
163029
|
getPropertiesForObjectExpression: () => getPropertiesForObjectExpression,
|
|
163003
163030
|
moduleSpecifierResolutionCacheAttemptLimit: () => moduleSpecifierResolutionCacheAttemptLimit,
|
|
163004
163031
|
moduleSpecifierResolutionLimit: () => moduleSpecifierResolutionLimit
|
|
@@ -163131,6 +163158,12 @@ function resolvingModuleSpecifiers(logPrefix, host, resolver, program, position,
|
|
|
163131
163158
|
return result2 || (needsFullResolution ? "failed" : "skipped");
|
|
163132
163159
|
}
|
|
163133
163160
|
}
|
|
163161
|
+
function getDefaultCommitCharacters(isNewIdentifierLocation) {
|
|
163162
|
+
if (isNewIdentifierLocation) {
|
|
163163
|
+
return [];
|
|
163164
|
+
}
|
|
163165
|
+
return [".", ",", ";"];
|
|
163166
|
+
}
|
|
163134
163167
|
function getCompletionsAtPosition(host, program, log, sourceFile, position, preferences, triggerCharacter, completionKind, cancellationToken, formatContext, includeSymbol = false) {
|
|
163135
163168
|
var _a;
|
|
163136
163169
|
const { previousToken } = getRelevantTokens(position, sourceFile);
|
|
@@ -163139,7 +163172,17 @@ function getCompletionsAtPosition(host, program, log, sourceFile, position, pref
|
|
|
163139
163172
|
}
|
|
163140
163173
|
if (triggerCharacter === " ") {
|
|
163141
163174
|
if (preferences.includeCompletionsForImportStatements && preferences.includeCompletionsWithInsertText) {
|
|
163142
|
-
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
|
+
};
|
|
163143
163186
|
}
|
|
163144
163187
|
return void 0;
|
|
163145
163188
|
}
|
|
@@ -163293,7 +163336,16 @@ function continuePreviousIncompleteResponse(cache, file, location, program, host
|
|
|
163293
163336
|
return previousResponse;
|
|
163294
163337
|
}
|
|
163295
163338
|
function jsdocCompletionInfo(entries) {
|
|
163296
|
-
return {
|
|
163339
|
+
return {
|
|
163340
|
+
isGlobalCompletion: false,
|
|
163341
|
+
isMemberCompletion: false,
|
|
163342
|
+
isNewIdentifierLocation: false,
|
|
163343
|
+
entries,
|
|
163344
|
+
defaultCommitCharacters: getDefaultCommitCharacters(
|
|
163345
|
+
/*isNewIdentifierLocation*/
|
|
163346
|
+
false
|
|
163347
|
+
)
|
|
163348
|
+
};
|
|
163297
163349
|
}
|
|
163298
163350
|
function getJSDocParameterCompletions(sourceFile, position, checker, options, preferences, tagNameOnly) {
|
|
163299
163351
|
const currentToken = getTokenAtPosition(sourceFile, position);
|
|
@@ -163566,7 +163618,8 @@ function specificKeywordCompletionInfo(entries, isNewIdentifierLocation) {
|
|
|
163566
163618
|
isGlobalCompletion: false,
|
|
163567
163619
|
isMemberCompletion: false,
|
|
163568
163620
|
isNewIdentifierLocation,
|
|
163569
|
-
entries: entries.slice()
|
|
163621
|
+
entries: entries.slice(),
|
|
163622
|
+
defaultCommitCharacters: getDefaultCommitCharacters(isNewIdentifierLocation)
|
|
163570
163623
|
};
|
|
163571
163624
|
}
|
|
163572
163625
|
function keywordCompletionData(keywordFilters, filterOutTsOnlyKeywords, isNewIdentifierLocation) {
|
|
@@ -163724,7 +163777,8 @@ function completionInfoFromData(sourceFile, host, program, compilerOptions, log,
|
|
|
163724
163777
|
isMemberCompletion: isMemberCompletionKind(completionKind),
|
|
163725
163778
|
isNewIdentifierLocation,
|
|
163726
163779
|
optionalReplacementSpan: getOptionalReplacementSpan(location),
|
|
163727
|
-
entries
|
|
163780
|
+
entries,
|
|
163781
|
+
defaultCommitCharacters: getDefaultCommitCharacters(isNewIdentifierLocation)
|
|
163728
163782
|
};
|
|
163729
163783
|
}
|
|
163730
163784
|
function isCheckedFile(sourceFile, compilerOptions) {
|
|
@@ -163890,7 +163944,17 @@ function getJsxClosingTagCompletion(location, sourceFile) {
|
|
|
163890
163944
|
kindModifiers: void 0,
|
|
163891
163945
|
sortText: SortText.LocationPriority
|
|
163892
163946
|
};
|
|
163893
|
-
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
|
+
};
|
|
163894
163958
|
}
|
|
163895
163959
|
return;
|
|
163896
163960
|
}
|
|
@@ -163907,7 +163971,8 @@ function getJSCompletionEntries(sourceFile, position, uniqueNames, target, entri
|
|
|
163907
163971
|
kind: "warning" /* warning */,
|
|
163908
163972
|
kindModifiers: "",
|
|
163909
163973
|
sortText: SortText.JavascriptIdentifiers,
|
|
163910
|
-
isFromUncheckedFile: true
|
|
163974
|
+
isFromUncheckedFile: true,
|
|
163975
|
+
commitCharacters: []
|
|
163911
163976
|
}, compareCompletionEntries);
|
|
163912
163977
|
}
|
|
163913
163978
|
});
|
|
@@ -163916,7 +163981,13 @@ function completionNameForLiteral(sourceFile, preferences, literal) {
|
|
|
163916
163981
|
return typeof literal === "object" ? pseudoBigIntToString(literal) + "n" : isString(literal) ? quote(sourceFile, preferences, literal) : JSON.stringify(literal);
|
|
163917
163982
|
}
|
|
163918
163983
|
function createCompletionEntryForLiteral(sourceFile, preferences, literal) {
|
|
163919
|
-
return {
|
|
163984
|
+
return {
|
|
163985
|
+
name: completionNameForLiteral(sourceFile, preferences, literal),
|
|
163986
|
+
kind: "string" /* string */,
|
|
163987
|
+
kindModifiers: "" /* none */,
|
|
163988
|
+
sortText: SortText.LocationPriority,
|
|
163989
|
+
commitCharacters: []
|
|
163990
|
+
};
|
|
163920
163991
|
}
|
|
163921
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) {
|
|
163922
163993
|
var _a, _b;
|
|
@@ -164053,9 +164124,11 @@ function createCompletionEntry(symbol, sortText, replacementToken, contextToken,
|
|
|
164053
164124
|
}
|
|
164054
164125
|
}
|
|
164055
164126
|
}
|
|
164127
|
+
const kind = ts_SymbolDisplay_exports.getSymbolKind(typeChecker, symbol, location);
|
|
164128
|
+
const commitCharacters = kind === "warning" /* warning */ || kind === "string" /* string */ ? [] : void 0;
|
|
164056
164129
|
return {
|
|
164057
164130
|
name,
|
|
164058
|
-
kind
|
|
164131
|
+
kind,
|
|
164059
164132
|
kindModifiers: ts_SymbolDisplay_exports.getSymbolModifiers(typeChecker, symbol),
|
|
164060
164133
|
sortText,
|
|
164061
164134
|
source,
|
|
@@ -164070,6 +164143,7 @@ function createCompletionEntry(symbol, sortText, replacementToken, contextToken,
|
|
|
164070
164143
|
isPackageJsonImport: originIsPackageJsonImport(origin) || void 0,
|
|
164071
164144
|
isImportStatementCompletion: !!importStatementCompletion || void 0,
|
|
164072
164145
|
data,
|
|
164146
|
+
commitCharacters,
|
|
164073
164147
|
...includeSymbol ? { symbol } : void 0
|
|
164074
164148
|
};
|
|
164075
164149
|
}
|
|
@@ -164452,7 +164526,7 @@ function createSnippetPrinter(printerOptions) {
|
|
|
164452
164526
|
{ ...formatContext, options: formatOptions }
|
|
164453
164527
|
);
|
|
164454
164528
|
});
|
|
164455
|
-
const allChanges = escapes ?
|
|
164529
|
+
const allChanges = escapes ? toSorted(concatenate(changes, escapes), (a, b) => compareTextSpans(a.span, b.span)) : changes;
|
|
164456
164530
|
return ts_textChanges_exports.applyChanges(syntheticFile.text, allChanges);
|
|
164457
164531
|
}
|
|
164458
164532
|
function printNode(hint, node, sourceFile) {
|
|
@@ -164488,7 +164562,7 @@ function createSnippetPrinter(printerOptions) {
|
|
|
164488
164562
|
0,
|
|
164489
164563
|
{ ...formatContext, options: formatOptions }
|
|
164490
164564
|
);
|
|
164491
|
-
const allChanges = escapes ?
|
|
164565
|
+
const allChanges = escapes ? toSorted(concatenate(changes, escapes), (a, b) => compareTextSpans(a.span, b.span)) : changes;
|
|
164492
164566
|
return ts_textChanges_exports.applyChanges(syntheticFile.text, allChanges);
|
|
164493
164567
|
}
|
|
164494
164568
|
}
|
|
@@ -164700,7 +164774,16 @@ function getCompletionEntriesFromSymbols(symbols, entries, replacementToken, con
|
|
|
164700
164774
|
function getLabelCompletionAtPosition(node) {
|
|
164701
164775
|
const entries = getLabelStatementCompletions(node);
|
|
164702
164776
|
if (entries.length) {
|
|
164703
|
-
return {
|
|
164777
|
+
return {
|
|
164778
|
+
isGlobalCompletion: false,
|
|
164779
|
+
isMemberCompletion: false,
|
|
164780
|
+
isNewIdentifierLocation: false,
|
|
164781
|
+
entries,
|
|
164782
|
+
defaultCommitCharacters: getDefaultCommitCharacters(
|
|
164783
|
+
/*isNewIdentifierLocation*/
|
|
164784
|
+
false
|
|
164785
|
+
)
|
|
164786
|
+
};
|
|
164704
164787
|
}
|
|
164705
164788
|
}
|
|
164706
164789
|
function getLabelStatementCompletions(node) {
|
|
@@ -166989,7 +167072,14 @@ function convertStringLiteralCompletions(completion, contextToken, sourceFile, h
|
|
|
166989
167072
|
void 0,
|
|
166990
167073
|
includeSymbol
|
|
166991
167074
|
);
|
|
166992
|
-
return {
|
|
167075
|
+
return {
|
|
167076
|
+
isGlobalCompletion: false,
|
|
167077
|
+
isMemberCompletion: true,
|
|
167078
|
+
isNewIdentifierLocation: completion.hasIndexSignature,
|
|
167079
|
+
optionalReplacementSpan,
|
|
167080
|
+
entries,
|
|
167081
|
+
defaultCommitCharacters: getDefaultCommitCharacters(completion.hasIndexSignature)
|
|
167082
|
+
};
|
|
166993
167083
|
}
|
|
166994
167084
|
case 2 /* Types */: {
|
|
166995
167085
|
const quoteChar = contextToken.kind === 15 /* NoSubstitutionTemplateLiteral */ ? 96 /* backtick */ : startsWith(getTextOfNode(contextToken), "'") ? 39 /* singleQuote */ : 34 /* doubleQuote */;
|
|
@@ -166998,9 +167088,17 @@ function convertStringLiteralCompletions(completion, contextToken, sourceFile, h
|
|
|
166998
167088
|
kindModifiers: "" /* none */,
|
|
166999
167089
|
kind: "string" /* string */,
|
|
167000
167090
|
sortText: SortText.LocationPriority,
|
|
167001
|
-
replacementSpan: getReplacementSpanForContextToken(contextToken, position)
|
|
167091
|
+
replacementSpan: getReplacementSpanForContextToken(contextToken, position),
|
|
167092
|
+
commitCharacters: []
|
|
167002
167093
|
}));
|
|
167003
|
-
return {
|
|
167094
|
+
return {
|
|
167095
|
+
isGlobalCompletion: false,
|
|
167096
|
+
isMemberCompletion: false,
|
|
167097
|
+
isNewIdentifierLocation: completion.isNewIdentifier,
|
|
167098
|
+
optionalReplacementSpan,
|
|
167099
|
+
entries,
|
|
167100
|
+
defaultCommitCharacters: getDefaultCommitCharacters(completion.isNewIdentifier)
|
|
167101
|
+
};
|
|
167004
167102
|
}
|
|
167005
167103
|
default:
|
|
167006
167104
|
return Debug.assertNever(completion);
|
|
@@ -167031,7 +167129,13 @@ function convertPathCompletions(pathCompletions) {
|
|
|
167031
167129
|
const isGlobalCompletion = false;
|
|
167032
167130
|
const isNewIdentifierLocation = true;
|
|
167033
167131
|
const entries = pathCompletions.map(({ name, kind, span, extension }) => ({ name, kind, kindModifiers: kindModifiersFromExtension(extension), sortText: SortText.LocationPriority, replacementSpan: span }));
|
|
167034
|
-
return {
|
|
167132
|
+
return {
|
|
167133
|
+
isGlobalCompletion,
|
|
167134
|
+
isMemberCompletion: false,
|
|
167135
|
+
isNewIdentifierLocation,
|
|
167136
|
+
entries,
|
|
167137
|
+
defaultCommitCharacters: getDefaultCommitCharacters(isNewIdentifierLocation)
|
|
167138
|
+
};
|
|
167035
167139
|
}
|
|
167036
167140
|
function kindModifiersFromExtension(extension) {
|
|
167037
167141
|
switch (extension) {
|
|
@@ -172222,7 +172326,7 @@ function organizeImports(sourceFile, formatContext, host, program, preferences,
|
|
|
172222
172326
|
}
|
|
172223
172327
|
setEmitFlags(oldImportDecls[0], 1024 /* NoLeadingComments */);
|
|
172224
172328
|
const oldImportGroups = shouldCombine ? group(oldImportDecls, (importDecl) => getExternalModuleName2(importDecl.moduleSpecifier)) : [oldImportDecls];
|
|
172225
|
-
const sortedImportGroups = shouldSort ?
|
|
172329
|
+
const sortedImportGroups = shouldSort ? toSorted(oldImportGroups, (group1, group2) => compareModuleSpecifiersWorker(group1[0].moduleSpecifier, group2[0].moduleSpecifier, comparer.moduleSpecifierComparer ?? defaultComparer)) : oldImportGroups;
|
|
172226
172330
|
const newImportDecls = flatMap(sortedImportGroups, (importGroup) => getExternalModuleName2(importGroup[0].moduleSpecifier) || importGroup[0].moduleSpecifier === void 0 ? coalesce(importGroup) : importGroup);
|
|
172227
172331
|
if (newImportDecls.length === 0) {
|
|
172228
172332
|
changeTracker.deleteNodes(
|
|
@@ -172257,7 +172361,7 @@ function organizeImports(sourceFile, formatContext, host, program, preferences,
|
|
|
172257
172361
|
const processImportsOfSameModuleSpecifier = (importGroup) => {
|
|
172258
172362
|
if (shouldRemove) importGroup = removeUnusedImports(importGroup, sourceFile, program);
|
|
172259
172363
|
if (shouldCombine) importGroup = coalesceImportsWorker(importGroup, detectedModuleCaseComparer, specifierComparer, sourceFile);
|
|
172260
|
-
if (shouldSort) importGroup =
|
|
172364
|
+
if (shouldSort) importGroup = toSorted(importGroup, (s1, s2) => compareImportsOrRequireStatements(s1, s2, detectedModuleCaseComparer));
|
|
172261
172365
|
return importGroup;
|
|
172262
172366
|
};
|
|
172263
172367
|
organizeDeclsWorker(oldImportDecls, processImportsOfSameModuleSpecifier);
|
|
@@ -172433,7 +172537,7 @@ function coalesceImportsWorker(importGroup, comparer, specifierComparer, sourceF
|
|
|
172433
172537
|
const importGroupsByAttributes = groupBy(importGroup, (decl) => {
|
|
172434
172538
|
if (decl.attributes) {
|
|
172435
172539
|
let attrs = decl.attributes.token + " ";
|
|
172436
|
-
for (const x of
|
|
172540
|
+
for (const x of toSorted(decl.attributes.elements, (x2, y) => compareStringsCaseSensitive(x2.name.text, y.name.text))) {
|
|
172437
172541
|
attrs += x.name.text + ":";
|
|
172438
172542
|
attrs += isStringLiteralLike(x.value) ? `"${x.value.text}"` : x.value.getText() + " ";
|
|
172439
172543
|
}
|
|
@@ -172458,7 +172562,7 @@ function coalesceImportsWorker(importGroup, comparer, specifierComparer, sourceF
|
|
|
172458
172562
|
);
|
|
172459
172563
|
continue;
|
|
172460
172564
|
}
|
|
172461
|
-
const sortedNamespaceImports =
|
|
172565
|
+
const sortedNamespaceImports = toSorted(namespaceImports, (i1, i2) => comparer(i1.importClause.namedBindings.name.text, i2.importClause.namedBindings.name.text));
|
|
172462
172566
|
for (const namespaceImport of sortedNamespaceImports) {
|
|
172463
172567
|
coalescedImports.push(
|
|
172464
172568
|
updateImportDeclarationAndClause(
|
|
@@ -172493,7 +172597,7 @@ function coalesceImportsWorker(importGroup, comparer, specifierComparer, sourceF
|
|
|
172493
172597
|
}
|
|
172494
172598
|
newImportSpecifiers.push(...getNewImportSpecifiers(namedImports));
|
|
172495
172599
|
const sortedImportSpecifiers = factory.createNodeArray(
|
|
172496
|
-
|
|
172600
|
+
toSorted(newImportSpecifiers, specifierComparer),
|
|
172497
172601
|
firstNamedImport == null ? void 0 : firstNamedImport.importClause.namedBindings.elements.hasTrailingComma
|
|
172498
172602
|
);
|
|
172499
172603
|
const newNamedImports = sortedImportSpecifiers.length === 0 ? newDefaultImport ? void 0 : factory.createNamedImports(emptyArray) : firstNamedImport ? factory.updateNamedImports(firstNamedImport.importClause.namedBindings, sortedImportSpecifiers) : factory.createNamedImports(sortedImportSpecifiers);
|
|
@@ -172541,7 +172645,7 @@ function coalesceExportsWorker(exportGroup, specifierComparer) {
|
|
|
172541
172645
|
}
|
|
172542
172646
|
const newExportSpecifiers = [];
|
|
172543
172647
|
newExportSpecifiers.push(...flatMap(exportGroup2, (i) => i.exportClause && isNamedExports(i.exportClause) ? i.exportClause.elements : emptyArray));
|
|
172544
|
-
const sortedExportSpecifiers =
|
|
172648
|
+
const sortedExportSpecifiers = toSorted(newExportSpecifiers, specifierComparer);
|
|
172545
172649
|
const exportDecl = exportGroup2[0];
|
|
172546
172650
|
coalescedExports.push(
|
|
172547
172651
|
factory.updateExportDeclaration(
|
|
@@ -175557,7 +175661,7 @@ var changesToText;
|
|
|
175557
175661
|
function getTextChangesFromChanges(changes, newLineCharacter, formatContext, validate) {
|
|
175558
175662
|
return mapDefined(group(changes, (c) => c.sourceFile.path), (changesInFile) => {
|
|
175559
175663
|
const sourceFile = changesInFile[0].sourceFile;
|
|
175560
|
-
const normalized =
|
|
175664
|
+
const normalized = toSorted(changesInFile, (a, b) => a.range.pos - b.range.pos || a.range.end - b.range.end);
|
|
175561
175665
|
for (let i = 0; i < normalized.length - 1; i++) {
|
|
175562
175666
|
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)}`);
|
|
175563
175667
|
}
|
|
@@ -179740,6 +179844,7 @@ __export(ts_exports2, {
|
|
|
179740
179844
|
getNonAugmentationDeclaration: () => getNonAugmentationDeclaration,
|
|
179741
179845
|
getNonDecoratorTokenPosOfNode: () => getNonDecoratorTokenPosOfNode,
|
|
179742
179846
|
getNonIncrementalBuildInfoRoots: () => getNonIncrementalBuildInfoRoots,
|
|
179847
|
+
getNonModifierTokenPosOfNode: () => getNonModifierTokenPosOfNode,
|
|
179743
179848
|
getNormalizedAbsolutePath: () => getNormalizedAbsolutePath,
|
|
179744
179849
|
getNormalizedAbsolutePathWithoutRoot: () => getNormalizedAbsolutePathWithoutRoot,
|
|
179745
179850
|
getNormalizedPathComponents: () => getNormalizedPathComponents,
|
|
@@ -180918,7 +181023,6 @@ __export(ts_exports2, {
|
|
|
180918
181023
|
skipWhile: () => skipWhile,
|
|
180919
181024
|
sliceAfter: () => sliceAfter,
|
|
180920
181025
|
some: () => some,
|
|
180921
|
-
sort: () => sort,
|
|
180922
181026
|
sortAndDeduplicate: () => sortAndDeduplicate,
|
|
180923
181027
|
sortAndDeduplicateDiagnostics: () => sortAndDeduplicateDiagnostics,
|
|
180924
181028
|
sourceFileAffectingCompilerOptions: () => sourceFileAffectingCompilerOptions,
|
|
@@ -180927,7 +181031,6 @@ __export(ts_exports2, {
|
|
|
180927
181031
|
sourceMapCommentRegExpDontCareLineStart: () => sourceMapCommentRegExpDontCareLineStart,
|
|
180928
181032
|
spacePart: () => spacePart,
|
|
180929
181033
|
spanMap: () => spanMap,
|
|
180930
|
-
stableSort: () => stableSort,
|
|
180931
181034
|
startEndContainsRange: () => startEndContainsRange,
|
|
180932
181035
|
startEndOverlapsWithStartEnd: () => startEndOverlapsWithStartEnd,
|
|
180933
181036
|
startOnNewLine: () => startOnNewLine,
|
|
@@ -180986,6 +181089,7 @@ __export(ts_exports2, {
|
|
|
180986
181089
|
toFileNameLowerCase: () => toFileNameLowerCase,
|
|
180987
181090
|
toPath: () => toPath,
|
|
180988
181091
|
toProgramEmitPending: () => toProgramEmitPending,
|
|
181092
|
+
toSorted: () => toSorted,
|
|
180989
181093
|
tokenIsIdentifierOrKeyword: () => tokenIsIdentifierOrKeyword,
|
|
180990
181094
|
tokenIsIdentifierOrKeywordOrGreaterThan: () => tokenIsIdentifierOrKeywordOrGreaterThan,
|
|
180991
181095
|
tokenToString: () => tokenToString,
|
|
@@ -183238,7 +183342,7 @@ var Project2 = class _Project {
|
|
|
183238
183342
|
return { ...newTypeAcquisition, include: this.removeExistingTypings(newTypeAcquisition.include) };
|
|
183239
183343
|
}
|
|
183240
183344
|
getExternalFiles(updateLevel) {
|
|
183241
|
-
return
|
|
183345
|
+
return toSorted(flatMap(this.plugins, (plugin) => {
|
|
183242
183346
|
if (typeof plugin.module.getExternalFiles !== "function") return;
|
|
183243
183347
|
try {
|
|
183244
183348
|
return plugin.module.getExternalFiles(this, updateLevel || 0 /* Update */);
|
|
@@ -183575,7 +183679,7 @@ var Project2 = class _Project {
|
|
|
183575
183679
|
typeAcquisition,
|
|
183576
183680
|
unresolvedImports
|
|
183577
183681
|
};
|
|
183578
|
-
const typingFiles = !typeAcquisition || !typeAcquisition.enable ? emptyArray2 :
|
|
183682
|
+
const typingFiles = !typeAcquisition || !typeAcquisition.enable ? emptyArray2 : toSorted(newTypings);
|
|
183579
183683
|
if (enumerateInsertsAndDeletes(
|
|
183580
183684
|
typingFiles,
|
|
183581
183685
|
this.typingFiles,
|
|
@@ -191263,42 +191367,12 @@ Project '${project.projectName}' (${ProjectKind[project.projectKind]}) ${counter
|
|
|
191263
191367
|
const prefix = args.prefix || "";
|
|
191264
191368
|
const entries = mapDefined(completions.entries, (entry) => {
|
|
191265
191369
|
if (completions.isMemberCompletion || startsWith(entry.name.toLowerCase(), prefix.toLowerCase())) {
|
|
191266
|
-
const
|
|
191267
|
-
name,
|
|
191268
|
-
kind: kind2,
|
|
191269
|
-
kindModifiers,
|
|
191270
|
-
sortText,
|
|
191271
|
-
insertText,
|
|
191272
|
-
filterText,
|
|
191273
|
-
replacementSpan,
|
|
191274
|
-
hasAction,
|
|
191275
|
-
source,
|
|
191276
|
-
sourceDisplay,
|
|
191277
|
-
labelDetails,
|
|
191278
|
-
isSnippet,
|
|
191279
|
-
isRecommended,
|
|
191280
|
-
isPackageJsonImport,
|
|
191281
|
-
isImportStatementCompletion,
|
|
191282
|
-
data
|
|
191283
|
-
} = entry;
|
|
191284
|
-
const convertedSpan = replacementSpan ? toProtocolTextSpan(replacementSpan, scriptInfo) : void 0;
|
|
191370
|
+
const convertedSpan = entry.replacementSpan ? toProtocolTextSpan(entry.replacementSpan, scriptInfo) : void 0;
|
|
191285
191371
|
return {
|
|
191286
|
-
|
|
191287
|
-
kind: kind2,
|
|
191288
|
-
kindModifiers,
|
|
191289
|
-
sortText,
|
|
191290
|
-
insertText,
|
|
191291
|
-
filterText,
|
|
191372
|
+
...entry,
|
|
191292
191373
|
replacementSpan: convertedSpan,
|
|
191293
|
-
|
|
191294
|
-
|
|
191295
|
-
source,
|
|
191296
|
-
sourceDisplay,
|
|
191297
|
-
labelDetails,
|
|
191298
|
-
isRecommended,
|
|
191299
|
-
isPackageJsonImport,
|
|
191300
|
-
isImportStatementCompletion,
|
|
191301
|
-
data
|
|
191374
|
+
hasAction: entry.hasAction || void 0,
|
|
191375
|
+
symbol: void 0
|
|
191302
191376
|
};
|
|
191303
191377
|
}
|
|
191304
191378
|
});
|
|
@@ -194107,6 +194181,7 @@ if (typeof console !== "undefined") {
|
|
|
194107
194181
|
getNonAugmentationDeclaration,
|
|
194108
194182
|
getNonDecoratorTokenPosOfNode,
|
|
194109
194183
|
getNonIncrementalBuildInfoRoots,
|
|
194184
|
+
getNonModifierTokenPosOfNode,
|
|
194110
194185
|
getNormalizedAbsolutePath,
|
|
194111
194186
|
getNormalizedAbsolutePathWithoutRoot,
|
|
194112
194187
|
getNormalizedPathComponents,
|
|
@@ -195285,7 +195360,6 @@ if (typeof console !== "undefined") {
|
|
|
195285
195360
|
skipWhile,
|
|
195286
195361
|
sliceAfter,
|
|
195287
195362
|
some,
|
|
195288
|
-
sort,
|
|
195289
195363
|
sortAndDeduplicate,
|
|
195290
195364
|
sortAndDeduplicateDiagnostics,
|
|
195291
195365
|
sourceFileAffectingCompilerOptions,
|
|
@@ -195294,7 +195368,6 @@ if (typeof console !== "undefined") {
|
|
|
195294
195368
|
sourceMapCommentRegExpDontCareLineStart,
|
|
195295
195369
|
spacePart,
|
|
195296
195370
|
spanMap,
|
|
195297
|
-
stableSort,
|
|
195298
195371
|
startEndContainsRange,
|
|
195299
195372
|
startEndOverlapsWithStartEnd,
|
|
195300
195373
|
startOnNewLine,
|
|
@@ -195353,6 +195426,7 @@ if (typeof console !== "undefined") {
|
|
|
195353
195426
|
toFileNameLowerCase,
|
|
195354
195427
|
toPath,
|
|
195355
195428
|
toProgramEmitPending,
|
|
195429
|
+
toSorted,
|
|
195356
195430
|
tokenIsIdentifierOrKeyword,
|
|
195357
195431
|
tokenIsIdentifierOrKeywordOrGreaterThan,
|
|
195358
195432
|
tokenToString,
|
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "typescript",
|
|
3
3
|
"author": "Microsoft Corp.",
|
|
4
4
|
"homepage": "https://www.typescriptlang.org/",
|
|
5
|
-
"version": "5.6.0-dev.
|
|
5
|
+
"version": "5.6.0-dev.20240725",
|
|
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": {
|
|
@@ -114,5 +114,5 @@
|
|
|
114
114
|
"node": "20.1.0",
|
|
115
115
|
"npm": "8.19.4"
|
|
116
116
|
},
|
|
117
|
-
"gitHead": "
|
|
117
|
+
"gitHead": "7319968e90600102892a79142fb804bcbe384160"
|
|
118
118
|
}
|