@typescript-deploys/pr-build 5.2.0-pr-54718-7 → 5.2.0-pr-54922-6
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 +150 -115
- package/lib/tsserver.js +323 -172
- package/lib/tsserverlibrary.d.ts +2 -2
- package/lib/tsserverlibrary.js +323 -172
- package/lib/typescript.d.ts +1 -1
- package/lib/typescript.js +310 -160
- package/lib/typingsInstaller.js +83 -74
- package/package.json +2 -2
package/lib/tsserverlibrary.js
CHANGED
|
@@ -35,7 +35,7 @@ var ts = (() => {
|
|
|
35
35
|
"src/compiler/corePublic.ts"() {
|
|
36
36
|
"use strict";
|
|
37
37
|
versionMajorMinor = "5.2";
|
|
38
|
-
version = `${versionMajorMinor}.0-insiders.
|
|
38
|
+
version = `${versionMajorMinor}.0-insiders.20230707`;
|
|
39
39
|
Comparison = /* @__PURE__ */ ((Comparison3) => {
|
|
40
40
|
Comparison3[Comparison3["LessThan"] = -1] = "LessThan";
|
|
41
41
|
Comparison3[Comparison3["EqualTo"] = 0] = "EqualTo";
|
|
@@ -1464,8 +1464,8 @@ var ts = (() => {
|
|
|
1464
1464
|
}
|
|
1465
1465
|
return false;
|
|
1466
1466
|
}
|
|
1467
|
-
function createGetCanonicalFileName(
|
|
1468
|
-
return
|
|
1467
|
+
function createGetCanonicalFileName(useCaseSensitiveFileNames2) {
|
|
1468
|
+
return useCaseSensitiveFileNames2 ? identity : toFileNameLowerCase;
|
|
1469
1469
|
}
|
|
1470
1470
|
function patternText({ prefix, suffix }) {
|
|
1471
1471
|
return `${prefix}*${suffix}`;
|
|
@@ -5425,10 +5425,10 @@ ${lanes.join("\n")}
|
|
|
5425
5425
|
pollingIntervalQueue(pollingInterval).pollScheduled = host.setTimeout(pollingInterval === 250 /* Low */ ? pollLowPollingIntervalQueue : pollPollingIntervalQueue, pollingInterval, pollingInterval === 250 /* Low */ ? "pollLowPollingIntervalQueue" : "pollPollingIntervalQueue", pollingIntervalQueue(pollingInterval));
|
|
5426
5426
|
}
|
|
5427
5427
|
}
|
|
5428
|
-
function createUseFsEventsOnParentDirectoryWatchFile(fsWatch,
|
|
5428
|
+
function createUseFsEventsOnParentDirectoryWatchFile(fsWatch, useCaseSensitiveFileNames2) {
|
|
5429
5429
|
const fileWatcherCallbacks = createMultiMap();
|
|
5430
5430
|
const dirWatchers = /* @__PURE__ */ new Map();
|
|
5431
|
-
const toCanonicalName = createGetCanonicalFileName(
|
|
5431
|
+
const toCanonicalName = createGetCanonicalFileName(useCaseSensitiveFileNames2);
|
|
5432
5432
|
return nonPollingWatchFile;
|
|
5433
5433
|
function nonPollingWatchFile(fileName, callback, _pollingInterval, fallbackOptions) {
|
|
5434
5434
|
const filePath = toCanonicalName(fileName);
|
|
@@ -5504,8 +5504,8 @@ ${lanes.join("\n")}
|
|
|
5504
5504
|
pollScheduled = host.setTimeout(pollQueue, 2e3 /* High */, "pollQueue");
|
|
5505
5505
|
}
|
|
5506
5506
|
}
|
|
5507
|
-
function createSingleWatcherPerName(cache,
|
|
5508
|
-
const toCanonicalFileName = createGetCanonicalFileName(
|
|
5507
|
+
function createSingleWatcherPerName(cache, useCaseSensitiveFileNames2, name, callback, createWatcher) {
|
|
5508
|
+
const toCanonicalFileName = createGetCanonicalFileName(useCaseSensitiveFileNames2);
|
|
5509
5509
|
const path = toCanonicalFileName(name);
|
|
5510
5510
|
const existing = cache.get(path);
|
|
5511
5511
|
if (existing) {
|
|
@@ -5555,7 +5555,7 @@ ${lanes.join("\n")}
|
|
|
5555
5555
|
}
|
|
5556
5556
|
function createDirectoryWatcherSupportingRecursive({
|
|
5557
5557
|
watchDirectory,
|
|
5558
|
-
useCaseSensitiveFileNames,
|
|
5558
|
+
useCaseSensitiveFileNames: useCaseSensitiveFileNames2,
|
|
5559
5559
|
getCurrentDirectory,
|
|
5560
5560
|
getAccessibleSortedChildDirectories,
|
|
5561
5561
|
fileSystemEntryExists,
|
|
@@ -5567,8 +5567,8 @@ ${lanes.join("\n")}
|
|
|
5567
5567
|
const callbackCache = createMultiMap();
|
|
5568
5568
|
const cacheToUpdateChildWatches = /* @__PURE__ */ new Map();
|
|
5569
5569
|
let timerToUpdateChildWatches;
|
|
5570
|
-
const filePathComparer = getStringComparer(!
|
|
5571
|
-
const toCanonicalFilePath = createGetCanonicalFileName(
|
|
5570
|
+
const filePathComparer = getStringComparer(!useCaseSensitiveFileNames2);
|
|
5571
|
+
const toCanonicalFilePath = createGetCanonicalFileName(useCaseSensitiveFileNames2);
|
|
5572
5572
|
return (dirName, callback, recursive, options) => recursive ? createDirectoryWatcher(dirName, options, callback) : watchDirectory(dirName, callback, recursive, options);
|
|
5573
5573
|
function createDirectoryWatcher(dirName, options, callback) {
|
|
5574
5574
|
const dirPath = toCanonicalFilePath(dirName);
|
|
@@ -5735,12 +5735,12 @@ ${lanes.join("\n")}
|
|
|
5735
5735
|
}
|
|
5736
5736
|
}
|
|
5737
5737
|
function isIgnoredPath(path, options) {
|
|
5738
|
-
return some(ignoredPaths, (searchPath) => isInPath(path, searchPath)) || isIgnoredByWatchOptions(path, options,
|
|
5738
|
+
return some(ignoredPaths, (searchPath) => isInPath(path, searchPath)) || isIgnoredByWatchOptions(path, options, useCaseSensitiveFileNames2, getCurrentDirectory);
|
|
5739
5739
|
}
|
|
5740
5740
|
function isInPath(path, searchPath) {
|
|
5741
5741
|
if (stringContains(path, searchPath))
|
|
5742
5742
|
return true;
|
|
5743
|
-
if (
|
|
5743
|
+
if (useCaseSensitiveFileNames2)
|
|
5744
5744
|
return false;
|
|
5745
5745
|
return stringContains(toCanonicalFilePath(path), searchPath);
|
|
5746
5746
|
}
|
|
@@ -5758,14 +5758,14 @@ ${lanes.join("\n")}
|
|
|
5758
5758
|
}
|
|
5759
5759
|
};
|
|
5760
5760
|
}
|
|
5761
|
-
function isIgnoredByWatchOptions(pathToCheck, options,
|
|
5762
|
-
return ((options == null ? void 0 : options.excludeDirectories) || (options == null ? void 0 : options.excludeFiles)) && (matchesExclude(pathToCheck, options == null ? void 0 : options.excludeFiles,
|
|
5761
|
+
function isIgnoredByWatchOptions(pathToCheck, options, useCaseSensitiveFileNames2, getCurrentDirectory) {
|
|
5762
|
+
return ((options == null ? void 0 : options.excludeDirectories) || (options == null ? void 0 : options.excludeFiles)) && (matchesExclude(pathToCheck, options == null ? void 0 : options.excludeFiles, useCaseSensitiveFileNames2, getCurrentDirectory()) || matchesExclude(pathToCheck, options == null ? void 0 : options.excludeDirectories, useCaseSensitiveFileNames2, getCurrentDirectory()));
|
|
5763
5763
|
}
|
|
5764
|
-
function createFsWatchCallbackForDirectoryWatcherCallback(directoryName, callback, options,
|
|
5764
|
+
function createFsWatchCallbackForDirectoryWatcherCallback(directoryName, callback, options, useCaseSensitiveFileNames2, getCurrentDirectory) {
|
|
5765
5765
|
return (eventName, relativeFileName) => {
|
|
5766
5766
|
if (eventName === "rename") {
|
|
5767
5767
|
const fileName = !relativeFileName ? directoryName : normalizePath(combinePaths(directoryName, relativeFileName));
|
|
5768
|
-
if (!relativeFileName || !isIgnoredByWatchOptions(fileName, options,
|
|
5768
|
+
if (!relativeFileName || !isIgnoredByWatchOptions(fileName, options, useCaseSensitiveFileNames2, getCurrentDirectory)) {
|
|
5769
5769
|
callback(fileName);
|
|
5770
5770
|
}
|
|
5771
5771
|
}
|
|
@@ -5778,7 +5778,7 @@ ${lanes.join("\n")}
|
|
|
5778
5778
|
clearTimeout: clearTimeout2,
|
|
5779
5779
|
fsWatchWorker,
|
|
5780
5780
|
fileSystemEntryExists,
|
|
5781
|
-
useCaseSensitiveFileNames,
|
|
5781
|
+
useCaseSensitiveFileNames: useCaseSensitiveFileNames2,
|
|
5782
5782
|
getCurrentDirectory,
|
|
5783
5783
|
fsSupportsRecursiveFsWatch,
|
|
5784
5784
|
getAccessibleSortedChildDirectories,
|
|
@@ -5850,7 +5850,7 @@ ${lanes.join("\n")}
|
|
|
5850
5850
|
);
|
|
5851
5851
|
case 5 /* UseFsEventsOnParentDirectory */:
|
|
5852
5852
|
if (!nonPollingWatchFile) {
|
|
5853
|
-
nonPollingWatchFile = createUseFsEventsOnParentDirectoryWatchFile(fsWatch,
|
|
5853
|
+
nonPollingWatchFile = createUseFsEventsOnParentDirectoryWatchFile(fsWatch, useCaseSensitiveFileNames2);
|
|
5854
5854
|
}
|
|
5855
5855
|
return nonPollingWatchFile(fileName, callback, pollingInterval, getFallbackOptions(options));
|
|
5856
5856
|
default:
|
|
@@ -5899,7 +5899,7 @@ ${lanes.join("\n")}
|
|
|
5899
5899
|
return fsWatch(
|
|
5900
5900
|
directoryName,
|
|
5901
5901
|
1 /* Directory */,
|
|
5902
|
-
createFsWatchCallbackForDirectoryWatcherCallback(directoryName, callback, options,
|
|
5902
|
+
createFsWatchCallbackForDirectoryWatcherCallback(directoryName, callback, options, useCaseSensitiveFileNames2, getCurrentDirectory),
|
|
5903
5903
|
recursive,
|
|
5904
5904
|
500 /* Medium */,
|
|
5905
5905
|
getFallbackOptions(options)
|
|
@@ -5907,7 +5907,7 @@ ${lanes.join("\n")}
|
|
|
5907
5907
|
}
|
|
5908
5908
|
if (!hostRecursiveDirectoryWatcher) {
|
|
5909
5909
|
hostRecursiveDirectoryWatcher = createDirectoryWatcherSupportingRecursive({
|
|
5910
|
-
useCaseSensitiveFileNames,
|
|
5910
|
+
useCaseSensitiveFileNames: useCaseSensitiveFileNames2,
|
|
5911
5911
|
getCurrentDirectory,
|
|
5912
5912
|
fileSystemEntryExists,
|
|
5913
5913
|
getAccessibleSortedChildDirectories,
|
|
@@ -5953,7 +5953,7 @@ ${lanes.join("\n")}
|
|
|
5953
5953
|
return fsWatch(
|
|
5954
5954
|
directoryName,
|
|
5955
5955
|
1 /* Directory */,
|
|
5956
|
-
createFsWatchCallbackForDirectoryWatcherCallback(directoryName, callback, options,
|
|
5956
|
+
createFsWatchCallbackForDirectoryWatcherCallback(directoryName, callback, options, useCaseSensitiveFileNames2, getCurrentDirectory),
|
|
5957
5957
|
recursive,
|
|
5958
5958
|
500 /* Medium */,
|
|
5959
5959
|
getFallbackOptions(watchDirectoryOptions)
|
|
@@ -5981,7 +5981,7 @@ ${lanes.join("\n")}
|
|
|
5981
5981
|
function pollingWatchFile(fileName, callback, pollingInterval, options) {
|
|
5982
5982
|
return createSingleWatcherPerName(
|
|
5983
5983
|
pollingWatches,
|
|
5984
|
-
|
|
5984
|
+
useCaseSensitiveFileNames2,
|
|
5985
5985
|
fileName,
|
|
5986
5986
|
callback,
|
|
5987
5987
|
(cb) => pollingWatchFileWorker(fileName, cb, pollingInterval, options)
|
|
@@ -5990,7 +5990,7 @@ ${lanes.join("\n")}
|
|
|
5990
5990
|
function fsWatch(fileOrDirectory, entryKind, callback, recursive, fallbackPollingInterval, fallbackOptions) {
|
|
5991
5991
|
return createSingleWatcherPerName(
|
|
5992
5992
|
recursive ? fsWatchesRecursive : fsWatches,
|
|
5993
|
-
|
|
5993
|
+
useCaseSensitiveFileNames2,
|
|
5994
5994
|
fileOrDirectory,
|
|
5995
5995
|
callback,
|
|
5996
5996
|
(cb) => fsWatchHandlingExistenceOnHost(fileOrDirectory, entryKind, cb, recursive, fallbackPollingInterval, fallbackOptions)
|
|
@@ -6149,7 +6149,7 @@ ${lanes.join("\n")}
|
|
|
6149
6149
|
const Buffer2 = require("buffer").Buffer;
|
|
6150
6150
|
const isLinuxOrMacOs = process.platform === "linux" || process.platform === "darwin";
|
|
6151
6151
|
const platform = _os.platform();
|
|
6152
|
-
const
|
|
6152
|
+
const useCaseSensitiveFileNames2 = isFileSystemCaseSensitive();
|
|
6153
6153
|
const fsRealpath = !!_fs.realpathSync.native ? process.platform === "win32" ? fsRealPathHandlingLongPath : _fs.realpathSync.native : _fs.realpathSync;
|
|
6154
6154
|
const executingFilePath = __filename.endsWith("sys.js") ? _path.join(_path.dirname(__dirname), "__fake__.js") : __filename;
|
|
6155
6155
|
const fsSupportsRecursiveFsWatch = process.platform === "win32" || process.platform === "darwin";
|
|
@@ -6160,7 +6160,7 @@ ${lanes.join("\n")}
|
|
|
6160
6160
|
setTimeout,
|
|
6161
6161
|
clearTimeout,
|
|
6162
6162
|
fsWatchWorker,
|
|
6163
|
-
useCaseSensitiveFileNames,
|
|
6163
|
+
useCaseSensitiveFileNames: useCaseSensitiveFileNames2,
|
|
6164
6164
|
getCurrentDirectory,
|
|
6165
6165
|
fileSystemEntryExists,
|
|
6166
6166
|
// Node 4.0 `fs.watch` function supports the "recursive" option on both OSX and Windows
|
|
@@ -6177,7 +6177,7 @@ ${lanes.join("\n")}
|
|
|
6177
6177
|
const nodeSystem = {
|
|
6178
6178
|
args: process.argv.slice(2),
|
|
6179
6179
|
newLine: _os.EOL,
|
|
6180
|
-
useCaseSensitiveFileNames,
|
|
6180
|
+
useCaseSensitiveFileNames: useCaseSensitiveFileNames2,
|
|
6181
6181
|
write(s) {
|
|
6182
6182
|
process.stdout.write(s);
|
|
6183
6183
|
},
|
|
@@ -6306,12 +6306,12 @@ ${lanes.join("\n")}
|
|
|
6306
6306
|
for (const node of profile.nodes) {
|
|
6307
6307
|
if (node.callFrame.url) {
|
|
6308
6308
|
const url = normalizeSlashes(node.callFrame.url);
|
|
6309
|
-
if (containsPath(fileUrlRoot, url,
|
|
6309
|
+
if (containsPath(fileUrlRoot, url, useCaseSensitiveFileNames2)) {
|
|
6310
6310
|
node.callFrame.url = getRelativePathToDirectoryOrUrl(
|
|
6311
6311
|
fileUrlRoot,
|
|
6312
6312
|
url,
|
|
6313
6313
|
fileUrlRoot,
|
|
6314
|
-
createGetCanonicalFileName(
|
|
6314
|
+
createGetCanonicalFileName(useCaseSensitiveFileNames2),
|
|
6315
6315
|
/*isAbsolutePathAnUrl*/
|
|
6316
6316
|
true
|
|
6317
6317
|
);
|
|
@@ -6491,7 +6491,7 @@ ${lanes.join("\n")}
|
|
|
6491
6491
|
}
|
|
6492
6492
|
}
|
|
6493
6493
|
function readDirectory(path, extensions, excludes, includes, depth) {
|
|
6494
|
-
return matchFiles(path, extensions, excludes, includes,
|
|
6494
|
+
return matchFiles(path, extensions, excludes, includes, useCaseSensitiveFileNames2, process.cwd(), depth, getAccessibleFileSystemEntries, realpath);
|
|
6495
6495
|
}
|
|
6496
6496
|
function fileSystemEntryExists(path, entryKind) {
|
|
6497
6497
|
const originalStackTraceLimit = Error.stackTraceLimit;
|
|
@@ -8769,6 +8769,7 @@ ${lanes.join("\n")}
|
|
|
8769
8769
|
Parameter_modifiers_can_only_be_used_in_TypeScript_files: diag(8012, 1 /* Error */, "Parameter_modifiers_can_only_be_used_in_TypeScript_files_8012", "Parameter modifiers can only be used in TypeScript files."),
|
|
8770
8770
|
Non_null_assertions_can_only_be_used_in_TypeScript_files: diag(8013, 1 /* Error */, "Non_null_assertions_can_only_be_used_in_TypeScript_files_8013", "Non-null assertions can only be used in TypeScript files."),
|
|
8771
8771
|
Type_assertion_expressions_can_only_be_used_in_TypeScript_files: diag(8016, 1 /* Error */, "Type_assertion_expressions_can_only_be_used_in_TypeScript_files_8016", "Type assertion expressions can only be used in TypeScript files."),
|
|
8772
|
+
Signature_declarations_can_only_be_used_in_TypeScript_files: diag(8017, 1 /* Error */, "Signature_declarations_can_only_be_used_in_TypeScript_files_8017", "Signature declarations can only be used in TypeScript files."),
|
|
8772
8773
|
Report_errors_in_js_files: diag(8019, 3 /* Message */, "Report_errors_in_js_files_8019", "Report errors in .js files."),
|
|
8773
8774
|
JSDoc_types_can_only_be_used_inside_documentation_comments: diag(8020, 1 /* Error */, "JSDoc_types_can_only_be_used_inside_documentation_comments_8020", "JSDoc types can only be used inside documentation comments."),
|
|
8774
8775
|
JSDoc_typedef_tag_should_either_have_a_type_annotation_or_be_followed_by_property_or_member_tags: diag(8021, 1 /* Error */, "JSDoc_typedef_tag_should_either_have_a_type_annotation_or_be_followed_by_property_or_member_tags_8021", "JSDoc '@typedef' tag should either have a type annotation or be followed by '@property' or '@member' tags."),
|
|
@@ -9738,7 +9739,7 @@ ${lanes.join("\n")}
|
|
|
9738
9739
|
if (withMinus)
|
|
9739
9740
|
start2--;
|
|
9740
9741
|
error2(Diagnostics.Octal_literals_are_not_allowed_Use_the_syntax_0, start2, pos - start2, literal);
|
|
9741
|
-
return
|
|
9742
|
+
return 9 /* NumericLiteral */;
|
|
9742
9743
|
}
|
|
9743
9744
|
} else {
|
|
9744
9745
|
mainFragment = scanNumberFragment();
|
|
@@ -9778,20 +9779,18 @@ ${lanes.join("\n")}
|
|
|
9778
9779
|
}
|
|
9779
9780
|
if (tokenFlags & 8192 /* ContainsLeadingZero */) {
|
|
9780
9781
|
error2(Diagnostics.Decimals_with_leading_zeros_are_not_allowed, start2, end2 - start2);
|
|
9781
|
-
|
|
9782
|
+
tokenValue = "" + +result;
|
|
9783
|
+
return 9 /* NumericLiteral */;
|
|
9782
9784
|
}
|
|
9783
9785
|
if (decimalFragment !== void 0 || tokenFlags & 16 /* Scientific */) {
|
|
9784
9786
|
checkForIdentifierStartAfterNumericLiteral(start2, decimalFragment === void 0 && !!(tokenFlags & 16 /* Scientific */));
|
|
9785
|
-
|
|
9786
|
-
|
|
9787
|
-
value: "" + +result
|
|
9788
|
-
// if value is not an integer, it can be safely coerced to a number
|
|
9789
|
-
};
|
|
9787
|
+
tokenValue = "" + +result;
|
|
9788
|
+
return 9 /* NumericLiteral */;
|
|
9790
9789
|
} else {
|
|
9791
9790
|
tokenValue = result;
|
|
9792
9791
|
const type = checkBigIntSuffix();
|
|
9793
9792
|
checkForIdentifierStartAfterNumericLiteral(start2);
|
|
9794
|
-
return
|
|
9793
|
+
return type;
|
|
9795
9794
|
}
|
|
9796
9795
|
}
|
|
9797
9796
|
function checkForIdentifierStartAfterNumericLiteral(numericStart, isScientific) {
|
|
@@ -10400,7 +10399,7 @@ ${lanes.join("\n")}
|
|
|
10400
10399
|
return token = 41 /* MinusToken */;
|
|
10401
10400
|
case 46 /* dot */:
|
|
10402
10401
|
if (isDigit(text.charCodeAt(pos + 1))) {
|
|
10403
|
-
|
|
10402
|
+
scanNumber();
|
|
10404
10403
|
return token = 9 /* NumericLiteral */;
|
|
10405
10404
|
}
|
|
10406
10405
|
if (text.charCodeAt(pos + 1) === 46 /* dot */ && text.charCodeAt(pos + 2) === 46 /* dot */) {
|
|
@@ -10518,8 +10517,7 @@ ${lanes.join("\n")}
|
|
|
10518
10517
|
case 55 /* _7 */:
|
|
10519
10518
|
case 56 /* _8 */:
|
|
10520
10519
|
case 57 /* _9 */:
|
|
10521
|
-
|
|
10522
|
-
return token;
|
|
10520
|
+
return token = scanNumber();
|
|
10523
10521
|
case 58 /* colon */:
|
|
10524
10522
|
pos++;
|
|
10525
10523
|
return token = 59 /* ColonToken */;
|
|
@@ -18404,7 +18402,7 @@ ${lanes.join("\n")}
|
|
|
18404
18402
|
function replaceWildcardCharacter(match, singleAsteriskRegexFragment) {
|
|
18405
18403
|
return match === "*" ? singleAsteriskRegexFragment : match === "?" ? "[^/]" : "\\" + match;
|
|
18406
18404
|
}
|
|
18407
|
-
function getFileMatcherPatterns(path, excludes, includes,
|
|
18405
|
+
function getFileMatcherPatterns(path, excludes, includes, useCaseSensitiveFileNames2, currentDirectory) {
|
|
18408
18406
|
path = normalizePath(path);
|
|
18409
18407
|
currentDirectory = normalizePath(currentDirectory);
|
|
18410
18408
|
const absolutePath = combinePaths(currentDirectory, path);
|
|
@@ -18413,22 +18411,22 @@ ${lanes.join("\n")}
|
|
|
18413
18411
|
includeFilePattern: getRegularExpressionForWildcard(includes, absolutePath, "files"),
|
|
18414
18412
|
includeDirectoryPattern: getRegularExpressionForWildcard(includes, absolutePath, "directories"),
|
|
18415
18413
|
excludePattern: getRegularExpressionForWildcard(excludes, absolutePath, "exclude"),
|
|
18416
|
-
basePaths: getBasePaths(path, includes,
|
|
18414
|
+
basePaths: getBasePaths(path, includes, useCaseSensitiveFileNames2)
|
|
18417
18415
|
};
|
|
18418
18416
|
}
|
|
18419
|
-
function getRegexFromPattern(pattern,
|
|
18420
|
-
return new RegExp(pattern,
|
|
18417
|
+
function getRegexFromPattern(pattern, useCaseSensitiveFileNames2) {
|
|
18418
|
+
return new RegExp(pattern, useCaseSensitiveFileNames2 ? "" : "i");
|
|
18421
18419
|
}
|
|
18422
|
-
function matchFiles(path, extensions, excludes, includes,
|
|
18420
|
+
function matchFiles(path, extensions, excludes, includes, useCaseSensitiveFileNames2, currentDirectory, depth, getFileSystemEntries, realpath) {
|
|
18423
18421
|
path = normalizePath(path);
|
|
18424
18422
|
currentDirectory = normalizePath(currentDirectory);
|
|
18425
|
-
const patterns = getFileMatcherPatterns(path, excludes, includes,
|
|
18426
|
-
const includeFileRegexes = patterns.includeFilePatterns && patterns.includeFilePatterns.map((pattern) => getRegexFromPattern(pattern,
|
|
18427
|
-
const includeDirectoryRegex = patterns.includeDirectoryPattern && getRegexFromPattern(patterns.includeDirectoryPattern,
|
|
18428
|
-
const excludeRegex = patterns.excludePattern && getRegexFromPattern(patterns.excludePattern,
|
|
18423
|
+
const patterns = getFileMatcherPatterns(path, excludes, includes, useCaseSensitiveFileNames2, currentDirectory);
|
|
18424
|
+
const includeFileRegexes = patterns.includeFilePatterns && patterns.includeFilePatterns.map((pattern) => getRegexFromPattern(pattern, useCaseSensitiveFileNames2));
|
|
18425
|
+
const includeDirectoryRegex = patterns.includeDirectoryPattern && getRegexFromPattern(patterns.includeDirectoryPattern, useCaseSensitiveFileNames2);
|
|
18426
|
+
const excludeRegex = patterns.excludePattern && getRegexFromPattern(patterns.excludePattern, useCaseSensitiveFileNames2);
|
|
18429
18427
|
const results = includeFileRegexes ? includeFileRegexes.map(() => []) : [[]];
|
|
18430
18428
|
const visited = /* @__PURE__ */ new Map();
|
|
18431
|
-
const toCanonical = createGetCanonicalFileName(
|
|
18429
|
+
const toCanonical = createGetCanonicalFileName(useCaseSensitiveFileNames2);
|
|
18432
18430
|
for (const basePath of patterns.basePaths) {
|
|
18433
18431
|
visitDirectory(basePath, combinePaths(currentDirectory, basePath), depth);
|
|
18434
18432
|
}
|
|
@@ -18470,7 +18468,7 @@ ${lanes.join("\n")}
|
|
|
18470
18468
|
}
|
|
18471
18469
|
}
|
|
18472
18470
|
}
|
|
18473
|
-
function getBasePaths(path, includes,
|
|
18471
|
+
function getBasePaths(path, includes, useCaseSensitiveFileNames2) {
|
|
18474
18472
|
const basePaths = [path];
|
|
18475
18473
|
if (includes) {
|
|
18476
18474
|
const includeBasePaths = [];
|
|
@@ -18478,9 +18476,9 @@ ${lanes.join("\n")}
|
|
|
18478
18476
|
const absolute = isRootedDiskPath(include) ? include : normalizePath(combinePaths(path, include));
|
|
18479
18477
|
includeBasePaths.push(getIncludeBasePath(absolute));
|
|
18480
18478
|
}
|
|
18481
|
-
includeBasePaths.sort(getStringComparer(!
|
|
18479
|
+
includeBasePaths.sort(getStringComparer(!useCaseSensitiveFileNames2));
|
|
18482
18480
|
for (const includeBasePath of includeBasePaths) {
|
|
18483
|
-
if (every(basePaths, (basePath) => !containsPath(basePath, includeBasePath, path, !
|
|
18481
|
+
if (every(basePaths, (basePath) => !containsPath(basePath, includeBasePath, path, !useCaseSensitiveFileNames2))) {
|
|
18484
18482
|
basePaths.push(includeBasePath);
|
|
18485
18483
|
}
|
|
18486
18484
|
}
|
|
@@ -29065,7 +29063,8 @@ ${lanes.join("\n")}
|
|
|
29065
29063
|
nextToken();
|
|
29066
29064
|
const statements = parseList(0 /* SourceElements */, parseStatement);
|
|
29067
29065
|
Debug.assert(token() === 1 /* EndOfFileToken */);
|
|
29068
|
-
const
|
|
29066
|
+
const endHasJSDoc = hasPrecedingJSDocComment();
|
|
29067
|
+
const endOfFileToken = withJSDoc(parseTokenNode(), endHasJSDoc);
|
|
29069
29068
|
const sourceFile = createSourceFile2(fileName, languageVersion2, scriptKind2, isDeclarationFile, statements, endOfFileToken, sourceFlags, setExternalModuleIndicator2);
|
|
29070
29069
|
processCommentPragmas(sourceFile, sourceText);
|
|
29071
29070
|
processPragmasIntoFields(sourceFile, reportPragmaDiagnostic);
|
|
@@ -29085,11 +29084,11 @@ ${lanes.join("\n")}
|
|
|
29085
29084
|
parseDiagnostics.push(createDetachedDiagnostic(fileName, pos, end, diagnostic));
|
|
29086
29085
|
}
|
|
29087
29086
|
}
|
|
29088
|
-
function withJSDoc(node, hasJSDoc) {
|
|
29089
|
-
return hasJSDoc ? addJSDocComment(node) : node;
|
|
29090
|
-
}
|
|
29091
29087
|
let hasDeprecatedTag = false;
|
|
29092
|
-
function
|
|
29088
|
+
function withJSDoc(node, hasJSDoc) {
|
|
29089
|
+
if (!hasJSDoc) {
|
|
29090
|
+
return node;
|
|
29091
|
+
}
|
|
29093
29092
|
Debug.assert(!node.jsDoc);
|
|
29094
29093
|
const jsDoc = mapDefined(getJSDocCommentRanges(node, sourceText), (comment) => JSDocParser.parseJSDocComment(node, comment.pos, comment.end - comment.pos));
|
|
29095
29094
|
if (jsDoc.length)
|
|
@@ -31604,12 +31603,14 @@ ${lanes.join("\n")}
|
|
|
31604
31603
|
return arrowExpression;
|
|
31605
31604
|
}
|
|
31606
31605
|
const pos = getNodePos();
|
|
31606
|
+
const hasJSDoc = hasPrecedingJSDocComment();
|
|
31607
31607
|
const expr = parseBinaryExpressionOrHigher(0 /* Lowest */);
|
|
31608
31608
|
if (expr.kind === 80 /* Identifier */ && token() === 39 /* EqualsGreaterThanToken */) {
|
|
31609
31609
|
return parseSimpleArrowFunctionExpression(
|
|
31610
31610
|
pos,
|
|
31611
31611
|
expr,
|
|
31612
31612
|
allowReturnTypeInArrowFunction,
|
|
31613
|
+
hasJSDoc,
|
|
31613
31614
|
/*asyncModifier*/
|
|
31614
31615
|
void 0
|
|
31615
31616
|
);
|
|
@@ -31655,7 +31656,7 @@ ${lanes.join("\n")}
|
|
|
31655
31656
|
), pos);
|
|
31656
31657
|
}
|
|
31657
31658
|
}
|
|
31658
|
-
function parseSimpleArrowFunctionExpression(pos, identifier, allowReturnTypeInArrowFunction, asyncModifier) {
|
|
31659
|
+
function parseSimpleArrowFunctionExpression(pos, identifier, allowReturnTypeInArrowFunction, hasJSDoc, asyncModifier) {
|
|
31659
31660
|
Debug.assert(token() === 39 /* EqualsGreaterThanToken */, "parseSimpleArrowFunctionExpression should only have been called if we had a =>");
|
|
31660
31661
|
const parameter = factory2.createParameterDeclaration(
|
|
31661
31662
|
/*modifiers*/
|
|
@@ -31688,7 +31689,7 @@ ${lanes.join("\n")}
|
|
|
31688
31689
|
equalsGreaterThanToken,
|
|
31689
31690
|
body
|
|
31690
31691
|
);
|
|
31691
|
-
return
|
|
31692
|
+
return withJSDoc(finishNode(node, pos), hasJSDoc);
|
|
31692
31693
|
}
|
|
31693
31694
|
function tryParseParenthesizedArrowFunctionExpression(allowReturnTypeInArrowFunction) {
|
|
31694
31695
|
const triState = isParenthesizedArrowFunctionExpression();
|
|
@@ -31816,9 +31817,10 @@ ${lanes.join("\n")}
|
|
|
31816
31817
|
if (token() === 134 /* AsyncKeyword */) {
|
|
31817
31818
|
if (lookAhead(isUnParenthesizedAsyncArrowFunctionWorker) === 1 /* True */) {
|
|
31818
31819
|
const pos = getNodePos();
|
|
31820
|
+
const hasJSDoc = hasPrecedingJSDocComment();
|
|
31819
31821
|
const asyncModifier = parseModifiersForArrowFunction();
|
|
31820
31822
|
const expr = parseBinaryExpressionOrHigher(0 /* Lowest */);
|
|
31821
|
-
return parseSimpleArrowFunctionExpression(pos, expr, allowReturnTypeInArrowFunction, asyncModifier);
|
|
31823
|
+
return parseSimpleArrowFunctionExpression(pos, expr, allowReturnTypeInArrowFunction, hasJSDoc, asyncModifier);
|
|
31822
31824
|
}
|
|
31823
31825
|
}
|
|
31824
31826
|
return void 0;
|
|
@@ -37267,19 +37269,19 @@ ${lanes.join("\n")}
|
|
|
37267
37269
|
const wildcardFiles = arrayFrom(wildcardFileMap.values());
|
|
37268
37270
|
return literalFiles.concat(wildcardFiles, arrayFrom(wildCardJsonFileMap.values()));
|
|
37269
37271
|
}
|
|
37270
|
-
function isExcludedFile(pathToCheck, spec, basePath,
|
|
37272
|
+
function isExcludedFile(pathToCheck, spec, basePath, useCaseSensitiveFileNames2, currentDirectory) {
|
|
37271
37273
|
const { validatedFilesSpec, validatedIncludeSpecs, validatedExcludeSpecs } = spec;
|
|
37272
37274
|
if (!length(validatedIncludeSpecs) || !length(validatedExcludeSpecs))
|
|
37273
37275
|
return false;
|
|
37274
37276
|
basePath = normalizePath(basePath);
|
|
37275
|
-
const keyMapper = createGetCanonicalFileName(
|
|
37277
|
+
const keyMapper = createGetCanonicalFileName(useCaseSensitiveFileNames2);
|
|
37276
37278
|
if (validatedFilesSpec) {
|
|
37277
37279
|
for (const fileName of validatedFilesSpec) {
|
|
37278
37280
|
if (keyMapper(getNormalizedAbsolutePath(fileName, basePath)) === pathToCheck)
|
|
37279
37281
|
return false;
|
|
37280
37282
|
}
|
|
37281
37283
|
}
|
|
37282
|
-
return matchesExcludeWorker(pathToCheck, validatedExcludeSpecs,
|
|
37284
|
+
return matchesExcludeWorker(pathToCheck, validatedExcludeSpecs, useCaseSensitiveFileNames2, currentDirectory, basePath);
|
|
37283
37285
|
}
|
|
37284
37286
|
function invalidDotDotAfterRecursiveWildcard(s) {
|
|
37285
37287
|
const wildcardIndex = startsWith(s, "**/") ? 0 : s.indexOf("/**/");
|
|
@@ -37289,17 +37291,17 @@ ${lanes.join("\n")}
|
|
|
37289
37291
|
const lastDotIndex = endsWith(s, "/..") ? s.length : s.lastIndexOf("/../");
|
|
37290
37292
|
return lastDotIndex > wildcardIndex;
|
|
37291
37293
|
}
|
|
37292
|
-
function matchesExclude(pathToCheck, excludeSpecs,
|
|
37294
|
+
function matchesExclude(pathToCheck, excludeSpecs, useCaseSensitiveFileNames2, currentDirectory) {
|
|
37293
37295
|
return matchesExcludeWorker(
|
|
37294
37296
|
pathToCheck,
|
|
37295
37297
|
filter(excludeSpecs, (spec) => !invalidDotDotAfterRecursiveWildcard(spec)),
|
|
37296
|
-
|
|
37298
|
+
useCaseSensitiveFileNames2,
|
|
37297
37299
|
currentDirectory
|
|
37298
37300
|
);
|
|
37299
37301
|
}
|
|
37300
|
-
function matchesExcludeWorker(pathToCheck, excludeSpecs,
|
|
37302
|
+
function matchesExcludeWorker(pathToCheck, excludeSpecs, useCaseSensitiveFileNames2, currentDirectory, basePath) {
|
|
37301
37303
|
const excludePattern = getRegularExpressionForWildcard(excludeSpecs, combinePaths(normalizePath(currentDirectory), basePath), "exclude");
|
|
37302
|
-
const excludeRegex = excludePattern && getRegexFromPattern(excludePattern,
|
|
37304
|
+
const excludeRegex = excludePattern && getRegexFromPattern(excludePattern, useCaseSensitiveFileNames2);
|
|
37303
37305
|
if (!excludeRegex)
|
|
37304
37306
|
return false;
|
|
37305
37307
|
if (excludeRegex.test(pathToCheck))
|
|
@@ -37329,9 +37331,9 @@ ${lanes.join("\n")}
|
|
|
37329
37331
|
return [Diagnostics.File_specification_cannot_contain_a_parent_directory_that_appears_after_a_recursive_directory_wildcard_Asterisk_Asterisk_Colon_0, spec];
|
|
37330
37332
|
}
|
|
37331
37333
|
}
|
|
37332
|
-
function getWildcardDirectories({ validatedIncludeSpecs: include, validatedExcludeSpecs: exclude }, path,
|
|
37334
|
+
function getWildcardDirectories({ validatedIncludeSpecs: include, validatedExcludeSpecs: exclude }, path, useCaseSensitiveFileNames2) {
|
|
37333
37335
|
const rawExcludeRegex = getRegularExpressionForWildcard(exclude, path, "exclude");
|
|
37334
|
-
const excludeRegex = rawExcludeRegex && new RegExp(rawExcludeRegex,
|
|
37336
|
+
const excludeRegex = rawExcludeRegex && new RegExp(rawExcludeRegex, useCaseSensitiveFileNames2 ? "" : "i");
|
|
37335
37337
|
const wildcardDirectories = {};
|
|
37336
37338
|
if (include !== void 0) {
|
|
37337
37339
|
const recursiveKeys = [];
|
|
@@ -37340,7 +37342,7 @@ ${lanes.join("\n")}
|
|
|
37340
37342
|
if (excludeRegex && excludeRegex.test(spec)) {
|
|
37341
37343
|
continue;
|
|
37342
37344
|
}
|
|
37343
|
-
const match = getWildcardDirectoryFromSpec(spec,
|
|
37345
|
+
const match = getWildcardDirectoryFromSpec(spec, useCaseSensitiveFileNames2);
|
|
37344
37346
|
if (match) {
|
|
37345
37347
|
const { key, flags } = match;
|
|
37346
37348
|
const existingFlags = wildcardDirectories[key];
|
|
@@ -37355,7 +37357,7 @@ ${lanes.join("\n")}
|
|
|
37355
37357
|
for (const key in wildcardDirectories) {
|
|
37356
37358
|
if (hasProperty(wildcardDirectories, key)) {
|
|
37357
37359
|
for (const recursiveKey of recursiveKeys) {
|
|
37358
|
-
if (key !== recursiveKey && containsPath(recursiveKey, key, path, !
|
|
37360
|
+
if (key !== recursiveKey && containsPath(recursiveKey, key, path, !useCaseSensitiveFileNames2)) {
|
|
37359
37361
|
delete wildcardDirectories[key];
|
|
37360
37362
|
}
|
|
37361
37363
|
}
|
|
@@ -37364,20 +37366,20 @@ ${lanes.join("\n")}
|
|
|
37364
37366
|
}
|
|
37365
37367
|
return wildcardDirectories;
|
|
37366
37368
|
}
|
|
37367
|
-
function getWildcardDirectoryFromSpec(spec,
|
|
37369
|
+
function getWildcardDirectoryFromSpec(spec, useCaseSensitiveFileNames2) {
|
|
37368
37370
|
const match = wildcardDirectoryPattern.exec(spec);
|
|
37369
37371
|
if (match) {
|
|
37370
37372
|
const questionWildcardIndex = spec.indexOf("?");
|
|
37371
37373
|
const starWildcardIndex = spec.indexOf("*");
|
|
37372
37374
|
const lastDirectorySeperatorIndex = spec.lastIndexOf(directorySeparator);
|
|
37373
37375
|
return {
|
|
37374
|
-
key:
|
|
37376
|
+
key: useCaseSensitiveFileNames2 ? match[0] : toFileNameLowerCase(match[0]),
|
|
37375
37377
|
flags: questionWildcardIndex !== -1 && questionWildcardIndex < lastDirectorySeperatorIndex || starWildcardIndex !== -1 && starWildcardIndex < lastDirectorySeperatorIndex ? 1 /* Recursive */ : 0 /* None */
|
|
37376
37378
|
};
|
|
37377
37379
|
}
|
|
37378
37380
|
if (isImplicitGlob(spec.substring(spec.lastIndexOf(directorySeparator) + 1))) {
|
|
37379
37381
|
return {
|
|
37380
|
-
key: removeTrailingDirectorySeparator(
|
|
37382
|
+
key: removeTrailingDirectorySeparator(useCaseSensitiveFileNames2 ? spec : toFileNameLowerCase(spec)),
|
|
37381
37383
|
flags: 1 /* Recursive */
|
|
37382
37384
|
};
|
|
37383
37385
|
}
|
|
@@ -37982,6 +37984,7 @@ ${lanes.join("\n")}
|
|
|
37982
37984
|
{
|
|
37983
37985
|
name: "checkJs",
|
|
37984
37986
|
type: "boolean",
|
|
37987
|
+
affectsModuleResolution: true,
|
|
37985
37988
|
showInSimplifiedHelpView: true,
|
|
37986
37989
|
category: Diagnostics.JavaScript_Support,
|
|
37987
37990
|
description: Diagnostics.Enable_error_reporting_in_type_checked_JavaScript_files,
|
|
@@ -39062,6 +39065,18 @@ ${lanes.join("\n")}
|
|
|
39062
39065
|
result.push("JSON");
|
|
39063
39066
|
return result.join(", ");
|
|
39064
39067
|
}
|
|
39068
|
+
function extensionsToExtensionsArray(extensions) {
|
|
39069
|
+
const result = [];
|
|
39070
|
+
if (extensions & 1 /* TypeScript */)
|
|
39071
|
+
result.push(...supportedTSImplementationExtensions);
|
|
39072
|
+
if (extensions & 2 /* JavaScript */)
|
|
39073
|
+
result.push(...supportedJSExtensionsFlat);
|
|
39074
|
+
if (extensions & 4 /* Declaration */)
|
|
39075
|
+
result.push(...supportedDeclarationExtensions);
|
|
39076
|
+
if (extensions & 8 /* Json */)
|
|
39077
|
+
result.push(".json" /* Json */);
|
|
39078
|
+
return result;
|
|
39079
|
+
}
|
|
39065
39080
|
function resolvedTypeScriptOnly(resolved) {
|
|
39066
39081
|
if (!resolved) {
|
|
39067
39082
|
return void 0;
|
|
@@ -39234,8 +39249,8 @@ ${lanes.join("\n")}
|
|
|
39234
39249
|
return typeRoots;
|
|
39235
39250
|
}
|
|
39236
39251
|
function arePathsEqual(path1, path2, host) {
|
|
39237
|
-
const
|
|
39238
|
-
return comparePaths(path1, path2, !
|
|
39252
|
+
const useCaseSensitiveFileNames2 = typeof host.useCaseSensitiveFileNames === "function" ? host.useCaseSensitiveFileNames() : host.useCaseSensitiveFileNames;
|
|
39253
|
+
return comparePaths(path1, path2, !useCaseSensitiveFileNames2) === 0 /* EqualTo */;
|
|
39239
39254
|
}
|
|
39240
39255
|
function getOriginalAndResolvedFileName(fileName, host, traceEnabled) {
|
|
39241
39256
|
const resolvedFileName = realPath(fileName, host, traceEnabled);
|
|
@@ -40498,7 +40513,7 @@ ${lanes.join("\n")}
|
|
|
40498
40513
|
arrayIsEqualTo
|
|
40499
40514
|
);
|
|
40500
40515
|
for (const conditions of conditionSets) {
|
|
40501
|
-
const loadPackageJsonExportsState = { ...loadPackageJsonMainState, failedLookupLocations: [], conditions };
|
|
40516
|
+
const loadPackageJsonExportsState = { ...loadPackageJsonMainState, failedLookupLocations: [], conditions, host };
|
|
40502
40517
|
const exportResolutions = loadEntrypointsFromExportMap(
|
|
40503
40518
|
packageJsonInfo,
|
|
40504
40519
|
packageJsonInfo.contents.packageJsonContent.exports,
|
|
@@ -40530,23 +40545,42 @@ ${lanes.join("\n")}
|
|
|
40530
40545
|
return entrypoints;
|
|
40531
40546
|
function loadEntrypointsFromTargetExports(target) {
|
|
40532
40547
|
var _a, _b;
|
|
40533
|
-
if (typeof target === "string" && startsWith(target, "./")
|
|
40534
|
-
|
|
40535
|
-
|
|
40536
|
-
|
|
40537
|
-
|
|
40538
|
-
|
|
40539
|
-
|
|
40540
|
-
|
|
40541
|
-
|
|
40542
|
-
|
|
40543
|
-
|
|
40544
|
-
|
|
40545
|
-
|
|
40546
|
-
|
|
40547
|
-
|
|
40548
|
-
|
|
40549
|
-
|
|
40548
|
+
if (typeof target === "string" && startsWith(target, "./")) {
|
|
40549
|
+
if (target.indexOf("*") >= 0 && state.host.readDirectory) {
|
|
40550
|
+
if (target.indexOf("*") !== target.lastIndexOf("*")) {
|
|
40551
|
+
return false;
|
|
40552
|
+
}
|
|
40553
|
+
state.host.readDirectory(
|
|
40554
|
+
scope.packageDirectory,
|
|
40555
|
+
extensionsToExtensionsArray(extensions),
|
|
40556
|
+
/*excludes*/
|
|
40557
|
+
void 0,
|
|
40558
|
+
[changeAnyExtension(target.replace("*", "**/*"), getDeclarationEmitExtensionForPath(target))]
|
|
40559
|
+
).forEach((entry) => {
|
|
40560
|
+
entrypoints = appendIfUnique(entrypoints, {
|
|
40561
|
+
path: entry,
|
|
40562
|
+
ext: getAnyExtensionFromPath(entry),
|
|
40563
|
+
resolvedUsingTsExtension: void 0
|
|
40564
|
+
});
|
|
40565
|
+
});
|
|
40566
|
+
} else {
|
|
40567
|
+
const partsAfterFirst = getPathComponents(target).slice(2);
|
|
40568
|
+
if (partsAfterFirst.indexOf("..") >= 0 || partsAfterFirst.indexOf(".") >= 0 || partsAfterFirst.indexOf("node_modules") >= 0) {
|
|
40569
|
+
return false;
|
|
40570
|
+
}
|
|
40571
|
+
const resolvedTarget = combinePaths(scope.packageDirectory, target);
|
|
40572
|
+
const finalPath = getNormalizedAbsolutePath(resolvedTarget, (_b = (_a = state.host).getCurrentDirectory) == null ? void 0 : _b.call(_a));
|
|
40573
|
+
const result = loadFileNameFromPackageJsonField(
|
|
40574
|
+
extensions,
|
|
40575
|
+
finalPath,
|
|
40576
|
+
/*onlyRecordFailures*/
|
|
40577
|
+
false,
|
|
40578
|
+
state
|
|
40579
|
+
);
|
|
40580
|
+
if (result) {
|
|
40581
|
+
entrypoints = appendIfUnique(entrypoints, result, (a, b) => a.path === b.path);
|
|
40582
|
+
return true;
|
|
40583
|
+
}
|
|
40550
40584
|
}
|
|
40551
40585
|
} else if (Array.isArray(target)) {
|
|
40552
40586
|
for (const t of target) {
|
|
@@ -40755,6 +40789,9 @@ ${lanes.join("\n")}
|
|
|
40755
40789
|
}
|
|
40756
40790
|
const trailingParts = parts.slice(nameParts.length);
|
|
40757
40791
|
const subpath = !length(trailingParts) ? "." : `.${directorySeparator}${trailingParts.join(directorySeparator)}`;
|
|
40792
|
+
if (getAllowJSCompilerOption(state.compilerOptions) && !pathContainsNodeModules(directory)) {
|
|
40793
|
+
return loadModuleFromExports(scope, extensions, subpath, state, cache, redirectedReference);
|
|
40794
|
+
}
|
|
40758
40795
|
const priorityExtensions = extensions & (1 /* TypeScript */ | 4 /* Declaration */);
|
|
40759
40796
|
const secondaryExtensions = extensions & ~(1 /* TypeScript */ | 4 /* Declaration */);
|
|
40760
40797
|
return loadModuleFromExports(scope, priorityExtensions, subpath, state, cache, redirectedReference) || loadModuleFromExports(scope, secondaryExtensions, subpath, state, cache, redirectedReference);
|
|
@@ -41102,13 +41139,10 @@ ${lanes.join("\n")}
|
|
|
41102
41139
|
function combineDirectoryPath(root, dir) {
|
|
41103
41140
|
return ensureTrailingDirectorySeparator(combinePaths(root, dir));
|
|
41104
41141
|
}
|
|
41105
|
-
function useCaseSensitiveFileNames() {
|
|
41106
|
-
return !state.host.useCaseSensitiveFileNames ? true : typeof state.host.useCaseSensitiveFileNames === "boolean" ? state.host.useCaseSensitiveFileNames : state.host.useCaseSensitiveFileNames();
|
|
41107
|
-
}
|
|
41108
41142
|
function tryLoadInputFileForPath(finalPath, entry, packagePath, isImports2) {
|
|
41109
41143
|
var _a, _b, _c, _d;
|
|
41110
|
-
if (!state.isConfigLookup && (state.compilerOptions.declarationDir || state.compilerOptions.outDir) && finalPath.indexOf("/node_modules/") === -1 && (state.compilerOptions.configFile ? containsPath(scope.packageDirectory, toAbsolutePath(state.compilerOptions.configFile.fileName), !useCaseSensitiveFileNames()) : true)) {
|
|
41111
|
-
const getCanonicalFileName = hostGetCanonicalFileName({ useCaseSensitiveFileNames });
|
|
41144
|
+
if (!state.isConfigLookup && (state.compilerOptions.declarationDir || state.compilerOptions.outDir) && finalPath.indexOf("/node_modules/") === -1 && (state.compilerOptions.configFile ? containsPath(scope.packageDirectory, toAbsolutePath(state.compilerOptions.configFile.fileName), !useCaseSensitiveFileNames(state)) : true)) {
|
|
41145
|
+
const getCanonicalFileName = hostGetCanonicalFileName({ useCaseSensitiveFileNames: () => useCaseSensitiveFileNames(state) });
|
|
41112
41146
|
const commonSourceDirGuesses = [];
|
|
41113
41147
|
if (state.compilerOptions.rootDir || state.compilerOptions.composite && state.compilerOptions.configFilePath) {
|
|
41114
41148
|
const commonDir = toAbsolutePath(getCommonSourceDirectory(state.compilerOptions, () => [], ((_b = (_a = state.host).getCurrentDirectory) == null ? void 0 : _b.call(_a)) || "", getCanonicalFileName));
|
|
@@ -41137,7 +41171,7 @@ ${lanes.join("\n")}
|
|
|
41137
41171
|
for (const commonSourceDirGuess of commonSourceDirGuesses) {
|
|
41138
41172
|
const candidateDirectories = getOutputDirectoriesForBaseDirectory(commonSourceDirGuess);
|
|
41139
41173
|
for (const candidateDir of candidateDirectories) {
|
|
41140
|
-
if (containsPath(candidateDir, finalPath, !useCaseSensitiveFileNames())) {
|
|
41174
|
+
if (containsPath(candidateDir, finalPath, !useCaseSensitiveFileNames(state))) {
|
|
41141
41175
|
const pathFragment = finalPath.slice(candidateDir.length + 1);
|
|
41142
41176
|
const possibleInputBase = combinePaths(commonSourceDirGuess, pathFragment);
|
|
41143
41177
|
const jsAndDtsExtensions = [".mjs" /* Mjs */, ".cjs" /* Cjs */, ".js" /* Js */, ".json" /* Json */, ".d.mts" /* Dmts */, ".d.cts" /* Dcts */, ".d.ts" /* Dts */];
|
|
@@ -41147,7 +41181,7 @@ ${lanes.join("\n")}
|
|
|
41147
41181
|
for (const possibleExt of inputExts) {
|
|
41148
41182
|
if (!extensionIsOk(extensions, possibleExt))
|
|
41149
41183
|
continue;
|
|
41150
|
-
const possibleInputWithInputExtension = changeAnyExtension(possibleInputBase, possibleExt, ext, !useCaseSensitiveFileNames());
|
|
41184
|
+
const possibleInputWithInputExtension = changeAnyExtension(possibleInputBase, possibleExt, ext, !useCaseSensitiveFileNames(state));
|
|
41151
41185
|
if (state.host.fileExists(possibleInputWithInputExtension)) {
|
|
41152
41186
|
return toSearchResult(withPackageId(scope, loadFileNameFromPackageJsonField(
|
|
41153
41187
|
extensions,
|
|
@@ -41563,6 +41597,9 @@ ${lanes.join("\n")}
|
|
|
41563
41597
|
trace(state.host, diagnostic, ...args);
|
|
41564
41598
|
}
|
|
41565
41599
|
}
|
|
41600
|
+
function useCaseSensitiveFileNames(state) {
|
|
41601
|
+
return !state.host.useCaseSensitiveFileNames ? true : typeof state.host.useCaseSensitiveFileNames === "boolean" ? state.host.useCaseSensitiveFileNames : state.host.useCaseSensitiveFileNames();
|
|
41602
|
+
}
|
|
41566
41603
|
var typeScriptVersion, nodeModulesAtTypes, NodeResolutionFeatures, nodeModulesPathPart, mangledScopedPackageSeparator;
|
|
41567
41604
|
var init_moduleNameResolver = __esm({
|
|
41568
41605
|
"src/compiler/moduleNameResolver.ts"() {
|
|
@@ -45068,7 +45105,9 @@ ${lanes.join("\n")}
|
|
|
45068
45105
|
for (const { ending, value } of candidates) {
|
|
45069
45106
|
if (value.length >= prefix.length + suffix.length && startsWith(value, prefix) && endsWith(value, suffix) && validateEnding({ ending, value })) {
|
|
45070
45107
|
const matchedStar = value.substring(prefix.length, value.length - suffix.length);
|
|
45071
|
-
|
|
45108
|
+
if (!pathIsRelative(matchedStar)) {
|
|
45109
|
+
return key.replace("*", matchedStar);
|
|
45110
|
+
}
|
|
45072
45111
|
}
|
|
45073
45112
|
}
|
|
45074
45113
|
} else if (some(candidates, (c) => c.ending !== 0 /* Minimal */ && pattern === c.value) || some(candidates, (c) => c.ending === 0 /* Minimal */ && pattern === c.value && validateEnding(c))) {
|
|
@@ -45140,7 +45179,7 @@ ${lanes.join("\n")}
|
|
|
45140
45179
|
for (const key of getOwnKeys(exports)) {
|
|
45141
45180
|
if (key === "default" || conditions.indexOf(key) >= 0 || isApplicableVersionedTypesKey(conditions, key)) {
|
|
45142
45181
|
const subTarget = exports[key];
|
|
45143
|
-
const result = tryGetModuleNameFromExports(options, targetFilePath, packageDirectory, packageName, subTarget, conditions);
|
|
45182
|
+
const result = tryGetModuleNameFromExports(options, targetFilePath, packageDirectory, packageName, subTarget, conditions, mode);
|
|
45144
45183
|
if (result) {
|
|
45145
45184
|
return result;
|
|
45146
45185
|
}
|
|
@@ -46198,7 +46237,7 @@ ${lanes.join("\n")}
|
|
|
46198
46237
|
};
|
|
46199
46238
|
var amalgamatedDuplicates;
|
|
46200
46239
|
var reverseMappedCache = /* @__PURE__ */ new Map();
|
|
46201
|
-
var
|
|
46240
|
+
var homomorphicMappedTypeInferenceStack = [];
|
|
46202
46241
|
var ambientModulesCache;
|
|
46203
46242
|
var patternAmbientModules;
|
|
46204
46243
|
var patternAmbientModuleAugmentations;
|
|
@@ -50789,6 +50828,7 @@ ${lanes.join("\n")}
|
|
|
50789
50828
|
);
|
|
50790
50829
|
}
|
|
50791
50830
|
function signatureToSignatureDeclarationHelper(signature, kind, context, options) {
|
|
50831
|
+
var _a;
|
|
50792
50832
|
const suppressAny = context.flags & 256 /* SuppressAnyReturnType */;
|
|
50793
50833
|
if (suppressAny)
|
|
50794
50834
|
context.flags &= ~256 /* SuppressAnyReturnType */;
|
|
@@ -50924,6 +50964,20 @@ ${lanes.join("\n")}
|
|
|
50924
50964
|
if (typeArguments) {
|
|
50925
50965
|
node.typeArguments = factory.createNodeArray(typeArguments);
|
|
50926
50966
|
}
|
|
50967
|
+
if (((_a = signature.declaration) == null ? void 0 : _a.kind) === 330 /* JSDocSignature */ && signature.declaration.parent.kind === 346 /* JSDocOverloadTag */) {
|
|
50968
|
+
const comment = getTextOfNode(
|
|
50969
|
+
signature.declaration.parent.parent,
|
|
50970
|
+
/*includeTrivia*/
|
|
50971
|
+
true
|
|
50972
|
+
).slice(2, -2).split(/\r\n|\n|\r/).map((line) => line.replace(/^\s+/, " ")).join("\n");
|
|
50973
|
+
addSyntheticLeadingComment(
|
|
50974
|
+
node,
|
|
50975
|
+
3 /* MultiLineCommentTrivia */,
|
|
50976
|
+
comment,
|
|
50977
|
+
/*hasTrailingNewLine*/
|
|
50978
|
+
true
|
|
50979
|
+
);
|
|
50980
|
+
}
|
|
50927
50981
|
cleanup == null ? void 0 : cleanup();
|
|
50928
50982
|
return node;
|
|
50929
50983
|
}
|
|
@@ -57701,7 +57755,7 @@ ${lanes.join("\n")}
|
|
|
57701
57755
|
return ((_a = type.target.localTypeParameters) == null ? void 0 : _a.map(() => errorType)) || emptyArray;
|
|
57702
57756
|
}
|
|
57703
57757
|
const node = type.node;
|
|
57704
|
-
const typeArguments = !node ? emptyArray : node.kind === 183 /* TypeReference */ ? concatenate(type.target.outerTypeParameters, getEffectiveTypeArguments2(node, type.target.localTypeParameters)) : node.kind === 188 /* ArrayType */ ? [getTypeFromTypeNode(node.elementType)] : map(node.elements,
|
|
57758
|
+
const typeArguments = !node ? emptyArray : node.kind === 183 /* TypeReference */ ? concatenate(type.target.outerTypeParameters, getEffectiveTypeArguments2(node, type.target.localTypeParameters)) : node.kind === 188 /* ArrayType */ ? [getTypeFromTypeNode(node.elementType)] : map(node.elements, getTypeFromTypeNode);
|
|
57705
57759
|
if (popTypeResolution()) {
|
|
57706
57760
|
type.resolvedTypeArguments = type.mapper ? instantiateTypes(typeArguments, type.mapper) : typeArguments;
|
|
57707
57761
|
} else {
|
|
@@ -65587,17 +65641,18 @@ ${lanes.join("\n")}
|
|
|
65587
65641
|
);
|
|
65588
65642
|
}
|
|
65589
65643
|
function inferTypeForHomomorphicMappedType(source, target, constraint) {
|
|
65590
|
-
|
|
65591
|
-
|
|
65644
|
+
const cacheKey = source.id + "," + target.id + "," + constraint.id;
|
|
65645
|
+
if (reverseMappedCache.has(cacheKey)) {
|
|
65646
|
+
return reverseMappedCache.get(cacheKey);
|
|
65592
65647
|
}
|
|
65593
|
-
const
|
|
65594
|
-
if (
|
|
65595
|
-
return
|
|
65648
|
+
const recursionKey = source.id + "," + (target.target || target).id;
|
|
65649
|
+
if (contains(homomorphicMappedTypeInferenceStack, recursionKey)) {
|
|
65650
|
+
return void 0;
|
|
65596
65651
|
}
|
|
65597
|
-
|
|
65652
|
+
homomorphicMappedTypeInferenceStack.push(recursionKey);
|
|
65598
65653
|
const type = createReverseMappedType(source, target, constraint);
|
|
65599
|
-
|
|
65600
|
-
reverseMappedCache.set(
|
|
65654
|
+
homomorphicMappedTypeInferenceStack.pop();
|
|
65655
|
+
reverseMappedCache.set(cacheKey, type);
|
|
65601
65656
|
return type;
|
|
65602
65657
|
}
|
|
65603
65658
|
function isPartiallyInferableType(type) {
|
|
@@ -116944,14 +116999,14 @@ ${lanes.join("\n")}
|
|
|
116944
116999
|
});
|
|
116945
117000
|
|
|
116946
117001
|
// src/compiler/watchUtilities.ts
|
|
116947
|
-
function createCachedDirectoryStructureHost(host, currentDirectory,
|
|
117002
|
+
function createCachedDirectoryStructureHost(host, currentDirectory, useCaseSensitiveFileNames2) {
|
|
116948
117003
|
if (!host.getDirectories || !host.readDirectory) {
|
|
116949
117004
|
return void 0;
|
|
116950
117005
|
}
|
|
116951
117006
|
const cachedReadDirectoryResult = /* @__PURE__ */ new Map();
|
|
116952
|
-
const getCanonicalFileName = createGetCanonicalFileName(
|
|
117007
|
+
const getCanonicalFileName = createGetCanonicalFileName(useCaseSensitiveFileNames2);
|
|
116953
117008
|
return {
|
|
116954
|
-
useCaseSensitiveFileNames,
|
|
117009
|
+
useCaseSensitiveFileNames: useCaseSensitiveFileNames2,
|
|
116955
117010
|
fileExists,
|
|
116956
117011
|
readFile: (path, encoding) => host.readFile(path, encoding),
|
|
116957
117012
|
directoryExists: host.directoryExists && directoryExists,
|
|
@@ -117073,7 +117128,7 @@ ${lanes.join("\n")}
|
|
|
117073
117128
|
const rootResult = tryReadDirectory2(rootDir, rootDirPath);
|
|
117074
117129
|
let rootSymLinkResult;
|
|
117075
117130
|
if (rootResult !== void 0) {
|
|
117076
|
-
return matchFiles(rootDir, extensions, excludes, includes,
|
|
117131
|
+
return matchFiles(rootDir, extensions, excludes, includes, useCaseSensitiveFileNames2, currentDirectory, depth, getFileSystemEntries, realpath);
|
|
117077
117132
|
}
|
|
117078
117133
|
return host.readDirectory(rootDir, extensions, excludes, includes, depth);
|
|
117079
117134
|
function getFileSystemEntries(dir) {
|
|
@@ -117268,7 +117323,7 @@ ${lanes.join("\n")}
|
|
|
117268
117323
|
program,
|
|
117269
117324
|
extraFileExtensions,
|
|
117270
117325
|
currentDirectory,
|
|
117271
|
-
useCaseSensitiveFileNames,
|
|
117326
|
+
useCaseSensitiveFileNames: useCaseSensitiveFileNames2,
|
|
117272
117327
|
writeLog,
|
|
117273
117328
|
toPath: toPath3
|
|
117274
117329
|
}) {
|
|
@@ -117284,7 +117339,7 @@ ${lanes.join("\n")}
|
|
|
117284
117339
|
writeLog(`Project: ${configFileName} Detected file add/remove of non supported extension: ${fileOrDirectory}`);
|
|
117285
117340
|
return true;
|
|
117286
117341
|
}
|
|
117287
|
-
if (isExcludedFile(fileOrDirectory, options.configFile.configFileSpecs, getNormalizedAbsolutePath(getDirectoryPath(configFileName), currentDirectory),
|
|
117342
|
+
if (isExcludedFile(fileOrDirectory, options.configFile.configFileSpecs, getNormalizedAbsolutePath(getDirectoryPath(configFileName), currentDirectory), useCaseSensitiveFileNames2, currentDirectory)) {
|
|
117288
117343
|
writeLog(`Project: ${configFileName} Detected excluded file: ${fileOrDirectory}`);
|
|
117289
117344
|
return true;
|
|
117290
117345
|
}
|
|
@@ -117341,7 +117396,7 @@ ${lanes.join("\n")}
|
|
|
117341
117396
|
function createExcludeHandlingAddWatch(key) {
|
|
117342
117397
|
return (file, cb, flags, options, detailInfo1, detailInfo2) => {
|
|
117343
117398
|
var _a;
|
|
117344
|
-
return !matchesExclude(file, key === "watchFile" ? options == null ? void 0 : options.excludeFiles : options == null ? void 0 : options.excludeDirectories,
|
|
117399
|
+
return !matchesExclude(file, key === "watchFile" ? options == null ? void 0 : options.excludeFiles : options == null ? void 0 : options.excludeDirectories, useCaseSensitiveFileNames2(), ((_a = host.getCurrentDirectory) == null ? void 0 : _a.call(host)) || "") ? factory2[key].call(
|
|
117345
117400
|
/*thisArgs*/
|
|
117346
117401
|
void 0,
|
|
117347
117402
|
file,
|
|
@@ -117353,7 +117408,7 @@ ${lanes.join("\n")}
|
|
|
117353
117408
|
) : excludeWatcherFactory(file, flags, options, detailInfo1, detailInfo2);
|
|
117354
117409
|
};
|
|
117355
117410
|
}
|
|
117356
|
-
function
|
|
117411
|
+
function useCaseSensitiveFileNames2() {
|
|
117357
117412
|
return typeof host.useCaseSensitiveFileNames === "boolean" ? host.useCaseSensitiveFileNames : host.useCaseSensitiveFileNames();
|
|
117358
117413
|
}
|
|
117359
117414
|
function createExcludeWatcherWithLogging(file, flags, options, detailInfo1, detailInfo2) {
|
|
@@ -119371,6 +119426,14 @@ ${lanes.join("\n")}
|
|
|
119371
119426
|
case 265 /* TypeAliasDeclaration */:
|
|
119372
119427
|
diagnostics.push(createDiagnosticForNode2(node, Diagnostics.Type_aliases_can_only_be_used_in_TypeScript_files));
|
|
119373
119428
|
return "skip";
|
|
119429
|
+
case 176 /* Constructor */:
|
|
119430
|
+
case 174 /* MethodDeclaration */:
|
|
119431
|
+
case 262 /* FunctionDeclaration */:
|
|
119432
|
+
if (!node.body) {
|
|
119433
|
+
diagnostics.push(createDiagnosticForNode2(node, Diagnostics.Signature_declarations_can_only_be_used_in_TypeScript_files));
|
|
119434
|
+
return "skip";
|
|
119435
|
+
}
|
|
119436
|
+
return;
|
|
119374
119437
|
case 266 /* EnumDeclaration */:
|
|
119375
119438
|
const enumKeyword = Debug.checkDefined(tokenToString(94 /* EnumKeyword */));
|
|
119376
119439
|
diagnostics.push(createDiagnosticForNode2(node, Diagnostics._0_declarations_can_only_be_used_in_TypeScript_files, enumKeyword));
|
|
@@ -121285,6 +121348,9 @@ ${lanes.join("\n")}
|
|
|
121285
121348
|
return directoryStructureHost.readDirectory(root, extensions, excludes, includes, depth);
|
|
121286
121349
|
},
|
|
121287
121350
|
readFile: (f) => directoryStructureHost.readFile(f),
|
|
121351
|
+
directoryExists: maybeBind(directoryStructureHost, directoryStructureHost.directoryExists),
|
|
121352
|
+
getDirectories: maybeBind(directoryStructureHost, directoryStructureHost.getDirectories),
|
|
121353
|
+
realpath: maybeBind(directoryStructureHost, directoryStructureHost.realpath),
|
|
121288
121354
|
useCaseSensitiveFileNames: host.useCaseSensitiveFileNames(),
|
|
121289
121355
|
getCurrentDirectory: () => host.getCurrentDirectory(),
|
|
121290
121356
|
onUnRecoverableConfigFileDiagnostic: host.onUnRecoverableConfigFileDiagnostic || returnUndefined,
|
|
@@ -124480,12 +124546,12 @@ ${lanes.join("\n")}
|
|
|
124480
124546
|
return true;
|
|
124481
124547
|
const isJsonFile = fileExtensionIs(fileName, ".json" /* Json */);
|
|
124482
124548
|
const basePath = getDirectoryPath(getNormalizedAbsolutePath(configFile.fileName, program.getCurrentDirectory()));
|
|
124483
|
-
const
|
|
124549
|
+
const useCaseSensitiveFileNames2 = program.useCaseSensitiveFileNames();
|
|
124484
124550
|
return find((_b = configFile == null ? void 0 : configFile.configFileSpecs) == null ? void 0 : _b.validatedIncludeSpecs, (includeSpec) => {
|
|
124485
124551
|
if (isJsonFile && !endsWith(includeSpec, ".json" /* Json */))
|
|
124486
124552
|
return false;
|
|
124487
124553
|
const pattern = getPatternFromSpec(includeSpec, basePath, "files");
|
|
124488
|
-
return !!pattern && getRegexFromPattern(`(${pattern})$`,
|
|
124554
|
+
return !!pattern && getRegexFromPattern(`(${pattern})$`, useCaseSensitiveFileNames2).test(fileName);
|
|
124489
124555
|
});
|
|
124490
124556
|
}
|
|
124491
124557
|
function fileIncludeReasonToDiagnostics(program, reason, fileNameConvertor) {
|
|
@@ -124689,7 +124755,7 @@ ${lanes.join("\n")}
|
|
|
124689
124755
|
return result;
|
|
124690
124756
|
}
|
|
124691
124757
|
function createCompilerHostFromProgramHost(host, getCompilerOptions, directoryStructureHost = host) {
|
|
124692
|
-
const
|
|
124758
|
+
const useCaseSensitiveFileNames2 = host.useCaseSensitiveFileNames();
|
|
124693
124759
|
const compilerHost = {
|
|
124694
124760
|
getSourceFile: createGetSourceFile(
|
|
124695
124761
|
(fileName, encoding) => !encoding ? compilerHost.readFile(fileName) : host.readFile(fileName, encoding),
|
|
@@ -124705,8 +124771,8 @@ ${lanes.join("\n")}
|
|
|
124705
124771
|
(path) => host.directoryExists(path)
|
|
124706
124772
|
),
|
|
124707
124773
|
getCurrentDirectory: memoize(() => host.getCurrentDirectory()),
|
|
124708
|
-
useCaseSensitiveFileNames: () =>
|
|
124709
|
-
getCanonicalFileName: createGetCanonicalFileName(
|
|
124774
|
+
useCaseSensitiveFileNames: () => useCaseSensitiveFileNames2,
|
|
124775
|
+
getCanonicalFileName: createGetCanonicalFileName(useCaseSensitiveFileNames2),
|
|
124710
124776
|
getNewLine: () => getNewLineCharacter(getCompilerOptions()),
|
|
124711
124777
|
fileExists: (f) => host.fileExists(f),
|
|
124712
124778
|
readFile: (f) => host.readFile(f),
|
|
@@ -124987,7 +125053,7 @@ ${lanes.join("\n")}
|
|
|
124987
125053
|
const sourceFilesCache = /* @__PURE__ */ new Map();
|
|
124988
125054
|
let missingFilePathsRequestedForRelease;
|
|
124989
125055
|
let hasChangedCompilerOptions = false;
|
|
124990
|
-
const
|
|
125056
|
+
const useCaseSensitiveFileNames2 = host.useCaseSensitiveFileNames();
|
|
124991
125057
|
const currentDirectory = host.getCurrentDirectory();
|
|
124992
125058
|
const { configFileName, optionsToExtend: optionsToExtendForConfigFile = {}, watchOptionsToExtend, extraFileExtensions, createProgram: createProgram2 } = host;
|
|
124993
125059
|
let { rootFiles: rootFileNames, options: compilerOptions, watchOptions, projectReferences } = host;
|
|
@@ -124995,7 +125061,7 @@ ${lanes.join("\n")}
|
|
|
124995
125061
|
let configFileParsingDiagnostics;
|
|
124996
125062
|
let canConfigFileJsonReportNoInputFiles = false;
|
|
124997
125063
|
let hasChangedConfigFileParsingErrors = false;
|
|
124998
|
-
const cachedDirectoryStructureHost = configFileName === void 0 ? void 0 : createCachedDirectoryStructureHost(host, currentDirectory,
|
|
125064
|
+
const cachedDirectoryStructureHost = configFileName === void 0 ? void 0 : createCachedDirectoryStructureHost(host, currentDirectory, useCaseSensitiveFileNames2);
|
|
124999
125065
|
const directoryStructureHost = cachedDirectoryStructureHost || host;
|
|
125000
125066
|
const parseConfigFileHost = parseConfigHostFromCompilerHostLike(host, directoryStructureHost);
|
|
125001
125067
|
let newLine = updateNewLine();
|
|
@@ -125013,8 +125079,8 @@ ${lanes.join("\n")}
|
|
|
125013
125079
|
Debug.assert(compilerOptions);
|
|
125014
125080
|
Debug.assert(rootFileNames);
|
|
125015
125081
|
const { watchFile: watchFile2, watchDirectory, writeLog } = createWatchFactory(host, compilerOptions);
|
|
125016
|
-
const getCanonicalFileName = createGetCanonicalFileName(
|
|
125017
|
-
writeLog(`Current directory: ${currentDirectory} CaseSensitiveFileNames: ${
|
|
125082
|
+
const getCanonicalFileName = createGetCanonicalFileName(useCaseSensitiveFileNames2);
|
|
125083
|
+
writeLog(`Current directory: ${currentDirectory} CaseSensitiveFileNames: ${useCaseSensitiveFileNames2}`);
|
|
125018
125084
|
let configFileWatcher;
|
|
125019
125085
|
if (configFileName) {
|
|
125020
125086
|
configFileWatcher = watchFile2(configFileName, scheduleProgramReload, 2e3 /* High */, watchOptions, WatchType.ConfigFile);
|
|
@@ -125520,7 +125586,7 @@ ${lanes.join("\n")}
|
|
|
125520
125586
|
options: compilerOptions,
|
|
125521
125587
|
program: getCurrentBuilderProgram() || rootFileNames,
|
|
125522
125588
|
currentDirectory,
|
|
125523
|
-
useCaseSensitiveFileNames,
|
|
125589
|
+
useCaseSensitiveFileNames: useCaseSensitiveFileNames2,
|
|
125524
125590
|
writeLog,
|
|
125525
125591
|
toPath: toPath3
|
|
125526
125592
|
}))
|
|
@@ -125610,7 +125676,7 @@ ${lanes.join("\n")}
|
|
|
125610
125676
|
options: config.parsedCommandLine.options,
|
|
125611
125677
|
program: config.parsedCommandLine.fileNames,
|
|
125612
125678
|
currentDirectory,
|
|
125613
|
-
useCaseSensitiveFileNames,
|
|
125679
|
+
useCaseSensitiveFileNames: useCaseSensitiveFileNames2,
|
|
125614
125680
|
writeLog,
|
|
125615
125681
|
toPath: toPath3
|
|
125616
125682
|
}))
|
|
@@ -131506,10 +131572,10 @@ ${lanes.join("\n")}
|
|
|
131506
131572
|
}
|
|
131507
131573
|
function forEachExternalModuleToImportFrom(program, host, preferences, useAutoImportProvider, cb) {
|
|
131508
131574
|
var _a, _b;
|
|
131509
|
-
const
|
|
131575
|
+
const useCaseSensitiveFileNames2 = hostUsesCaseSensitiveFileNames(host);
|
|
131510
131576
|
const excludePatterns = preferences.autoImportFileExcludePatterns && mapDefined(preferences.autoImportFileExcludePatterns, (spec) => {
|
|
131511
131577
|
const pattern = getPatternFromSpec(spec, "", "exclude");
|
|
131512
|
-
return pattern ? getRegexFromPattern(pattern,
|
|
131578
|
+
return pattern ? getRegexFromPattern(pattern, useCaseSensitiveFileNames2) : void 0;
|
|
131513
131579
|
});
|
|
131514
131580
|
forEachExternalModule(program.getTypeChecker(), program.getSourceFiles(), excludePatterns, (module2, file) => cb(
|
|
131515
131581
|
module2,
|
|
@@ -133005,12 +133071,12 @@ ${lanes.join("\n")}
|
|
|
133005
133071
|
function isDocumentRegistryEntry(entry) {
|
|
133006
133072
|
return !!entry.sourceFile;
|
|
133007
133073
|
}
|
|
133008
|
-
function createDocumentRegistry(
|
|
133009
|
-
return createDocumentRegistryInternal(
|
|
133074
|
+
function createDocumentRegistry(useCaseSensitiveFileNames2, currentDirectory) {
|
|
133075
|
+
return createDocumentRegistryInternal(useCaseSensitiveFileNames2, currentDirectory);
|
|
133010
133076
|
}
|
|
133011
|
-
function createDocumentRegistryInternal(
|
|
133077
|
+
function createDocumentRegistryInternal(useCaseSensitiveFileNames2, currentDirectory = "", externalCache) {
|
|
133012
133078
|
const buckets = /* @__PURE__ */ new Map();
|
|
133013
|
-
const getCanonicalFileName = createGetCanonicalFileName(!!
|
|
133079
|
+
const getCanonicalFileName = createGetCanonicalFileName(!!useCaseSensitiveFileNames2);
|
|
133014
133080
|
function reportStats() {
|
|
133015
133081
|
const bucketInfoArray = arrayFrom(buckets.keys()).filter((name) => name && name.charAt(0) === "_").map((name) => {
|
|
133016
133082
|
const entries = buckets.get(name);
|
|
@@ -133219,12 +133285,12 @@ ${lanes.join("\n")}
|
|
|
133219
133285
|
|
|
133220
133286
|
// src/services/getEditsForFileRename.ts
|
|
133221
133287
|
function getEditsForFileRename(program, oldFileOrDirPath, newFileOrDirPath, host, formatContext, preferences, sourceMapper) {
|
|
133222
|
-
const
|
|
133223
|
-
const getCanonicalFileName = createGetCanonicalFileName(
|
|
133288
|
+
const useCaseSensitiveFileNames2 = hostUsesCaseSensitiveFileNames(host);
|
|
133289
|
+
const getCanonicalFileName = createGetCanonicalFileName(useCaseSensitiveFileNames2);
|
|
133224
133290
|
const oldToNew = getPathUpdater(oldFileOrDirPath, newFileOrDirPath, getCanonicalFileName, sourceMapper);
|
|
133225
133291
|
const newToOld = getPathUpdater(newFileOrDirPath, oldFileOrDirPath, getCanonicalFileName, sourceMapper);
|
|
133226
133292
|
return ts_textChanges_exports.ChangeTracker.with({ host, formatContext, preferences }, (changeTracker) => {
|
|
133227
|
-
updateTsconfigFiles(program, changeTracker, oldToNew, oldFileOrDirPath, newFileOrDirPath, host.getCurrentDirectory(),
|
|
133293
|
+
updateTsconfigFiles(program, changeTracker, oldToNew, oldFileOrDirPath, newFileOrDirPath, host.getCurrentDirectory(), useCaseSensitiveFileNames2);
|
|
133228
133294
|
updateImports(program, changeTracker, oldToNew, newToOld, host, getCanonicalFileName);
|
|
133229
133295
|
});
|
|
133230
133296
|
}
|
|
@@ -133246,7 +133312,7 @@ ${lanes.join("\n")}
|
|
|
133246
133312
|
const rel = getRelativePathFromFile(a0, b0, getCanonicalFileName);
|
|
133247
133313
|
return combinePathsSafe(getDirectoryPath(a1), rel);
|
|
133248
133314
|
}
|
|
133249
|
-
function updateTsconfigFiles(program, changeTracker, oldToNew, oldFileOrDirPath, newFileOrDirPath, currentDirectory,
|
|
133315
|
+
function updateTsconfigFiles(program, changeTracker, oldToNew, oldFileOrDirPath, newFileOrDirPath, currentDirectory, useCaseSensitiveFileNames2) {
|
|
133250
133316
|
const { configFile } = program.getCompilerOptions();
|
|
133251
133317
|
if (!configFile)
|
|
133252
133318
|
return;
|
|
@@ -133270,10 +133336,10 @@ ${lanes.join("\n")}
|
|
|
133270
133336
|
/*excludes*/
|
|
133271
133337
|
[],
|
|
133272
133338
|
includes,
|
|
133273
|
-
|
|
133339
|
+
useCaseSensitiveFileNames2,
|
|
133274
133340
|
currentDirectory
|
|
133275
133341
|
);
|
|
133276
|
-
if (getRegexFromPattern(Debug.checkDefined(matchers.includeFilePattern),
|
|
133342
|
+
if (getRegexFromPattern(Debug.checkDefined(matchers.includeFilePattern), useCaseSensitiveFileNames2).test(oldFileOrDirPath) && !getRegexFromPattern(Debug.checkDefined(matchers.includeFilePattern), useCaseSensitiveFileNames2).test(newFileOrDirPath)) {
|
|
133277
133343
|
changeTracker.insertNodeAfter(configFile, last(property.initializer.elements), factory.createStringLiteral(relativePath(newFileOrDirPath)));
|
|
133278
133344
|
}
|
|
133279
133345
|
return;
|
|
@@ -133321,7 +133387,7 @@ ${lanes.join("\n")}
|
|
|
133321
133387
|
configDir,
|
|
133322
133388
|
path,
|
|
133323
133389
|
/*ignoreCase*/
|
|
133324
|
-
!
|
|
133390
|
+
!useCaseSensitiveFileNames2
|
|
133325
133391
|
);
|
|
133326
133392
|
}
|
|
133327
133393
|
}
|
|
@@ -136635,7 +136701,7 @@ ${lanes.join("\n")}
|
|
|
136635
136701
|
const body = addExports(oldFile, toMove.all, usage.oldFileImportsFromTargetFile, useEsModuleSyntax);
|
|
136636
136702
|
if (typeof targetFile !== "string") {
|
|
136637
136703
|
if (targetFile.statements.length > 0) {
|
|
136638
|
-
changes
|
|
136704
|
+
moveStatementsToTargetFile(changes, program, body, targetFile, toMove);
|
|
136639
136705
|
} else {
|
|
136640
136706
|
changes.insertNodesAtEndOfFile(
|
|
136641
136707
|
targetFile,
|
|
@@ -137428,6 +137494,67 @@ ${lanes.join("\n")}
|
|
|
137428
137494
|
return false;
|
|
137429
137495
|
}
|
|
137430
137496
|
}
|
|
137497
|
+
function moveStatementsToTargetFile(changes, program, statements, targetFile, toMove) {
|
|
137498
|
+
var _a;
|
|
137499
|
+
const removedExports = /* @__PURE__ */ new Set();
|
|
137500
|
+
const targetExports = (_a = targetFile.symbol) == null ? void 0 : _a.exports;
|
|
137501
|
+
if (targetExports) {
|
|
137502
|
+
const checker = program.getTypeChecker();
|
|
137503
|
+
const targetToSourceExports = /* @__PURE__ */ new Map();
|
|
137504
|
+
for (const node of toMove.all) {
|
|
137505
|
+
if (isTopLevelDeclarationStatement(node) && hasSyntacticModifier(node, 1 /* Export */)) {
|
|
137506
|
+
forEachTopLevelDeclaration(node, (declaration) => {
|
|
137507
|
+
var _a2;
|
|
137508
|
+
const targetDeclarations = canHaveSymbol(declaration) ? (_a2 = targetExports.get(declaration.symbol.escapedName)) == null ? void 0 : _a2.declarations : void 0;
|
|
137509
|
+
const exportDeclaration = firstDefined(targetDeclarations, (d) => isExportDeclaration(d) ? d : isExportSpecifier(d) ? tryCast(d.parent.parent, isExportDeclaration) : void 0);
|
|
137510
|
+
if (exportDeclaration && exportDeclaration.moduleSpecifier) {
|
|
137511
|
+
targetToSourceExports.set(
|
|
137512
|
+
exportDeclaration,
|
|
137513
|
+
(targetToSourceExports.get(exportDeclaration) || /* @__PURE__ */ new Set()).add(declaration)
|
|
137514
|
+
);
|
|
137515
|
+
}
|
|
137516
|
+
});
|
|
137517
|
+
}
|
|
137518
|
+
}
|
|
137519
|
+
for (const [exportDeclaration, topLevelDeclarations] of arrayFrom(targetToSourceExports)) {
|
|
137520
|
+
if (exportDeclaration.exportClause && isNamedExports(exportDeclaration.exportClause) && length(exportDeclaration.exportClause.elements)) {
|
|
137521
|
+
const elements = exportDeclaration.exportClause.elements;
|
|
137522
|
+
const updatedElements = filter(elements, (elem) => find(skipAlias(elem.symbol, checker).declarations, (d) => isTopLevelDeclaration(d) && topLevelDeclarations.has(d)) === void 0);
|
|
137523
|
+
if (length(updatedElements) === 0) {
|
|
137524
|
+
changes.deleteNode(targetFile, exportDeclaration);
|
|
137525
|
+
removedExports.add(exportDeclaration);
|
|
137526
|
+
continue;
|
|
137527
|
+
}
|
|
137528
|
+
if (length(updatedElements) < length(elements)) {
|
|
137529
|
+
changes.replaceNode(
|
|
137530
|
+
targetFile,
|
|
137531
|
+
exportDeclaration,
|
|
137532
|
+
factory.updateExportDeclaration(
|
|
137533
|
+
exportDeclaration,
|
|
137534
|
+
exportDeclaration.modifiers,
|
|
137535
|
+
exportDeclaration.isTypeOnly,
|
|
137536
|
+
factory.updateNamedExports(exportDeclaration.exportClause, factory.createNodeArray(updatedElements, elements.hasTrailingComma)),
|
|
137537
|
+
exportDeclaration.moduleSpecifier,
|
|
137538
|
+
exportDeclaration.assertClause
|
|
137539
|
+
)
|
|
137540
|
+
);
|
|
137541
|
+
}
|
|
137542
|
+
}
|
|
137543
|
+
}
|
|
137544
|
+
}
|
|
137545
|
+
const lastReExport = findLast(targetFile.statements, (n) => isExportDeclaration(n) && !!n.moduleSpecifier && !removedExports.has(n));
|
|
137546
|
+
if (lastReExport) {
|
|
137547
|
+
changes.insertNodesBefore(
|
|
137548
|
+
targetFile,
|
|
137549
|
+
lastReExport,
|
|
137550
|
+
statements,
|
|
137551
|
+
/*blankLineBetween*/
|
|
137552
|
+
true
|
|
137553
|
+
);
|
|
137554
|
+
} else {
|
|
137555
|
+
changes.insertNodesAfter(targetFile, targetFile.statements[targetFile.statements.length - 1], statements);
|
|
137556
|
+
}
|
|
137557
|
+
}
|
|
137431
137558
|
function getOverloadRangeToMove(sourceFile, statement) {
|
|
137432
137559
|
if (isFunctionLikeDeclaration(statement)) {
|
|
137433
137560
|
const declarations = statement.symbol.declarations;
|
|
@@ -141463,10 +141590,10 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
|
|
|
141463
141590
|
host.log(message);
|
|
141464
141591
|
}
|
|
141465
141592
|
}
|
|
141466
|
-
const
|
|
141467
|
-
const getCanonicalFileName = createGetCanonicalFileName(
|
|
141593
|
+
const useCaseSensitiveFileNames2 = hostUsesCaseSensitiveFileNames(host);
|
|
141594
|
+
const getCanonicalFileName = createGetCanonicalFileName(useCaseSensitiveFileNames2);
|
|
141468
141595
|
const sourceMapper = getSourceMapper({
|
|
141469
|
-
useCaseSensitiveFileNames: () =>
|
|
141596
|
+
useCaseSensitiveFileNames: () => useCaseSensitiveFileNames2,
|
|
141470
141597
|
getCurrentDirectory: () => currentDirectory,
|
|
141471
141598
|
getProgram,
|
|
141472
141599
|
fileExists: maybeBind(host, host.fileExists),
|
|
@@ -141514,7 +141641,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
|
|
|
141514
141641
|
getSourceFileByPath: getOrCreateSourceFileByPath,
|
|
141515
141642
|
getCancellationToken: () => cancellationToken,
|
|
141516
141643
|
getCanonicalFileName,
|
|
141517
|
-
useCaseSensitiveFileNames: () =>
|
|
141644
|
+
useCaseSensitiveFileNames: () => useCaseSensitiveFileNames2,
|
|
141518
141645
|
getNewLine: () => getNewLineCharacter(newSettings),
|
|
141519
141646
|
getDefaultLibFileName: (options2) => host.getDefaultLibFileName(options2),
|
|
141520
141647
|
writeFile: noop,
|
|
@@ -141558,9 +141685,12 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
|
|
|
141558
141685
|
compilerHost.getSourceFile = getSourceFileWithCache;
|
|
141559
141686
|
(_c = host.setCompilerHost) == null ? void 0 : _c.call(host, compilerHost);
|
|
141560
141687
|
const parseConfigHost = {
|
|
141561
|
-
useCaseSensitiveFileNames,
|
|
141688
|
+
useCaseSensitiveFileNames: useCaseSensitiveFileNames2,
|
|
141562
141689
|
fileExists: (fileName) => compilerHost.fileExists(fileName),
|
|
141563
141690
|
readFile: (fileName) => compilerHost.readFile(fileName),
|
|
141691
|
+
directoryExists: (f) => compilerHost.directoryExists(f),
|
|
141692
|
+
getDirectories: (f) => compilerHost.getDirectories(f),
|
|
141693
|
+
realpath: compilerHost.realpath,
|
|
141564
141694
|
readDirectory: (...args) => compilerHost.readDirectory(...args),
|
|
141565
141695
|
trace: compilerHost.trace,
|
|
141566
141696
|
getCurrentDirectory: compilerHost.getCurrentDirectory,
|
|
@@ -156899,6 +157029,13 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
|
|
|
156899
157029
|
data = originToCompletionEntryData(origin);
|
|
156900
157030
|
hasAction = !importStatementCompletion;
|
|
156901
157031
|
}
|
|
157032
|
+
const parentNamedImportOrExport = findAncestor(location, isNamedImportsOrExports);
|
|
157033
|
+
if ((parentNamedImportOrExport == null ? void 0 : parentNamedImportOrExport.kind) === 275 /* NamedImports */) {
|
|
157034
|
+
const possibleToken = stringToToken(name);
|
|
157035
|
+
if (parentNamedImportOrExport && possibleToken && (possibleToken === 135 /* AwaitKeyword */ || isNonContextualKeyword(possibleToken))) {
|
|
157036
|
+
insertText = `${name} as ${name}_`;
|
|
157037
|
+
}
|
|
157038
|
+
}
|
|
156902
157039
|
return {
|
|
156903
157040
|
name,
|
|
156904
157041
|
kind: ts_SymbolDisplay_exports.getSymbolKind(typeChecker, symbol, location),
|
|
@@ -157679,7 +157816,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
|
|
|
157679
157816
|
}
|
|
157680
157817
|
function getCompletionEntryCodeActionsAndSourceDisplay(name, location, contextToken, origin, symbol, program, host, compilerOptions, sourceFile, position, previousToken, formatContext, preferences, data, source, cancellationToken) {
|
|
157681
157818
|
if (data == null ? void 0 : data.moduleSpecifier) {
|
|
157682
|
-
if (previousToken && getImportStatementCompletionInfo(contextToken || previousToken).replacementSpan) {
|
|
157819
|
+
if (previousToken && getImportStatementCompletionInfo(contextToken || previousToken, sourceFile).replacementSpan) {
|
|
157683
157820
|
return { codeActions: void 0, sourceDisplay: [textPart(data.moduleSpecifier)] };
|
|
157684
157821
|
}
|
|
157685
157822
|
}
|
|
@@ -157892,7 +158029,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
|
|
|
157892
158029
|
let isNewIdentifierLocation = false;
|
|
157893
158030
|
let flags = 0 /* None */;
|
|
157894
158031
|
if (contextToken) {
|
|
157895
|
-
const importStatementCompletionInfo = getImportStatementCompletionInfo(contextToken);
|
|
158032
|
+
const importStatementCompletionInfo = getImportStatementCompletionInfo(contextToken, sourceFile);
|
|
157896
158033
|
if (importStatementCompletionInfo.keywordCompletion) {
|
|
157897
158034
|
if (importStatementCompletionInfo.isKeywordOnlyCompletion) {
|
|
157898
158035
|
return {
|
|
@@ -159523,7 +159660,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
|
|
|
159523
159660
|
}
|
|
159524
159661
|
return void 0;
|
|
159525
159662
|
}
|
|
159526
|
-
function getImportStatementCompletionInfo(contextToken) {
|
|
159663
|
+
function getImportStatementCompletionInfo(contextToken, sourceFile) {
|
|
159527
159664
|
var _a, _b, _c;
|
|
159528
159665
|
let keywordCompletion;
|
|
159529
159666
|
let isKeywordOnlyCompletion = false;
|
|
@@ -159539,6 +159676,12 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
|
|
|
159539
159676
|
function getCandidate() {
|
|
159540
159677
|
const parent2 = contextToken.parent;
|
|
159541
159678
|
if (isImportEqualsDeclaration(parent2)) {
|
|
159679
|
+
const lastToken = parent2.getLastToken(sourceFile);
|
|
159680
|
+
if (isIdentifier(contextToken) && lastToken !== contextToken) {
|
|
159681
|
+
keywordCompletion = 161 /* FromKeyword */;
|
|
159682
|
+
isKeywordOnlyCompletion = true;
|
|
159683
|
+
return void 0;
|
|
159684
|
+
}
|
|
159542
159685
|
keywordCompletion = contextToken.kind === 156 /* TypeKeyword */ ? void 0 : 156 /* TypeKeyword */;
|
|
159543
159686
|
return isModuleSpecifierMissingOrEmpty(parent2.moduleReference) ? parent2 : void 0;
|
|
159544
159687
|
}
|
|
@@ -160106,7 +160249,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
|
|
|
160106
160249
|
extensionOptions,
|
|
160107
160250
|
host,
|
|
160108
160251
|
/*moduleSpecifierIsRelative*/
|
|
160109
|
-
|
|
160252
|
+
true,
|
|
160110
160253
|
scriptPath
|
|
160111
160254
|
).values());
|
|
160112
160255
|
}
|
|
@@ -160438,16 +160581,18 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
|
|
|
160438
160581
|
const fragmentDirectory = fragmentHasPath ? hasTrailingDirectorySeparator(fragment) ? fragment : getDirectoryPath(fragment) : void 0;
|
|
160439
160582
|
const expandedPrefixDirectory = fragmentHasPath ? combinePaths(normalizedPrefixDirectory, normalizedPrefixBase + fragmentDirectory) : normalizedPrefixDirectory;
|
|
160440
160583
|
const normalizedSuffix = normalizePath(parsed.suffix);
|
|
160584
|
+
const declarationExtension = normalizedSuffix && getDeclarationEmitExtensionForPath("_" + normalizedSuffix);
|
|
160585
|
+
const matchingSuffixes = declarationExtension ? [changeExtension(normalizedSuffix, declarationExtension), normalizedSuffix] : [normalizedSuffix];
|
|
160441
160586
|
const baseDirectory = normalizePath(combinePaths(packageDirectory, expandedPrefixDirectory));
|
|
160442
160587
|
const completePrefix = fragmentHasPath ? baseDirectory : ensureTrailingDirectorySeparator(baseDirectory) + normalizedPrefixBase;
|
|
160443
|
-
const
|
|
160588
|
+
const includeGlobs = normalizedSuffix ? matchingSuffixes.map((suffix) => "**/*" + suffix) : ["./*"];
|
|
160444
160589
|
const matches = mapDefined(tryReadDirectory(
|
|
160445
160590
|
host,
|
|
160446
160591
|
baseDirectory,
|
|
160447
160592
|
extensionOptions.extensionsToSearch,
|
|
160448
160593
|
/*exclude*/
|
|
160449
160594
|
void 0,
|
|
160450
|
-
|
|
160595
|
+
includeGlobs
|
|
160451
160596
|
), (match) => {
|
|
160452
160597
|
const trimmedWithPattern = trimPrefixAndSuffix(match);
|
|
160453
160598
|
if (trimmedWithPattern) {
|
|
@@ -160461,8 +160606,10 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
|
|
|
160461
160606
|
const directories = normalizedSuffix ? emptyArray : mapDefined(tryGetDirectories(host, baseDirectory), (dir) => dir === "node_modules" ? void 0 : directoryResult(dir));
|
|
160462
160607
|
return [...matches, ...directories];
|
|
160463
160608
|
function trimPrefixAndSuffix(path) {
|
|
160464
|
-
|
|
160465
|
-
|
|
160609
|
+
return firstDefined(matchingSuffixes, (suffix) => {
|
|
160610
|
+
const inner = withoutStartAndEnd(normalizePath(path), completePrefix, suffix);
|
|
160611
|
+
return inner === void 0 ? void 0 : removeLeadingDirectorySeparator(inner);
|
|
160612
|
+
});
|
|
160466
160613
|
}
|
|
160467
160614
|
}
|
|
160468
160615
|
function withoutStartAndEnd(s, start, end) {
|
|
@@ -167777,6 +167924,9 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
|
|
|
167777
167924
|
insertNodeBefore(sourceFile, before, newNode, blankLineBetween = false, options = {}) {
|
|
167778
167925
|
this.insertNodeAt(sourceFile, getAdjustedStartPosition(sourceFile, before, options), newNode, this.getOptionsForInsertNodeBefore(before, newNode, blankLineBetween));
|
|
167779
167926
|
}
|
|
167927
|
+
insertNodesBefore(sourceFile, before, newNodes, blankLineBetween = false, options = {}) {
|
|
167928
|
+
this.insertNodesAt(sourceFile, getAdjustedStartPosition(sourceFile, before, options), newNodes, this.getOptionsForInsertNodeBefore(before, first(newNodes), blankLineBetween));
|
|
167929
|
+
}
|
|
167780
167930
|
insertModifierAt(sourceFile, pos, modifier, options = {}) {
|
|
167781
167931
|
this.insertNodeAt(sourceFile, pos, factory.createToken(modifier), options);
|
|
167782
167932
|
}
|
|
@@ -174417,7 +174567,7 @@ ${options.prefix}` : "\n" : options.prefix
|
|
|
174417
174567
|
return this.projectService.includePackageJsonAutoImports();
|
|
174418
174568
|
}
|
|
174419
174569
|
/** @internal */
|
|
174420
|
-
|
|
174570
|
+
getHostForAutoImportProvider() {
|
|
174421
174571
|
var _a, _b;
|
|
174422
174572
|
if (this.program) {
|
|
174423
174573
|
return {
|
|
@@ -174428,7 +174578,8 @@ ${options.prefix}` : "\n" : options.prefix
|
|
|
174428
174578
|
readFile: this.projectService.host.readFile.bind(this.projectService.host),
|
|
174429
174579
|
getDirectories: this.projectService.host.getDirectories.bind(this.projectService.host),
|
|
174430
174580
|
trace: (_b = this.projectService.host.trace) == null ? void 0 : _b.bind(this.projectService.host),
|
|
174431
|
-
useCaseSensitiveFileNames: this.program.useCaseSensitiveFileNames()
|
|
174581
|
+
useCaseSensitiveFileNames: this.program.useCaseSensitiveFileNames(),
|
|
174582
|
+
readDirectory: this.projectService.host.readDirectory.bind(this.projectService.host)
|
|
174432
174583
|
};
|
|
174433
174584
|
}
|
|
174434
174585
|
return this.projectService.host;
|
|
@@ -174456,7 +174607,7 @@ ${options.prefix}` : "\n" : options.prefix
|
|
|
174456
174607
|
if (dependencySelection) {
|
|
174457
174608
|
(_a = tracing) == null ? void 0 : _a.push(tracing.Phase.Session, "getPackageJsonAutoImportProvider");
|
|
174458
174609
|
const start = timestamp();
|
|
174459
|
-
this.autoImportProviderHost = AutoImportProviderProject.create(dependencySelection, this, this.
|
|
174610
|
+
this.autoImportProviderHost = AutoImportProviderProject.create(dependencySelection, this, this.getHostForAutoImportProvider(), this.documentRegistry);
|
|
174460
174611
|
if (this.autoImportProviderHost) {
|
|
174461
174612
|
updateProjectIfDirty(this.autoImportProviderHost);
|
|
174462
174613
|
this.sendPerformanceEvent("CreatePackageJsonAutoImportProvider", timestamp() - start);
|
|
@@ -174672,7 +174823,7 @@ ${options.prefix}` : "\n" : options.prefix
|
|
|
174672
174823
|
this.getParsedCommandLine = maybeBind(this.hostProject, this.hostProject.getParsedCommandLine);
|
|
174673
174824
|
}
|
|
174674
174825
|
/** @internal */
|
|
174675
|
-
static getRootFileNames(dependencySelection, hostProject,
|
|
174826
|
+
static getRootFileNames(dependencySelection, hostProject, host, compilerOptions) {
|
|
174676
174827
|
var _a, _b;
|
|
174677
174828
|
if (!dependencySelection) {
|
|
174678
174829
|
return emptyArray;
|
|
@@ -174702,7 +174853,7 @@ ${options.prefix}` : "\n" : options.prefix
|
|
|
174702
174853
|
name,
|
|
174703
174854
|
hostProject.currentDirectory,
|
|
174704
174855
|
compilerOptions,
|
|
174705
|
-
|
|
174856
|
+
host,
|
|
174706
174857
|
program.getModuleResolutionCache()
|
|
174707
174858
|
);
|
|
174708
174859
|
if (packageJson) {
|
|
@@ -174719,7 +174870,7 @@ ${options.prefix}` : "\n" : options.prefix
|
|
|
174719
174870
|
`@types/${name}`,
|
|
174720
174871
|
directory,
|
|
174721
174872
|
compilerOptions,
|
|
174722
|
-
|
|
174873
|
+
host,
|
|
174723
174874
|
program.getModuleResolutionCache()
|
|
174724
174875
|
);
|
|
174725
174876
|
if (typesPackageJson) {
|
|
@@ -174759,12 +174910,12 @@ ${options.prefix}` : "\n" : options.prefix
|
|
|
174759
174910
|
const entrypoints = getEntrypointsFromPackageJsonInfo(
|
|
174760
174911
|
packageJson,
|
|
174761
174912
|
compilerOptions,
|
|
174762
|
-
|
|
174913
|
+
host,
|
|
174763
174914
|
program2.getModuleResolutionCache(),
|
|
174764
174915
|
resolveJs
|
|
174765
174916
|
);
|
|
174766
174917
|
if (entrypoints) {
|
|
174767
|
-
const real = (_a2 =
|
|
174918
|
+
const real = (_a2 = host.realpath) == null ? void 0 : _a2.call(host, packageJson.packageDirectory);
|
|
174768
174919
|
const isSymlink = real && real !== packageJson.packageDirectory;
|
|
174769
174920
|
if (isSymlink) {
|
|
174770
174921
|
symlinkCache.setSymlinkedDirectory(packageJson.packageDirectory, {
|
|
@@ -174782,7 +174933,7 @@ ${options.prefix}` : "\n" : options.prefix
|
|
|
174782
174933
|
}
|
|
174783
174934
|
}
|
|
174784
174935
|
/** @internal */
|
|
174785
|
-
static create(dependencySelection, hostProject,
|
|
174936
|
+
static create(dependencySelection, hostProject, host, documentRegistry) {
|
|
174786
174937
|
if (dependencySelection === 0 /* Off */) {
|
|
174787
174938
|
return void 0;
|
|
174788
174939
|
}
|
|
@@ -174790,7 +174941,7 @@ ${options.prefix}` : "\n" : options.prefix
|
|
|
174790
174941
|
...hostProject.getCompilerOptions(),
|
|
174791
174942
|
...this.compilerOptionsOverrides
|
|
174792
174943
|
};
|
|
174793
|
-
const rootNames = this.getRootFileNames(dependencySelection, hostProject,
|
|
174944
|
+
const rootNames = this.getRootFileNames(dependencySelection, hostProject, host, compilerOptions);
|
|
174794
174945
|
if (!rootNames.length) {
|
|
174795
174946
|
return void 0;
|
|
174796
174947
|
}
|
|
@@ -174809,7 +174960,7 @@ ${options.prefix}` : "\n" : options.prefix
|
|
|
174809
174960
|
rootFileNames = _AutoImportProviderProject.getRootFileNames(
|
|
174810
174961
|
this.hostProject.includePackageJsonAutoImports(),
|
|
174811
174962
|
this.hostProject,
|
|
174812
|
-
this.hostProject.
|
|
174963
|
+
this.hostProject.getHostForAutoImportProvider(),
|
|
174813
174964
|
this.getCompilationSettings()
|
|
174814
174965
|
);
|
|
174815
174966
|
}
|
|
@@ -174848,7 +174999,7 @@ ${options.prefix}` : "\n" : options.prefix
|
|
|
174848
174999
|
onPackageJsonChange() {
|
|
174849
175000
|
throw new Error("package.json changes should be notified on an AutoImportProvider's host project");
|
|
174850
175001
|
}
|
|
174851
|
-
|
|
175002
|
+
getHostForAutoImportProvider() {
|
|
174852
175003
|
throw new Error("AutoImportProviderProject cannot provide its own host; use `hostProject.getModuleResolutionHostForAutomImportProvider()` instead.");
|
|
174853
175004
|
}
|
|
174854
175005
|
getProjectReferences() {
|