typescript 5.2.0-dev.20230706 → 5.2.0-dev.20230708
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 +118 -105
- package/lib/tsserver.js +272 -155
- package/lib/tsserverlibrary.d.ts +5 -1
- package/lib/tsserverlibrary.js +272 -155
- package/lib/typescript.d.ts +4 -0
- package/lib/typescript.js +259 -143
- package/lib/typingsInstaller.js +63 -66
- package/package.json +2 -2
package/lib/tsserver.js
CHANGED
|
@@ -2327,7 +2327,7 @@ module.exports = __toCommonJS(server_exports);
|
|
|
2327
2327
|
|
|
2328
2328
|
// src/compiler/corePublic.ts
|
|
2329
2329
|
var versionMajorMinor = "5.2";
|
|
2330
|
-
var version = `${versionMajorMinor}.0-dev.
|
|
2330
|
+
var version = `${versionMajorMinor}.0-dev.20230708`;
|
|
2331
2331
|
var Comparison = /* @__PURE__ */ ((Comparison3) => {
|
|
2332
2332
|
Comparison3[Comparison3["LessThan"] = -1] = "LessThan";
|
|
2333
2333
|
Comparison3[Comparison3["EqualTo"] = 0] = "EqualTo";
|
|
@@ -3839,8 +3839,8 @@ function unorderedRemoveFirstItemWhere(array, predicate) {
|
|
|
3839
3839
|
}
|
|
3840
3840
|
return false;
|
|
3841
3841
|
}
|
|
3842
|
-
function createGetCanonicalFileName(
|
|
3843
|
-
return
|
|
3842
|
+
function createGetCanonicalFileName(useCaseSensitiveFileNames2) {
|
|
3843
|
+
return useCaseSensitiveFileNames2 ? identity : toFileNameLowerCase;
|
|
3844
3844
|
}
|
|
3845
3845
|
function patternText({ prefix, suffix }) {
|
|
3846
3846
|
return `${prefix}*${suffix}`;
|
|
@@ -7677,10 +7677,10 @@ function createDynamicPriorityPollingWatchFile(host) {
|
|
|
7677
7677
|
pollingIntervalQueue(pollingInterval).pollScheduled = host.setTimeout(pollingInterval === 250 /* Low */ ? pollLowPollingIntervalQueue : pollPollingIntervalQueue, pollingInterval, pollingInterval === 250 /* Low */ ? "pollLowPollingIntervalQueue" : "pollPollingIntervalQueue", pollingIntervalQueue(pollingInterval));
|
|
7678
7678
|
}
|
|
7679
7679
|
}
|
|
7680
|
-
function createUseFsEventsOnParentDirectoryWatchFile(fsWatch,
|
|
7680
|
+
function createUseFsEventsOnParentDirectoryWatchFile(fsWatch, useCaseSensitiveFileNames2) {
|
|
7681
7681
|
const fileWatcherCallbacks = createMultiMap();
|
|
7682
7682
|
const dirWatchers = /* @__PURE__ */ new Map();
|
|
7683
|
-
const toCanonicalName = createGetCanonicalFileName(
|
|
7683
|
+
const toCanonicalName = createGetCanonicalFileName(useCaseSensitiveFileNames2);
|
|
7684
7684
|
return nonPollingWatchFile;
|
|
7685
7685
|
function nonPollingWatchFile(fileName, callback, _pollingInterval, fallbackOptions) {
|
|
7686
7686
|
const filePath = toCanonicalName(fileName);
|
|
@@ -7756,8 +7756,8 @@ function createFixedChunkSizePollingWatchFile(host) {
|
|
|
7756
7756
|
pollScheduled = host.setTimeout(pollQueue, 2e3 /* High */, "pollQueue");
|
|
7757
7757
|
}
|
|
7758
7758
|
}
|
|
7759
|
-
function createSingleWatcherPerName(cache,
|
|
7760
|
-
const toCanonicalFileName = createGetCanonicalFileName(
|
|
7759
|
+
function createSingleWatcherPerName(cache, useCaseSensitiveFileNames2, name, callback, createWatcher) {
|
|
7760
|
+
const toCanonicalFileName = createGetCanonicalFileName(useCaseSensitiveFileNames2);
|
|
7761
7761
|
const path = toCanonicalFileName(name);
|
|
7762
7762
|
const existing = cache.get(path);
|
|
7763
7763
|
if (existing) {
|
|
@@ -7809,7 +7809,7 @@ function setSysLog(logger) {
|
|
|
7809
7809
|
}
|
|
7810
7810
|
function createDirectoryWatcherSupportingRecursive({
|
|
7811
7811
|
watchDirectory,
|
|
7812
|
-
useCaseSensitiveFileNames,
|
|
7812
|
+
useCaseSensitiveFileNames: useCaseSensitiveFileNames2,
|
|
7813
7813
|
getCurrentDirectory,
|
|
7814
7814
|
getAccessibleSortedChildDirectories,
|
|
7815
7815
|
fileSystemEntryExists,
|
|
@@ -7821,8 +7821,8 @@ function createDirectoryWatcherSupportingRecursive({
|
|
|
7821
7821
|
const callbackCache = createMultiMap();
|
|
7822
7822
|
const cacheToUpdateChildWatches = /* @__PURE__ */ new Map();
|
|
7823
7823
|
let timerToUpdateChildWatches;
|
|
7824
|
-
const filePathComparer = getStringComparer(!
|
|
7825
|
-
const toCanonicalFilePath = createGetCanonicalFileName(
|
|
7824
|
+
const filePathComparer = getStringComparer(!useCaseSensitiveFileNames2);
|
|
7825
|
+
const toCanonicalFilePath = createGetCanonicalFileName(useCaseSensitiveFileNames2);
|
|
7826
7826
|
return (dirName, callback, recursive, options) => recursive ? createDirectoryWatcher(dirName, options, callback) : watchDirectory(dirName, callback, recursive, options);
|
|
7827
7827
|
function createDirectoryWatcher(dirName, options, callback) {
|
|
7828
7828
|
const dirPath = toCanonicalFilePath(dirName);
|
|
@@ -7989,12 +7989,12 @@ function createDirectoryWatcherSupportingRecursive({
|
|
|
7989
7989
|
}
|
|
7990
7990
|
}
|
|
7991
7991
|
function isIgnoredPath(path, options) {
|
|
7992
|
-
return some(ignoredPaths, (searchPath) => isInPath(path, searchPath)) || isIgnoredByWatchOptions(path, options,
|
|
7992
|
+
return some(ignoredPaths, (searchPath) => isInPath(path, searchPath)) || isIgnoredByWatchOptions(path, options, useCaseSensitiveFileNames2, getCurrentDirectory);
|
|
7993
7993
|
}
|
|
7994
7994
|
function isInPath(path, searchPath) {
|
|
7995
7995
|
if (stringContains(path, searchPath))
|
|
7996
7996
|
return true;
|
|
7997
|
-
if (
|
|
7997
|
+
if (useCaseSensitiveFileNames2)
|
|
7998
7998
|
return false;
|
|
7999
7999
|
return stringContains(toCanonicalFilePath(path), searchPath);
|
|
8000
8000
|
}
|
|
@@ -8017,14 +8017,14 @@ function createFsWatchCallbackForFileWatcherCallback(fileName, callback, getModi
|
|
|
8017
8017
|
}
|
|
8018
8018
|
};
|
|
8019
8019
|
}
|
|
8020
|
-
function isIgnoredByWatchOptions(pathToCheck, options,
|
|
8021
|
-
return ((options == null ? void 0 : options.excludeDirectories) || (options == null ? void 0 : options.excludeFiles)) && (matchesExclude(pathToCheck, options == null ? void 0 : options.excludeFiles,
|
|
8020
|
+
function isIgnoredByWatchOptions(pathToCheck, options, useCaseSensitiveFileNames2, getCurrentDirectory) {
|
|
8021
|
+
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()));
|
|
8022
8022
|
}
|
|
8023
|
-
function createFsWatchCallbackForDirectoryWatcherCallback(directoryName, callback, options,
|
|
8023
|
+
function createFsWatchCallbackForDirectoryWatcherCallback(directoryName, callback, options, useCaseSensitiveFileNames2, getCurrentDirectory) {
|
|
8024
8024
|
return (eventName, relativeFileName) => {
|
|
8025
8025
|
if (eventName === "rename") {
|
|
8026
8026
|
const fileName = !relativeFileName ? directoryName : normalizePath(combinePaths(directoryName, relativeFileName));
|
|
8027
|
-
if (!relativeFileName || !isIgnoredByWatchOptions(fileName, options,
|
|
8027
|
+
if (!relativeFileName || !isIgnoredByWatchOptions(fileName, options, useCaseSensitiveFileNames2, getCurrentDirectory)) {
|
|
8028
8028
|
callback(fileName);
|
|
8029
8029
|
}
|
|
8030
8030
|
}
|
|
@@ -8037,7 +8037,7 @@ function createSystemWatchFunctions({
|
|
|
8037
8037
|
clearTimeout: clearTimeout2,
|
|
8038
8038
|
fsWatchWorker,
|
|
8039
8039
|
fileSystemEntryExists,
|
|
8040
|
-
useCaseSensitiveFileNames,
|
|
8040
|
+
useCaseSensitiveFileNames: useCaseSensitiveFileNames2,
|
|
8041
8041
|
getCurrentDirectory,
|
|
8042
8042
|
fsSupportsRecursiveFsWatch,
|
|
8043
8043
|
getAccessibleSortedChildDirectories,
|
|
@@ -8109,7 +8109,7 @@ function createSystemWatchFunctions({
|
|
|
8109
8109
|
);
|
|
8110
8110
|
case 5 /* UseFsEventsOnParentDirectory */:
|
|
8111
8111
|
if (!nonPollingWatchFile) {
|
|
8112
|
-
nonPollingWatchFile = createUseFsEventsOnParentDirectoryWatchFile(fsWatch,
|
|
8112
|
+
nonPollingWatchFile = createUseFsEventsOnParentDirectoryWatchFile(fsWatch, useCaseSensitiveFileNames2);
|
|
8113
8113
|
}
|
|
8114
8114
|
return nonPollingWatchFile(fileName, callback, pollingInterval, getFallbackOptions(options));
|
|
8115
8115
|
default:
|
|
@@ -8158,7 +8158,7 @@ function createSystemWatchFunctions({
|
|
|
8158
8158
|
return fsWatch(
|
|
8159
8159
|
directoryName,
|
|
8160
8160
|
1 /* Directory */,
|
|
8161
|
-
createFsWatchCallbackForDirectoryWatcherCallback(directoryName, callback, options,
|
|
8161
|
+
createFsWatchCallbackForDirectoryWatcherCallback(directoryName, callback, options, useCaseSensitiveFileNames2, getCurrentDirectory),
|
|
8162
8162
|
recursive,
|
|
8163
8163
|
500 /* Medium */,
|
|
8164
8164
|
getFallbackOptions(options)
|
|
@@ -8166,7 +8166,7 @@ function createSystemWatchFunctions({
|
|
|
8166
8166
|
}
|
|
8167
8167
|
if (!hostRecursiveDirectoryWatcher) {
|
|
8168
8168
|
hostRecursiveDirectoryWatcher = createDirectoryWatcherSupportingRecursive({
|
|
8169
|
-
useCaseSensitiveFileNames,
|
|
8169
|
+
useCaseSensitiveFileNames: useCaseSensitiveFileNames2,
|
|
8170
8170
|
getCurrentDirectory,
|
|
8171
8171
|
fileSystemEntryExists,
|
|
8172
8172
|
getAccessibleSortedChildDirectories,
|
|
@@ -8212,7 +8212,7 @@ function createSystemWatchFunctions({
|
|
|
8212
8212
|
return fsWatch(
|
|
8213
8213
|
directoryName,
|
|
8214
8214
|
1 /* Directory */,
|
|
8215
|
-
createFsWatchCallbackForDirectoryWatcherCallback(directoryName, callback, options,
|
|
8215
|
+
createFsWatchCallbackForDirectoryWatcherCallback(directoryName, callback, options, useCaseSensitiveFileNames2, getCurrentDirectory),
|
|
8216
8216
|
recursive,
|
|
8217
8217
|
500 /* Medium */,
|
|
8218
8218
|
getFallbackOptions(watchDirectoryOptions)
|
|
@@ -8240,7 +8240,7 @@ function createSystemWatchFunctions({
|
|
|
8240
8240
|
function pollingWatchFile(fileName, callback, pollingInterval, options) {
|
|
8241
8241
|
return createSingleWatcherPerName(
|
|
8242
8242
|
pollingWatches,
|
|
8243
|
-
|
|
8243
|
+
useCaseSensitiveFileNames2,
|
|
8244
8244
|
fileName,
|
|
8245
8245
|
callback,
|
|
8246
8246
|
(cb) => pollingWatchFileWorker(fileName, cb, pollingInterval, options)
|
|
@@ -8249,7 +8249,7 @@ function createSystemWatchFunctions({
|
|
|
8249
8249
|
function fsWatch(fileOrDirectory, entryKind, callback, recursive, fallbackPollingInterval, fallbackOptions) {
|
|
8250
8250
|
return createSingleWatcherPerName(
|
|
8251
8251
|
recursive ? fsWatchesRecursive : fsWatches,
|
|
8252
|
-
|
|
8252
|
+
useCaseSensitiveFileNames2,
|
|
8253
8253
|
fileOrDirectory,
|
|
8254
8254
|
callback,
|
|
8255
8255
|
(cb) => fsWatchHandlingExistenceOnHost(fileOrDirectory, entryKind, cb, recursive, fallbackPollingInterval, fallbackOptions)
|
|
@@ -8377,7 +8377,7 @@ var sys = (() => {
|
|
|
8377
8377
|
const Buffer2 = require("buffer").Buffer;
|
|
8378
8378
|
const isLinuxOrMacOs = process.platform === "linux" || process.platform === "darwin";
|
|
8379
8379
|
const platform = _os.platform();
|
|
8380
|
-
const
|
|
8380
|
+
const useCaseSensitiveFileNames2 = isFileSystemCaseSensitive();
|
|
8381
8381
|
const fsRealpath = !!_fs.realpathSync.native ? process.platform === "win32" ? fsRealPathHandlingLongPath : _fs.realpathSync.native : _fs.realpathSync;
|
|
8382
8382
|
const executingFilePath = __filename.endsWith("sys.js") ? _path.join(_path.dirname(__dirname), "__fake__.js") : __filename;
|
|
8383
8383
|
const fsSupportsRecursiveFsWatch = process.platform === "win32" || process.platform === "darwin";
|
|
@@ -8388,7 +8388,7 @@ var sys = (() => {
|
|
|
8388
8388
|
setTimeout,
|
|
8389
8389
|
clearTimeout,
|
|
8390
8390
|
fsWatchWorker,
|
|
8391
|
-
useCaseSensitiveFileNames,
|
|
8391
|
+
useCaseSensitiveFileNames: useCaseSensitiveFileNames2,
|
|
8392
8392
|
getCurrentDirectory,
|
|
8393
8393
|
fileSystemEntryExists,
|
|
8394
8394
|
// Node 4.0 `fs.watch` function supports the "recursive" option on both OSX and Windows
|
|
@@ -8405,7 +8405,7 @@ var sys = (() => {
|
|
|
8405
8405
|
const nodeSystem = {
|
|
8406
8406
|
args: process.argv.slice(2),
|
|
8407
8407
|
newLine: _os.EOL,
|
|
8408
|
-
useCaseSensitiveFileNames,
|
|
8408
|
+
useCaseSensitiveFileNames: useCaseSensitiveFileNames2,
|
|
8409
8409
|
write(s) {
|
|
8410
8410
|
process.stdout.write(s);
|
|
8411
8411
|
},
|
|
@@ -8534,12 +8534,12 @@ var sys = (() => {
|
|
|
8534
8534
|
for (const node of profile.nodes) {
|
|
8535
8535
|
if (node.callFrame.url) {
|
|
8536
8536
|
const url = normalizeSlashes(node.callFrame.url);
|
|
8537
|
-
if (containsPath(fileUrlRoot, url,
|
|
8537
|
+
if (containsPath(fileUrlRoot, url, useCaseSensitiveFileNames2)) {
|
|
8538
8538
|
node.callFrame.url = getRelativePathToDirectoryOrUrl(
|
|
8539
8539
|
fileUrlRoot,
|
|
8540
8540
|
url,
|
|
8541
8541
|
fileUrlRoot,
|
|
8542
|
-
createGetCanonicalFileName(
|
|
8542
|
+
createGetCanonicalFileName(useCaseSensitiveFileNames2),
|
|
8543
8543
|
/*isAbsolutePathAnUrl*/
|
|
8544
8544
|
true
|
|
8545
8545
|
);
|
|
@@ -8719,7 +8719,7 @@ var sys = (() => {
|
|
|
8719
8719
|
}
|
|
8720
8720
|
}
|
|
8721
8721
|
function readDirectory(path, extensions, excludes, includes, depth) {
|
|
8722
|
-
return matchFiles(path, extensions, excludes, includes,
|
|
8722
|
+
return matchFiles(path, extensions, excludes, includes, useCaseSensitiveFileNames2, process.cwd(), depth, getAccessibleFileSystemEntries, realpath);
|
|
8723
8723
|
}
|
|
8724
8724
|
function fileSystemEntryExists(path, entryKind) {
|
|
8725
8725
|
const originalStackTraceLimit = Error.stackTraceLimit;
|
|
@@ -12115,7 +12115,7 @@ function createScanner(languageVersion, skipTrivia2, languageVariant = 0 /* Stan
|
|
|
12115
12115
|
if (withMinus)
|
|
12116
12116
|
start3--;
|
|
12117
12117
|
error2(Diagnostics.Octal_literals_are_not_allowed_Use_the_syntax_0, start3, pos - start3, literal);
|
|
12118
|
-
return
|
|
12118
|
+
return 9 /* NumericLiteral */;
|
|
12119
12119
|
}
|
|
12120
12120
|
} else {
|
|
12121
12121
|
mainFragment = scanNumberFragment();
|
|
@@ -12155,20 +12155,18 @@ function createScanner(languageVersion, skipTrivia2, languageVariant = 0 /* Stan
|
|
|
12155
12155
|
}
|
|
12156
12156
|
if (tokenFlags & 8192 /* ContainsLeadingZero */) {
|
|
12157
12157
|
error2(Diagnostics.Decimals_with_leading_zeros_are_not_allowed, start3, end2 - start3);
|
|
12158
|
-
|
|
12158
|
+
tokenValue = "" + +result;
|
|
12159
|
+
return 9 /* NumericLiteral */;
|
|
12159
12160
|
}
|
|
12160
12161
|
if (decimalFragment !== void 0 || tokenFlags & 16 /* Scientific */) {
|
|
12161
12162
|
checkForIdentifierStartAfterNumericLiteral(start3, decimalFragment === void 0 && !!(tokenFlags & 16 /* Scientific */));
|
|
12162
|
-
|
|
12163
|
-
|
|
12164
|
-
value: "" + +result
|
|
12165
|
-
// if value is not an integer, it can be safely coerced to a number
|
|
12166
|
-
};
|
|
12163
|
+
tokenValue = "" + +result;
|
|
12164
|
+
return 9 /* NumericLiteral */;
|
|
12167
12165
|
} else {
|
|
12168
12166
|
tokenValue = result;
|
|
12169
12167
|
const type = checkBigIntSuffix();
|
|
12170
12168
|
checkForIdentifierStartAfterNumericLiteral(start3);
|
|
12171
|
-
return
|
|
12169
|
+
return type;
|
|
12172
12170
|
}
|
|
12173
12171
|
}
|
|
12174
12172
|
function checkForIdentifierStartAfterNumericLiteral(numericStart, isScientific) {
|
|
@@ -12777,7 +12775,7 @@ function createScanner(languageVersion, skipTrivia2, languageVariant = 0 /* Stan
|
|
|
12777
12775
|
return token = 41 /* MinusToken */;
|
|
12778
12776
|
case 46 /* dot */:
|
|
12779
12777
|
if (isDigit(text.charCodeAt(pos + 1))) {
|
|
12780
|
-
|
|
12778
|
+
scanNumber();
|
|
12781
12779
|
return token = 9 /* NumericLiteral */;
|
|
12782
12780
|
}
|
|
12783
12781
|
if (text.charCodeAt(pos + 1) === 46 /* dot */ && text.charCodeAt(pos + 2) === 46 /* dot */) {
|
|
@@ -12895,8 +12893,7 @@ function createScanner(languageVersion, skipTrivia2, languageVariant = 0 /* Stan
|
|
|
12895
12893
|
case 55 /* _7 */:
|
|
12896
12894
|
case 56 /* _8 */:
|
|
12897
12895
|
case 57 /* _9 */:
|
|
12898
|
-
|
|
12899
|
-
return token;
|
|
12896
|
+
return token = scanNumber();
|
|
12900
12897
|
case 58 /* colon */:
|
|
12901
12898
|
pos++;
|
|
12902
12899
|
return token = 59 /* ColonToken */;
|
|
@@ -20758,7 +20755,7 @@ function getSubPatternFromSpec(spec, basePath, usage, { singleAsteriskRegexFragm
|
|
|
20758
20755
|
function replaceWildcardCharacter(match, singleAsteriskRegexFragment) {
|
|
20759
20756
|
return match === "*" ? singleAsteriskRegexFragment : match === "?" ? "[^/]" : "\\" + match;
|
|
20760
20757
|
}
|
|
20761
|
-
function getFileMatcherPatterns(path, excludes, includes,
|
|
20758
|
+
function getFileMatcherPatterns(path, excludes, includes, useCaseSensitiveFileNames2, currentDirectory) {
|
|
20762
20759
|
path = normalizePath(path);
|
|
20763
20760
|
currentDirectory = normalizePath(currentDirectory);
|
|
20764
20761
|
const absolutePath = combinePaths(currentDirectory, path);
|
|
@@ -20767,22 +20764,22 @@ function getFileMatcherPatterns(path, excludes, includes, useCaseSensitiveFileNa
|
|
|
20767
20764
|
includeFilePattern: getRegularExpressionForWildcard(includes, absolutePath, "files"),
|
|
20768
20765
|
includeDirectoryPattern: getRegularExpressionForWildcard(includes, absolutePath, "directories"),
|
|
20769
20766
|
excludePattern: getRegularExpressionForWildcard(excludes, absolutePath, "exclude"),
|
|
20770
|
-
basePaths: getBasePaths(path, includes,
|
|
20767
|
+
basePaths: getBasePaths(path, includes, useCaseSensitiveFileNames2)
|
|
20771
20768
|
};
|
|
20772
20769
|
}
|
|
20773
|
-
function getRegexFromPattern(pattern,
|
|
20774
|
-
return new RegExp(pattern,
|
|
20770
|
+
function getRegexFromPattern(pattern, useCaseSensitiveFileNames2) {
|
|
20771
|
+
return new RegExp(pattern, useCaseSensitiveFileNames2 ? "" : "i");
|
|
20775
20772
|
}
|
|
20776
|
-
function matchFiles(path, extensions, excludes, includes,
|
|
20773
|
+
function matchFiles(path, extensions, excludes, includes, useCaseSensitiveFileNames2, currentDirectory, depth, getFileSystemEntries, realpath) {
|
|
20777
20774
|
path = normalizePath(path);
|
|
20778
20775
|
currentDirectory = normalizePath(currentDirectory);
|
|
20779
|
-
const patterns = getFileMatcherPatterns(path, excludes, includes,
|
|
20780
|
-
const includeFileRegexes = patterns.includeFilePatterns && patterns.includeFilePatterns.map((pattern) => getRegexFromPattern(pattern,
|
|
20781
|
-
const includeDirectoryRegex = patterns.includeDirectoryPattern && getRegexFromPattern(patterns.includeDirectoryPattern,
|
|
20782
|
-
const excludeRegex = patterns.excludePattern && getRegexFromPattern(patterns.excludePattern,
|
|
20776
|
+
const patterns = getFileMatcherPatterns(path, excludes, includes, useCaseSensitiveFileNames2, currentDirectory);
|
|
20777
|
+
const includeFileRegexes = patterns.includeFilePatterns && patterns.includeFilePatterns.map((pattern) => getRegexFromPattern(pattern, useCaseSensitiveFileNames2));
|
|
20778
|
+
const includeDirectoryRegex = patterns.includeDirectoryPattern && getRegexFromPattern(patterns.includeDirectoryPattern, useCaseSensitiveFileNames2);
|
|
20779
|
+
const excludeRegex = patterns.excludePattern && getRegexFromPattern(patterns.excludePattern, useCaseSensitiveFileNames2);
|
|
20783
20780
|
const results = includeFileRegexes ? includeFileRegexes.map(() => []) : [[]];
|
|
20784
20781
|
const visited = /* @__PURE__ */ new Map();
|
|
20785
|
-
const toCanonical = createGetCanonicalFileName(
|
|
20782
|
+
const toCanonical = createGetCanonicalFileName(useCaseSensitiveFileNames2);
|
|
20786
20783
|
for (const basePath of patterns.basePaths) {
|
|
20787
20784
|
visitDirectory(basePath, combinePaths(currentDirectory, basePath), depth);
|
|
20788
20785
|
}
|
|
@@ -20824,7 +20821,7 @@ function matchFiles(path, extensions, excludes, includes, useCaseSensitiveFileNa
|
|
|
20824
20821
|
}
|
|
20825
20822
|
}
|
|
20826
20823
|
}
|
|
20827
|
-
function getBasePaths(path, includes,
|
|
20824
|
+
function getBasePaths(path, includes, useCaseSensitiveFileNames2) {
|
|
20828
20825
|
const basePaths = [path];
|
|
20829
20826
|
if (includes) {
|
|
20830
20827
|
const includeBasePaths = [];
|
|
@@ -20832,9 +20829,9 @@ function getBasePaths(path, includes, useCaseSensitiveFileNames) {
|
|
|
20832
20829
|
const absolute = isRootedDiskPath(include) ? include : normalizePath(combinePaths(path, include));
|
|
20833
20830
|
includeBasePaths.push(getIncludeBasePath(absolute));
|
|
20834
20831
|
}
|
|
20835
|
-
includeBasePaths.sort(getStringComparer(!
|
|
20832
|
+
includeBasePaths.sort(getStringComparer(!useCaseSensitiveFileNames2));
|
|
20836
20833
|
for (const includeBasePath of includeBasePaths) {
|
|
20837
|
-
if (every(basePaths, (basePath) => !containsPath(basePath, includeBasePath, path, !
|
|
20834
|
+
if (every(basePaths, (basePath) => !containsPath(basePath, includeBasePath, path, !useCaseSensitiveFileNames2))) {
|
|
20838
20835
|
basePaths.push(includeBasePath);
|
|
20839
20836
|
}
|
|
20840
20837
|
}
|
|
@@ -40951,19 +40948,19 @@ function getFileNamesFromConfigSpecs(configFileSpecs, basePath, options, host, e
|
|
|
40951
40948
|
const wildcardFiles = arrayFrom(wildcardFileMap.values());
|
|
40952
40949
|
return literalFiles.concat(wildcardFiles, arrayFrom(wildCardJsonFileMap.values()));
|
|
40953
40950
|
}
|
|
40954
|
-
function isExcludedFile(pathToCheck, spec, basePath,
|
|
40951
|
+
function isExcludedFile(pathToCheck, spec, basePath, useCaseSensitiveFileNames2, currentDirectory) {
|
|
40955
40952
|
const { validatedFilesSpec, validatedIncludeSpecs, validatedExcludeSpecs } = spec;
|
|
40956
40953
|
if (!length(validatedIncludeSpecs) || !length(validatedExcludeSpecs))
|
|
40957
40954
|
return false;
|
|
40958
40955
|
basePath = normalizePath(basePath);
|
|
40959
|
-
const keyMapper = createGetCanonicalFileName(
|
|
40956
|
+
const keyMapper = createGetCanonicalFileName(useCaseSensitiveFileNames2);
|
|
40960
40957
|
if (validatedFilesSpec) {
|
|
40961
40958
|
for (const fileName of validatedFilesSpec) {
|
|
40962
40959
|
if (keyMapper(getNormalizedAbsolutePath(fileName, basePath)) === pathToCheck)
|
|
40963
40960
|
return false;
|
|
40964
40961
|
}
|
|
40965
40962
|
}
|
|
40966
|
-
return matchesExcludeWorker(pathToCheck, validatedExcludeSpecs,
|
|
40963
|
+
return matchesExcludeWorker(pathToCheck, validatedExcludeSpecs, useCaseSensitiveFileNames2, currentDirectory, basePath);
|
|
40967
40964
|
}
|
|
40968
40965
|
function invalidDotDotAfterRecursiveWildcard(s) {
|
|
40969
40966
|
const wildcardIndex = startsWith(s, "**/") ? 0 : s.indexOf("/**/");
|
|
@@ -40973,17 +40970,17 @@ function invalidDotDotAfterRecursiveWildcard(s) {
|
|
|
40973
40970
|
const lastDotIndex = endsWith(s, "/..") ? s.length : s.lastIndexOf("/../");
|
|
40974
40971
|
return lastDotIndex > wildcardIndex;
|
|
40975
40972
|
}
|
|
40976
|
-
function matchesExclude(pathToCheck, excludeSpecs,
|
|
40973
|
+
function matchesExclude(pathToCheck, excludeSpecs, useCaseSensitiveFileNames2, currentDirectory) {
|
|
40977
40974
|
return matchesExcludeWorker(
|
|
40978
40975
|
pathToCheck,
|
|
40979
40976
|
filter(excludeSpecs, (spec) => !invalidDotDotAfterRecursiveWildcard(spec)),
|
|
40980
|
-
|
|
40977
|
+
useCaseSensitiveFileNames2,
|
|
40981
40978
|
currentDirectory
|
|
40982
40979
|
);
|
|
40983
40980
|
}
|
|
40984
|
-
function matchesExcludeWorker(pathToCheck, excludeSpecs,
|
|
40981
|
+
function matchesExcludeWorker(pathToCheck, excludeSpecs, useCaseSensitiveFileNames2, currentDirectory, basePath) {
|
|
40985
40982
|
const excludePattern = getRegularExpressionForWildcard(excludeSpecs, combinePaths(normalizePath(currentDirectory), basePath), "exclude");
|
|
40986
|
-
const excludeRegex = excludePattern && getRegexFromPattern(excludePattern,
|
|
40983
|
+
const excludeRegex = excludePattern && getRegexFromPattern(excludePattern, useCaseSensitiveFileNames2);
|
|
40987
40984
|
if (!excludeRegex)
|
|
40988
40985
|
return false;
|
|
40989
40986
|
if (excludeRegex.test(pathToCheck))
|
|
@@ -41013,9 +41010,9 @@ function specToDiagnostic(spec, disallowTrailingRecursion) {
|
|
|
41013
41010
|
return [Diagnostics.File_specification_cannot_contain_a_parent_directory_that_appears_after_a_recursive_directory_wildcard_Asterisk_Asterisk_Colon_0, spec];
|
|
41014
41011
|
}
|
|
41015
41012
|
}
|
|
41016
|
-
function getWildcardDirectories({ validatedIncludeSpecs: include, validatedExcludeSpecs: exclude }, path,
|
|
41013
|
+
function getWildcardDirectories({ validatedIncludeSpecs: include, validatedExcludeSpecs: exclude }, path, useCaseSensitiveFileNames2) {
|
|
41017
41014
|
const rawExcludeRegex = getRegularExpressionForWildcard(exclude, path, "exclude");
|
|
41018
|
-
const excludeRegex = rawExcludeRegex && new RegExp(rawExcludeRegex,
|
|
41015
|
+
const excludeRegex = rawExcludeRegex && new RegExp(rawExcludeRegex, useCaseSensitiveFileNames2 ? "" : "i");
|
|
41019
41016
|
const wildcardDirectories = {};
|
|
41020
41017
|
if (include !== void 0) {
|
|
41021
41018
|
const recursiveKeys = [];
|
|
@@ -41024,7 +41021,7 @@ function getWildcardDirectories({ validatedIncludeSpecs: include, validatedExclu
|
|
|
41024
41021
|
if (excludeRegex && excludeRegex.test(spec)) {
|
|
41025
41022
|
continue;
|
|
41026
41023
|
}
|
|
41027
|
-
const match = getWildcardDirectoryFromSpec(spec,
|
|
41024
|
+
const match = getWildcardDirectoryFromSpec(spec, useCaseSensitiveFileNames2);
|
|
41028
41025
|
if (match) {
|
|
41029
41026
|
const { key, flags } = match;
|
|
41030
41027
|
const existingFlags = wildcardDirectories[key];
|
|
@@ -41039,7 +41036,7 @@ function getWildcardDirectories({ validatedIncludeSpecs: include, validatedExclu
|
|
|
41039
41036
|
for (const key in wildcardDirectories) {
|
|
41040
41037
|
if (hasProperty(wildcardDirectories, key)) {
|
|
41041
41038
|
for (const recursiveKey of recursiveKeys) {
|
|
41042
|
-
if (key !== recursiveKey && containsPath(recursiveKey, key, path, !
|
|
41039
|
+
if (key !== recursiveKey && containsPath(recursiveKey, key, path, !useCaseSensitiveFileNames2)) {
|
|
41043
41040
|
delete wildcardDirectories[key];
|
|
41044
41041
|
}
|
|
41045
41042
|
}
|
|
@@ -41048,20 +41045,20 @@ function getWildcardDirectories({ validatedIncludeSpecs: include, validatedExclu
|
|
|
41048
41045
|
}
|
|
41049
41046
|
return wildcardDirectories;
|
|
41050
41047
|
}
|
|
41051
|
-
function getWildcardDirectoryFromSpec(spec,
|
|
41048
|
+
function getWildcardDirectoryFromSpec(spec, useCaseSensitiveFileNames2) {
|
|
41052
41049
|
const match = wildcardDirectoryPattern.exec(spec);
|
|
41053
41050
|
if (match) {
|
|
41054
41051
|
const questionWildcardIndex = spec.indexOf("?");
|
|
41055
41052
|
const starWildcardIndex = spec.indexOf("*");
|
|
41056
41053
|
const lastDirectorySeperatorIndex = spec.lastIndexOf(directorySeparator);
|
|
41057
41054
|
return {
|
|
41058
|
-
key:
|
|
41055
|
+
key: useCaseSensitiveFileNames2 ? match[0] : toFileNameLowerCase(match[0]),
|
|
41059
41056
|
flags: questionWildcardIndex !== -1 && questionWildcardIndex < lastDirectorySeperatorIndex || starWildcardIndex !== -1 && starWildcardIndex < lastDirectorySeperatorIndex ? 1 /* Recursive */ : 0 /* None */
|
|
41060
41057
|
};
|
|
41061
41058
|
}
|
|
41062
41059
|
if (isImplicitGlob(spec.substring(spec.lastIndexOf(directorySeparator) + 1))) {
|
|
41063
41060
|
return {
|
|
41064
|
-
key: removeTrailingDirectorySeparator(
|
|
41061
|
+
key: removeTrailingDirectorySeparator(useCaseSensitiveFileNames2 ? spec : toFileNameLowerCase(spec)),
|
|
41065
41062
|
flags: 1 /* Recursive */
|
|
41066
41063
|
};
|
|
41067
41064
|
}
|
|
@@ -41207,6 +41204,18 @@ function formatExtensions(extensions) {
|
|
|
41207
41204
|
result.push("JSON");
|
|
41208
41205
|
return result.join(", ");
|
|
41209
41206
|
}
|
|
41207
|
+
function extensionsToExtensionsArray(extensions) {
|
|
41208
|
+
const result = [];
|
|
41209
|
+
if (extensions & 1 /* TypeScript */)
|
|
41210
|
+
result.push(...supportedTSImplementationExtensions);
|
|
41211
|
+
if (extensions & 2 /* JavaScript */)
|
|
41212
|
+
result.push(...supportedJSExtensionsFlat);
|
|
41213
|
+
if (extensions & 4 /* Declaration */)
|
|
41214
|
+
result.push(...supportedDeclarationExtensions);
|
|
41215
|
+
if (extensions & 8 /* Json */)
|
|
41216
|
+
result.push(".json" /* Json */);
|
|
41217
|
+
return result;
|
|
41218
|
+
}
|
|
41210
41219
|
function resolvedTypeScriptOnly(resolved) {
|
|
41211
41220
|
if (!resolved) {
|
|
41212
41221
|
return void 0;
|
|
@@ -41381,8 +41390,8 @@ function getDefaultTypeRoots(currentDirectory) {
|
|
|
41381
41390
|
}
|
|
41382
41391
|
var nodeModulesAtTypes = combinePaths("node_modules", "@types");
|
|
41383
41392
|
function arePathsEqual(path1, path2, host) {
|
|
41384
|
-
const
|
|
41385
|
-
return comparePaths(path1, path2, !
|
|
41393
|
+
const useCaseSensitiveFileNames2 = typeof host.useCaseSensitiveFileNames === "function" ? host.useCaseSensitiveFileNames() : host.useCaseSensitiveFileNames;
|
|
41394
|
+
return comparePaths(path1, path2, !useCaseSensitiveFileNames2) === 0 /* EqualTo */;
|
|
41386
41395
|
}
|
|
41387
41396
|
function getOriginalAndResolvedFileName(fileName, host, traceEnabled) {
|
|
41388
41397
|
const resolvedFileName = realPath(fileName, host, traceEnabled);
|
|
@@ -42659,7 +42668,7 @@ function getEntrypointsFromPackageJsonInfo(packageJsonInfo, options, host, cache
|
|
|
42659
42668
|
arrayIsEqualTo
|
|
42660
42669
|
);
|
|
42661
42670
|
for (const conditions of conditionSets) {
|
|
42662
|
-
const loadPackageJsonExportsState = { ...loadPackageJsonMainState, failedLookupLocations: [], conditions };
|
|
42671
|
+
const loadPackageJsonExportsState = { ...loadPackageJsonMainState, failedLookupLocations: [], conditions, host };
|
|
42663
42672
|
const exportResolutions = loadEntrypointsFromExportMap(
|
|
42664
42673
|
packageJsonInfo,
|
|
42665
42674
|
packageJsonInfo.contents.packageJsonContent.exports,
|
|
@@ -42691,23 +42700,42 @@ function loadEntrypointsFromExportMap(scope, exports, state, extensions) {
|
|
|
42691
42700
|
return entrypoints;
|
|
42692
42701
|
function loadEntrypointsFromTargetExports(target) {
|
|
42693
42702
|
var _a, _b;
|
|
42694
|
-
if (typeof target === "string" && startsWith(target, "./")
|
|
42695
|
-
|
|
42696
|
-
|
|
42697
|
-
|
|
42698
|
-
|
|
42699
|
-
|
|
42700
|
-
|
|
42701
|
-
|
|
42702
|
-
|
|
42703
|
-
|
|
42704
|
-
|
|
42705
|
-
|
|
42706
|
-
|
|
42707
|
-
|
|
42708
|
-
|
|
42709
|
-
|
|
42710
|
-
|
|
42703
|
+
if (typeof target === "string" && startsWith(target, "./")) {
|
|
42704
|
+
if (target.indexOf("*") >= 0 && state.host.readDirectory) {
|
|
42705
|
+
if (target.indexOf("*") !== target.lastIndexOf("*")) {
|
|
42706
|
+
return false;
|
|
42707
|
+
}
|
|
42708
|
+
state.host.readDirectory(
|
|
42709
|
+
scope.packageDirectory,
|
|
42710
|
+
extensionsToExtensionsArray(extensions),
|
|
42711
|
+
/*excludes*/
|
|
42712
|
+
void 0,
|
|
42713
|
+
[changeAnyExtension(target.replace("*", "**/*"), getDeclarationEmitExtensionForPath(target))]
|
|
42714
|
+
).forEach((entry) => {
|
|
42715
|
+
entrypoints = appendIfUnique(entrypoints, {
|
|
42716
|
+
path: entry,
|
|
42717
|
+
ext: getAnyExtensionFromPath(entry),
|
|
42718
|
+
resolvedUsingTsExtension: void 0
|
|
42719
|
+
});
|
|
42720
|
+
});
|
|
42721
|
+
} else {
|
|
42722
|
+
const partsAfterFirst = getPathComponents(target).slice(2);
|
|
42723
|
+
if (partsAfterFirst.indexOf("..") >= 0 || partsAfterFirst.indexOf(".") >= 0 || partsAfterFirst.indexOf("node_modules") >= 0) {
|
|
42724
|
+
return false;
|
|
42725
|
+
}
|
|
42726
|
+
const resolvedTarget = combinePaths(scope.packageDirectory, target);
|
|
42727
|
+
const finalPath = getNormalizedAbsolutePath(resolvedTarget, (_b = (_a = state.host).getCurrentDirectory) == null ? void 0 : _b.call(_a));
|
|
42728
|
+
const result = loadFileNameFromPackageJsonField(
|
|
42729
|
+
extensions,
|
|
42730
|
+
finalPath,
|
|
42731
|
+
/*onlyRecordFailures*/
|
|
42732
|
+
false,
|
|
42733
|
+
state
|
|
42734
|
+
);
|
|
42735
|
+
if (result) {
|
|
42736
|
+
entrypoints = appendIfUnique(entrypoints, result, (a, b) => a.path === b.path);
|
|
42737
|
+
return true;
|
|
42738
|
+
}
|
|
42711
42739
|
}
|
|
42712
42740
|
} else if (Array.isArray(target)) {
|
|
42713
42741
|
for (const t of target) {
|
|
@@ -43266,13 +43294,10 @@ function getLoadModuleFromTargetImportOrExport(extensions, state, cache, redirec
|
|
|
43266
43294
|
function combineDirectoryPath(root, dir) {
|
|
43267
43295
|
return ensureTrailingDirectorySeparator(combinePaths(root, dir));
|
|
43268
43296
|
}
|
|
43269
|
-
function useCaseSensitiveFileNames() {
|
|
43270
|
-
return !state.host.useCaseSensitiveFileNames ? true : typeof state.host.useCaseSensitiveFileNames === "boolean" ? state.host.useCaseSensitiveFileNames : state.host.useCaseSensitiveFileNames();
|
|
43271
|
-
}
|
|
43272
43297
|
function tryLoadInputFileForPath(finalPath, entry, packagePath, isImports2) {
|
|
43273
43298
|
var _a, _b, _c, _d;
|
|
43274
|
-
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)) {
|
|
43275
|
-
const getCanonicalFileName = hostGetCanonicalFileName({ useCaseSensitiveFileNames });
|
|
43299
|
+
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)) {
|
|
43300
|
+
const getCanonicalFileName = hostGetCanonicalFileName({ useCaseSensitiveFileNames: () => useCaseSensitiveFileNames(state) });
|
|
43276
43301
|
const commonSourceDirGuesses = [];
|
|
43277
43302
|
if (state.compilerOptions.rootDir || state.compilerOptions.composite && state.compilerOptions.configFilePath) {
|
|
43278
43303
|
const commonDir = toAbsolutePath(getCommonSourceDirectory(state.compilerOptions, () => [], ((_b = (_a = state.host).getCurrentDirectory) == null ? void 0 : _b.call(_a)) || "", getCanonicalFileName));
|
|
@@ -43301,7 +43326,7 @@ function getLoadModuleFromTargetImportOrExport(extensions, state, cache, redirec
|
|
|
43301
43326
|
for (const commonSourceDirGuess of commonSourceDirGuesses) {
|
|
43302
43327
|
const candidateDirectories = getOutputDirectoriesForBaseDirectory(commonSourceDirGuess);
|
|
43303
43328
|
for (const candidateDir of candidateDirectories) {
|
|
43304
|
-
if (containsPath(candidateDir, finalPath, !useCaseSensitiveFileNames())) {
|
|
43329
|
+
if (containsPath(candidateDir, finalPath, !useCaseSensitiveFileNames(state))) {
|
|
43305
43330
|
const pathFragment = finalPath.slice(candidateDir.length + 1);
|
|
43306
43331
|
const possibleInputBase = combinePaths(commonSourceDirGuess, pathFragment);
|
|
43307
43332
|
const jsAndDtsExtensions = [".mjs" /* Mjs */, ".cjs" /* Cjs */, ".js" /* Js */, ".json" /* Json */, ".d.mts" /* Dmts */, ".d.cts" /* Dcts */, ".d.ts" /* Dts */];
|
|
@@ -43311,7 +43336,7 @@ function getLoadModuleFromTargetImportOrExport(extensions, state, cache, redirec
|
|
|
43311
43336
|
for (const possibleExt of inputExts) {
|
|
43312
43337
|
if (!extensionIsOk(extensions, possibleExt))
|
|
43313
43338
|
continue;
|
|
43314
|
-
const possibleInputWithInputExtension = changeAnyExtension(possibleInputBase, possibleExt, ext, !useCaseSensitiveFileNames());
|
|
43339
|
+
const possibleInputWithInputExtension = changeAnyExtension(possibleInputBase, possibleExt, ext, !useCaseSensitiveFileNames(state));
|
|
43315
43340
|
if (state.host.fileExists(possibleInputWithInputExtension)) {
|
|
43316
43341
|
return toSearchResult(withPackageId(scope, loadFileNameFromPackageJsonField(
|
|
43317
43342
|
extensions,
|
|
@@ -43728,6 +43753,9 @@ function traceIfEnabled(state, diagnostic, ...args) {
|
|
|
43728
43753
|
trace(state.host, diagnostic, ...args);
|
|
43729
43754
|
}
|
|
43730
43755
|
}
|
|
43756
|
+
function useCaseSensitiveFileNames(state) {
|
|
43757
|
+
return !state.host.useCaseSensitiveFileNames ? true : typeof state.host.useCaseSensitiveFileNames === "boolean" ? state.host.useCaseSensitiveFileNames : state.host.useCaseSensitiveFileNames();
|
|
43758
|
+
}
|
|
43731
43759
|
|
|
43732
43760
|
// src/compiler/binder.ts
|
|
43733
43761
|
var ModuleInstanceState = /* @__PURE__ */ ((ModuleInstanceState2) => {
|
|
@@ -47285,7 +47313,7 @@ function tryGetModuleNameFromExports(options, targetFilePath, packageDirectory,
|
|
|
47285
47313
|
for (const key of getOwnKeys(exports)) {
|
|
47286
47314
|
if (key === "default" || conditions.indexOf(key) >= 0 || isApplicableVersionedTypesKey(conditions, key)) {
|
|
47287
47315
|
const subTarget = exports[key];
|
|
47288
|
-
const result = tryGetModuleNameFromExports(options, targetFilePath, packageDirectory, packageName, subTarget, conditions);
|
|
47316
|
+
const result = tryGetModuleNameFromExports(options, targetFilePath, packageDirectory, packageName, subTarget, conditions, mode);
|
|
47289
47317
|
if (result) {
|
|
47290
47318
|
return result;
|
|
47291
47319
|
}
|
|
@@ -48442,7 +48470,7 @@ function createTypeChecker(host) {
|
|
|
48442
48470
|
};
|
|
48443
48471
|
var amalgamatedDuplicates;
|
|
48444
48472
|
var reverseMappedCache = /* @__PURE__ */ new Map();
|
|
48445
|
-
var
|
|
48473
|
+
var homomorphicMappedTypeInferenceStack = [];
|
|
48446
48474
|
var ambientModulesCache;
|
|
48447
48475
|
var patternAmbientModules;
|
|
48448
48476
|
var patternAmbientModuleAugmentations;
|
|
@@ -53033,6 +53061,7 @@ function createTypeChecker(host) {
|
|
|
53033
53061
|
);
|
|
53034
53062
|
}
|
|
53035
53063
|
function signatureToSignatureDeclarationHelper(signature, kind, context, options) {
|
|
53064
|
+
var _a;
|
|
53036
53065
|
const suppressAny = context.flags & 256 /* SuppressAnyReturnType */;
|
|
53037
53066
|
if (suppressAny)
|
|
53038
53067
|
context.flags &= ~256 /* SuppressAnyReturnType */;
|
|
@@ -53168,6 +53197,20 @@ function createTypeChecker(host) {
|
|
|
53168
53197
|
if (typeArguments) {
|
|
53169
53198
|
node.typeArguments = factory.createNodeArray(typeArguments);
|
|
53170
53199
|
}
|
|
53200
|
+
if (((_a = signature.declaration) == null ? void 0 : _a.kind) === 330 /* JSDocSignature */ && signature.declaration.parent.kind === 346 /* JSDocOverloadTag */) {
|
|
53201
|
+
const comment = getTextOfNode(
|
|
53202
|
+
signature.declaration.parent.parent,
|
|
53203
|
+
/*includeTrivia*/
|
|
53204
|
+
true
|
|
53205
|
+
).slice(2, -2).split(/\r\n|\n|\r/).map((line) => line.replace(/^\s+/, " ")).join("\n");
|
|
53206
|
+
addSyntheticLeadingComment(
|
|
53207
|
+
node,
|
|
53208
|
+
3 /* MultiLineCommentTrivia */,
|
|
53209
|
+
comment,
|
|
53210
|
+
/*hasTrailingNewLine*/
|
|
53211
|
+
true
|
|
53212
|
+
);
|
|
53213
|
+
}
|
|
53171
53214
|
cleanup == null ? void 0 : cleanup();
|
|
53172
53215
|
return node;
|
|
53173
53216
|
}
|
|
@@ -67831,17 +67874,18 @@ function createTypeChecker(host) {
|
|
|
67831
67874
|
);
|
|
67832
67875
|
}
|
|
67833
67876
|
function inferTypeForHomomorphicMappedType(source, target, constraint) {
|
|
67834
|
-
|
|
67835
|
-
|
|
67877
|
+
const cacheKey = source.id + "," + target.id + "," + constraint.id;
|
|
67878
|
+
if (reverseMappedCache.has(cacheKey)) {
|
|
67879
|
+
return reverseMappedCache.get(cacheKey);
|
|
67836
67880
|
}
|
|
67837
|
-
const
|
|
67838
|
-
if (
|
|
67839
|
-
return
|
|
67881
|
+
const recursionKey = source.id + "," + (target.target || target).id;
|
|
67882
|
+
if (contains(homomorphicMappedTypeInferenceStack, recursionKey)) {
|
|
67883
|
+
return void 0;
|
|
67840
67884
|
}
|
|
67841
|
-
|
|
67885
|
+
homomorphicMappedTypeInferenceStack.push(recursionKey);
|
|
67842
67886
|
const type = createReverseMappedType(source, target, constraint);
|
|
67843
|
-
|
|
67844
|
-
reverseMappedCache.set(
|
|
67887
|
+
homomorphicMappedTypeInferenceStack.pop();
|
|
67888
|
+
reverseMappedCache.set(cacheKey, type);
|
|
67845
67889
|
return type;
|
|
67846
67890
|
}
|
|
67847
67891
|
function isPartiallyInferableType(type) {
|
|
@@ -118852,14 +118896,14 @@ function getEmitListItem(emit, parenthesizerRule) {
|
|
|
118852
118896
|
}
|
|
118853
118897
|
|
|
118854
118898
|
// src/compiler/watchUtilities.ts
|
|
118855
|
-
function createCachedDirectoryStructureHost(host, currentDirectory,
|
|
118899
|
+
function createCachedDirectoryStructureHost(host, currentDirectory, useCaseSensitiveFileNames2) {
|
|
118856
118900
|
if (!host.getDirectories || !host.readDirectory) {
|
|
118857
118901
|
return void 0;
|
|
118858
118902
|
}
|
|
118859
118903
|
const cachedReadDirectoryResult = /* @__PURE__ */ new Map();
|
|
118860
|
-
const getCanonicalFileName = createGetCanonicalFileName(
|
|
118904
|
+
const getCanonicalFileName = createGetCanonicalFileName(useCaseSensitiveFileNames2);
|
|
118861
118905
|
return {
|
|
118862
|
-
useCaseSensitiveFileNames,
|
|
118906
|
+
useCaseSensitiveFileNames: useCaseSensitiveFileNames2,
|
|
118863
118907
|
fileExists,
|
|
118864
118908
|
readFile: (path, encoding) => host.readFile(path, encoding),
|
|
118865
118909
|
directoryExists: host.directoryExists && directoryExists,
|
|
@@ -118981,7 +119025,7 @@ function createCachedDirectoryStructureHost(host, currentDirectory, useCaseSensi
|
|
|
118981
119025
|
const rootResult = tryReadDirectory2(rootDir, rootDirPath);
|
|
118982
119026
|
let rootSymLinkResult;
|
|
118983
119027
|
if (rootResult !== void 0) {
|
|
118984
|
-
return matchFiles(rootDir, extensions, excludes, includes,
|
|
119028
|
+
return matchFiles(rootDir, extensions, excludes, includes, useCaseSensitiveFileNames2, currentDirectory, depth, getFileSystemEntries, realpath);
|
|
118985
119029
|
}
|
|
118986
119030
|
return host.readDirectory(rootDir, extensions, excludes, includes, depth);
|
|
118987
119031
|
function getFileSystemEntries(dir) {
|
|
@@ -119182,7 +119226,7 @@ function isIgnoredFileFromWildCardWatching({
|
|
|
119182
119226
|
program,
|
|
119183
119227
|
extraFileExtensions,
|
|
119184
119228
|
currentDirectory,
|
|
119185
|
-
useCaseSensitiveFileNames,
|
|
119229
|
+
useCaseSensitiveFileNames: useCaseSensitiveFileNames2,
|
|
119186
119230
|
writeLog,
|
|
119187
119231
|
toPath: toPath3
|
|
119188
119232
|
}) {
|
|
@@ -119198,7 +119242,7 @@ function isIgnoredFileFromWildCardWatching({
|
|
|
119198
119242
|
writeLog(`Project: ${configFileName} Detected file add/remove of non supported extension: ${fileOrDirectory}`);
|
|
119199
119243
|
return true;
|
|
119200
119244
|
}
|
|
119201
|
-
if (isExcludedFile(fileOrDirectory, options.configFile.configFileSpecs, getNormalizedAbsolutePath(getDirectoryPath(configFileName), currentDirectory),
|
|
119245
|
+
if (isExcludedFile(fileOrDirectory, options.configFile.configFileSpecs, getNormalizedAbsolutePath(getDirectoryPath(configFileName), currentDirectory), useCaseSensitiveFileNames2, currentDirectory)) {
|
|
119202
119246
|
writeLog(`Project: ${configFileName} Detected excluded file: ${fileOrDirectory}`);
|
|
119203
119247
|
return true;
|
|
119204
119248
|
}
|
|
@@ -119261,7 +119305,7 @@ function getWatchFactory(host, watchLogLevel, log, getDetailWatchInfo2) {
|
|
|
119261
119305
|
function createExcludeHandlingAddWatch(key) {
|
|
119262
119306
|
return (file, cb, flags, options, detailInfo1, detailInfo2) => {
|
|
119263
119307
|
var _a;
|
|
119264
|
-
return !matchesExclude(file, key === "watchFile" ? options == null ? void 0 : options.excludeFiles : options == null ? void 0 : options.excludeDirectories,
|
|
119308
|
+
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(
|
|
119265
119309
|
/*thisArgs*/
|
|
119266
119310
|
void 0,
|
|
119267
119311
|
file,
|
|
@@ -119273,7 +119317,7 @@ function getWatchFactory(host, watchLogLevel, log, getDetailWatchInfo2) {
|
|
|
119273
119317
|
) : excludeWatcherFactory(file, flags, options, detailInfo1, detailInfo2);
|
|
119274
119318
|
};
|
|
119275
119319
|
}
|
|
119276
|
-
function
|
|
119320
|
+
function useCaseSensitiveFileNames2() {
|
|
119277
119321
|
return typeof host.useCaseSensitiveFileNames === "boolean" ? host.useCaseSensitiveFileNames : host.useCaseSensitiveFileNames();
|
|
119278
119322
|
}
|
|
119279
119323
|
function createExcludeWatcherWithLogging(file, flags, options, detailInfo1, detailInfo2) {
|
|
@@ -126358,12 +126402,12 @@ function getMatchedIncludeSpec(program, fileName) {
|
|
|
126358
126402
|
return true;
|
|
126359
126403
|
const isJsonFile = fileExtensionIs(fileName, ".json" /* Json */);
|
|
126360
126404
|
const basePath = getDirectoryPath(getNormalizedAbsolutePath(configFile.fileName, program.getCurrentDirectory()));
|
|
126361
|
-
const
|
|
126405
|
+
const useCaseSensitiveFileNames2 = program.useCaseSensitiveFileNames();
|
|
126362
126406
|
return find((_b = configFile == null ? void 0 : configFile.configFileSpecs) == null ? void 0 : _b.validatedIncludeSpecs, (includeSpec) => {
|
|
126363
126407
|
if (isJsonFile && !endsWith(includeSpec, ".json" /* Json */))
|
|
126364
126408
|
return false;
|
|
126365
126409
|
const pattern = getPatternFromSpec(includeSpec, basePath, "files");
|
|
126366
|
-
return !!pattern && getRegexFromPattern(`(${pattern})$`,
|
|
126410
|
+
return !!pattern && getRegexFromPattern(`(${pattern})$`, useCaseSensitiveFileNames2).test(fileName);
|
|
126367
126411
|
});
|
|
126368
126412
|
}
|
|
126369
126413
|
function fileIncludeReasonToDiagnostics(program, reason, fileNameConvertor) {
|
|
@@ -126592,7 +126636,7 @@ function createWatchFactory(host, options) {
|
|
|
126592
126636
|
return result;
|
|
126593
126637
|
}
|
|
126594
126638
|
function createCompilerHostFromProgramHost(host, getCompilerOptions, directoryStructureHost = host) {
|
|
126595
|
-
const
|
|
126639
|
+
const useCaseSensitiveFileNames2 = host.useCaseSensitiveFileNames();
|
|
126596
126640
|
const compilerHost = {
|
|
126597
126641
|
getSourceFile: createGetSourceFile(
|
|
126598
126642
|
(fileName, encoding) => !encoding ? compilerHost.readFile(fileName) : host.readFile(fileName, encoding),
|
|
@@ -126608,8 +126652,8 @@ function createCompilerHostFromProgramHost(host, getCompilerOptions, directorySt
|
|
|
126608
126652
|
(path) => host.directoryExists(path)
|
|
126609
126653
|
),
|
|
126610
126654
|
getCurrentDirectory: memoize(() => host.getCurrentDirectory()),
|
|
126611
|
-
useCaseSensitiveFileNames: () =>
|
|
126612
|
-
getCanonicalFileName: createGetCanonicalFileName(
|
|
126655
|
+
useCaseSensitiveFileNames: () => useCaseSensitiveFileNames2,
|
|
126656
|
+
getCanonicalFileName: createGetCanonicalFileName(useCaseSensitiveFileNames2),
|
|
126613
126657
|
getNewLine: () => getNewLineCharacter(getCompilerOptions()),
|
|
126614
126658
|
fileExists: (f) => host.fileExists(f),
|
|
126615
126659
|
readFile: (f) => host.readFile(f),
|
|
@@ -126849,7 +126893,7 @@ function createWatchProgram(host) {
|
|
|
126849
126893
|
const sourceFilesCache = /* @__PURE__ */ new Map();
|
|
126850
126894
|
let missingFilePathsRequestedForRelease;
|
|
126851
126895
|
let hasChangedCompilerOptions = false;
|
|
126852
|
-
const
|
|
126896
|
+
const useCaseSensitiveFileNames2 = host.useCaseSensitiveFileNames();
|
|
126853
126897
|
const currentDirectory = host.getCurrentDirectory();
|
|
126854
126898
|
const { configFileName, optionsToExtend: optionsToExtendForConfigFile = {}, watchOptionsToExtend, extraFileExtensions, createProgram: createProgram2 } = host;
|
|
126855
126899
|
let { rootFiles: rootFileNames, options: compilerOptions, watchOptions, projectReferences } = host;
|
|
@@ -126857,7 +126901,7 @@ function createWatchProgram(host) {
|
|
|
126857
126901
|
let configFileParsingDiagnostics;
|
|
126858
126902
|
let canConfigFileJsonReportNoInputFiles = false;
|
|
126859
126903
|
let hasChangedConfigFileParsingErrors = false;
|
|
126860
|
-
const cachedDirectoryStructureHost = configFileName === void 0 ? void 0 : createCachedDirectoryStructureHost(host, currentDirectory,
|
|
126904
|
+
const cachedDirectoryStructureHost = configFileName === void 0 ? void 0 : createCachedDirectoryStructureHost(host, currentDirectory, useCaseSensitiveFileNames2);
|
|
126861
126905
|
const directoryStructureHost = cachedDirectoryStructureHost || host;
|
|
126862
126906
|
const parseConfigFileHost = parseConfigHostFromCompilerHostLike(host, directoryStructureHost);
|
|
126863
126907
|
let newLine = updateNewLine();
|
|
@@ -126875,8 +126919,8 @@ function createWatchProgram(host) {
|
|
|
126875
126919
|
Debug.assert(compilerOptions);
|
|
126876
126920
|
Debug.assert(rootFileNames);
|
|
126877
126921
|
const { watchFile: watchFile2, watchDirectory, writeLog } = createWatchFactory(host, compilerOptions);
|
|
126878
|
-
const getCanonicalFileName = createGetCanonicalFileName(
|
|
126879
|
-
writeLog(`Current directory: ${currentDirectory} CaseSensitiveFileNames: ${
|
|
126922
|
+
const getCanonicalFileName = createGetCanonicalFileName(useCaseSensitiveFileNames2);
|
|
126923
|
+
writeLog(`Current directory: ${currentDirectory} CaseSensitiveFileNames: ${useCaseSensitiveFileNames2}`);
|
|
126880
126924
|
let configFileWatcher;
|
|
126881
126925
|
if (configFileName) {
|
|
126882
126926
|
configFileWatcher = watchFile2(configFileName, scheduleProgramReload, 2e3 /* High */, watchOptions, WatchType.ConfigFile);
|
|
@@ -127382,7 +127426,7 @@ function createWatchProgram(host) {
|
|
|
127382
127426
|
options: compilerOptions,
|
|
127383
127427
|
program: getCurrentBuilderProgram() || rootFileNames,
|
|
127384
127428
|
currentDirectory,
|
|
127385
|
-
useCaseSensitiveFileNames,
|
|
127429
|
+
useCaseSensitiveFileNames: useCaseSensitiveFileNames2,
|
|
127386
127430
|
writeLog,
|
|
127387
127431
|
toPath: toPath3
|
|
127388
127432
|
}))
|
|
@@ -127472,7 +127516,7 @@ function createWatchProgram(host) {
|
|
|
127472
127516
|
options: config.parsedCommandLine.options,
|
|
127473
127517
|
program: config.parsedCommandLine.fileNames,
|
|
127474
127518
|
currentDirectory,
|
|
127475
|
-
useCaseSensitiveFileNames,
|
|
127519
|
+
useCaseSensitiveFileNames: useCaseSensitiveFileNames2,
|
|
127476
127520
|
writeLog,
|
|
127477
127521
|
toPath: toPath3
|
|
127478
127522
|
}))
|
|
@@ -130086,6 +130130,8 @@ var ScriptElementKind = /* @__PURE__ */ ((ScriptElementKind2) => {
|
|
|
130086
130130
|
ScriptElementKind2["enumMemberElement"] = "enum member";
|
|
130087
130131
|
ScriptElementKind2["variableElement"] = "var";
|
|
130088
130132
|
ScriptElementKind2["localVariableElement"] = "local var";
|
|
130133
|
+
ScriptElementKind2["variableUsingElement"] = "using";
|
|
130134
|
+
ScriptElementKind2["variableAwaitUsingElement"] = "await using";
|
|
130089
130135
|
ScriptElementKind2["functionElement"] = "function";
|
|
130090
130136
|
ScriptElementKind2["localFunctionElement"] = "local function";
|
|
130091
130137
|
ScriptElementKind2["memberFunctionElement"] = "method";
|
|
@@ -133224,10 +133270,10 @@ function isImportablePath(fromPath, toPath3, getCanonicalFileName, globalCachePa
|
|
|
133224
133270
|
}
|
|
133225
133271
|
function forEachExternalModuleToImportFrom(program, host, preferences, useAutoImportProvider, cb) {
|
|
133226
133272
|
var _a, _b;
|
|
133227
|
-
const
|
|
133273
|
+
const useCaseSensitiveFileNames2 = hostUsesCaseSensitiveFileNames(host);
|
|
133228
133274
|
const excludePatterns = preferences.autoImportFileExcludePatterns && mapDefined(preferences.autoImportFileExcludePatterns, (spec) => {
|
|
133229
133275
|
const pattern = getPatternFromSpec(spec, "", "exclude");
|
|
133230
|
-
return pattern ? getRegexFromPattern(pattern,
|
|
133276
|
+
return pattern ? getRegexFromPattern(pattern, useCaseSensitiveFileNames2) : void 0;
|
|
133231
133277
|
});
|
|
133232
133278
|
forEachExternalModule(program.getTypeChecker(), program.getSourceFiles(), excludePatterns, (module2, file) => cb(
|
|
133233
133279
|
module2,
|
|
@@ -134689,12 +134735,12 @@ var DocumentHighlights;
|
|
|
134689
134735
|
function isDocumentRegistryEntry(entry) {
|
|
134690
134736
|
return !!entry.sourceFile;
|
|
134691
134737
|
}
|
|
134692
|
-
function createDocumentRegistry(
|
|
134693
|
-
return createDocumentRegistryInternal(
|
|
134738
|
+
function createDocumentRegistry(useCaseSensitiveFileNames2, currentDirectory) {
|
|
134739
|
+
return createDocumentRegistryInternal(useCaseSensitiveFileNames2, currentDirectory);
|
|
134694
134740
|
}
|
|
134695
|
-
function createDocumentRegistryInternal(
|
|
134741
|
+
function createDocumentRegistryInternal(useCaseSensitiveFileNames2, currentDirectory = "", externalCache) {
|
|
134696
134742
|
const buckets = /* @__PURE__ */ new Map();
|
|
134697
|
-
const getCanonicalFileName = createGetCanonicalFileName(!!
|
|
134743
|
+
const getCanonicalFileName = createGetCanonicalFileName(!!useCaseSensitiveFileNames2);
|
|
134698
134744
|
function reportStats() {
|
|
134699
134745
|
const bucketInfoArray = arrayFrom(buckets.keys()).filter((name) => name && name.charAt(0) === "_").map((name) => {
|
|
134700
134746
|
const entries = buckets.get(name);
|
|
@@ -134897,12 +134943,12 @@ function getDocumentRegistryBucketKeyWithMode(key, mode) {
|
|
|
134897
134943
|
|
|
134898
134944
|
// src/services/getEditsForFileRename.ts
|
|
134899
134945
|
function getEditsForFileRename(program, oldFileOrDirPath, newFileOrDirPath, host, formatContext, preferences, sourceMapper) {
|
|
134900
|
-
const
|
|
134901
|
-
const getCanonicalFileName = createGetCanonicalFileName(
|
|
134946
|
+
const useCaseSensitiveFileNames2 = hostUsesCaseSensitiveFileNames(host);
|
|
134947
|
+
const getCanonicalFileName = createGetCanonicalFileName(useCaseSensitiveFileNames2);
|
|
134902
134948
|
const oldToNew = getPathUpdater(oldFileOrDirPath, newFileOrDirPath, getCanonicalFileName, sourceMapper);
|
|
134903
134949
|
const newToOld = getPathUpdater(newFileOrDirPath, oldFileOrDirPath, getCanonicalFileName, sourceMapper);
|
|
134904
134950
|
return ts_textChanges_exports.ChangeTracker.with({ host, formatContext, preferences }, (changeTracker) => {
|
|
134905
|
-
updateTsconfigFiles(program, changeTracker, oldToNew, oldFileOrDirPath, newFileOrDirPath, host.getCurrentDirectory(),
|
|
134951
|
+
updateTsconfigFiles(program, changeTracker, oldToNew, oldFileOrDirPath, newFileOrDirPath, host.getCurrentDirectory(), useCaseSensitiveFileNames2);
|
|
134906
134952
|
updateImports(program, changeTracker, oldToNew, newToOld, host, getCanonicalFileName);
|
|
134907
134953
|
});
|
|
134908
134954
|
}
|
|
@@ -134924,7 +134970,7 @@ function makeCorrespondingRelativeChange(a0, b0, a1, getCanonicalFileName) {
|
|
|
134924
134970
|
const rel = getRelativePathFromFile(a0, b0, getCanonicalFileName);
|
|
134925
134971
|
return combinePathsSafe(getDirectoryPath(a1), rel);
|
|
134926
134972
|
}
|
|
134927
|
-
function updateTsconfigFiles(program, changeTracker, oldToNew, oldFileOrDirPath, newFileOrDirPath, currentDirectory,
|
|
134973
|
+
function updateTsconfigFiles(program, changeTracker, oldToNew, oldFileOrDirPath, newFileOrDirPath, currentDirectory, useCaseSensitiveFileNames2) {
|
|
134928
134974
|
const { configFile } = program.getCompilerOptions();
|
|
134929
134975
|
if (!configFile)
|
|
134930
134976
|
return;
|
|
@@ -134948,10 +134994,10 @@ function updateTsconfigFiles(program, changeTracker, oldToNew, oldFileOrDirPath,
|
|
|
134948
134994
|
/*excludes*/
|
|
134949
134995
|
[],
|
|
134950
134996
|
includes,
|
|
134951
|
-
|
|
134997
|
+
useCaseSensitiveFileNames2,
|
|
134952
134998
|
currentDirectory
|
|
134953
134999
|
);
|
|
134954
|
-
if (getRegexFromPattern(Debug.checkDefined(matchers.includeFilePattern),
|
|
135000
|
+
if (getRegexFromPattern(Debug.checkDefined(matchers.includeFilePattern), useCaseSensitiveFileNames2).test(oldFileOrDirPath) && !getRegexFromPattern(Debug.checkDefined(matchers.includeFilePattern), useCaseSensitiveFileNames2).test(newFileOrDirPath)) {
|
|
134955
135001
|
changeTracker.insertNodeAfter(configFile, last(property.initializer.elements), factory.createStringLiteral(relativePath(newFileOrDirPath)));
|
|
134956
135002
|
}
|
|
134957
135003
|
return;
|
|
@@ -134999,7 +135045,7 @@ function updateTsconfigFiles(program, changeTracker, oldToNew, oldFileOrDirPath,
|
|
|
134999
135045
|
configDir,
|
|
135000
135046
|
path,
|
|
135001
135047
|
/*ignoreCase*/
|
|
135002
|
-
!
|
|
135048
|
+
!useCaseSensitiveFileNames2
|
|
135003
135049
|
);
|
|
135004
135050
|
}
|
|
135005
135051
|
}
|
|
@@ -138279,7 +138325,7 @@ function getNewStatementsAndRemoveFromOldFile2(oldFile, targetFile, usage, chang
|
|
|
138279
138325
|
const body = addExports(oldFile, toMove.all, usage.oldFileImportsFromTargetFile, useEsModuleSyntax);
|
|
138280
138326
|
if (typeof targetFile !== "string") {
|
|
138281
138327
|
if (targetFile.statements.length > 0) {
|
|
138282
|
-
changes
|
|
138328
|
+
moveStatementsToTargetFile(changes, program, body, targetFile, toMove);
|
|
138283
138329
|
} else {
|
|
138284
138330
|
changes.insertNodesAtEndOfFile(
|
|
138285
138331
|
targetFile,
|
|
@@ -139072,6 +139118,67 @@ function isNonVariableTopLevelDeclaration(node) {
|
|
|
139072
139118
|
return false;
|
|
139073
139119
|
}
|
|
139074
139120
|
}
|
|
139121
|
+
function moveStatementsToTargetFile(changes, program, statements, targetFile, toMove) {
|
|
139122
|
+
var _a;
|
|
139123
|
+
const removedExports = /* @__PURE__ */ new Set();
|
|
139124
|
+
const targetExports = (_a = targetFile.symbol) == null ? void 0 : _a.exports;
|
|
139125
|
+
if (targetExports) {
|
|
139126
|
+
const checker = program.getTypeChecker();
|
|
139127
|
+
const targetToSourceExports = /* @__PURE__ */ new Map();
|
|
139128
|
+
for (const node of toMove.all) {
|
|
139129
|
+
if (isTopLevelDeclarationStatement(node) && hasSyntacticModifier(node, 1 /* Export */)) {
|
|
139130
|
+
forEachTopLevelDeclaration(node, (declaration) => {
|
|
139131
|
+
var _a2;
|
|
139132
|
+
const targetDeclarations = canHaveSymbol(declaration) ? (_a2 = targetExports.get(declaration.symbol.escapedName)) == null ? void 0 : _a2.declarations : void 0;
|
|
139133
|
+
const exportDeclaration = firstDefined(targetDeclarations, (d) => isExportDeclaration(d) ? d : isExportSpecifier(d) ? tryCast(d.parent.parent, isExportDeclaration) : void 0);
|
|
139134
|
+
if (exportDeclaration && exportDeclaration.moduleSpecifier) {
|
|
139135
|
+
targetToSourceExports.set(
|
|
139136
|
+
exportDeclaration,
|
|
139137
|
+
(targetToSourceExports.get(exportDeclaration) || /* @__PURE__ */ new Set()).add(declaration)
|
|
139138
|
+
);
|
|
139139
|
+
}
|
|
139140
|
+
});
|
|
139141
|
+
}
|
|
139142
|
+
}
|
|
139143
|
+
for (const [exportDeclaration, topLevelDeclarations] of arrayFrom(targetToSourceExports)) {
|
|
139144
|
+
if (exportDeclaration.exportClause && isNamedExports(exportDeclaration.exportClause) && length(exportDeclaration.exportClause.elements)) {
|
|
139145
|
+
const elements = exportDeclaration.exportClause.elements;
|
|
139146
|
+
const updatedElements = filter(elements, (elem) => find(skipAlias(elem.symbol, checker).declarations, (d) => isTopLevelDeclaration(d) && topLevelDeclarations.has(d)) === void 0);
|
|
139147
|
+
if (length(updatedElements) === 0) {
|
|
139148
|
+
changes.deleteNode(targetFile, exportDeclaration);
|
|
139149
|
+
removedExports.add(exportDeclaration);
|
|
139150
|
+
continue;
|
|
139151
|
+
}
|
|
139152
|
+
if (length(updatedElements) < length(elements)) {
|
|
139153
|
+
changes.replaceNode(
|
|
139154
|
+
targetFile,
|
|
139155
|
+
exportDeclaration,
|
|
139156
|
+
factory.updateExportDeclaration(
|
|
139157
|
+
exportDeclaration,
|
|
139158
|
+
exportDeclaration.modifiers,
|
|
139159
|
+
exportDeclaration.isTypeOnly,
|
|
139160
|
+
factory.updateNamedExports(exportDeclaration.exportClause, factory.createNodeArray(updatedElements, elements.hasTrailingComma)),
|
|
139161
|
+
exportDeclaration.moduleSpecifier,
|
|
139162
|
+
exportDeclaration.assertClause
|
|
139163
|
+
)
|
|
139164
|
+
);
|
|
139165
|
+
}
|
|
139166
|
+
}
|
|
139167
|
+
}
|
|
139168
|
+
}
|
|
139169
|
+
const lastReExport = findLast(targetFile.statements, (n) => isExportDeclaration(n) && !!n.moduleSpecifier && !removedExports.has(n));
|
|
139170
|
+
if (lastReExport) {
|
|
139171
|
+
changes.insertNodesBefore(
|
|
139172
|
+
targetFile,
|
|
139173
|
+
lastReExport,
|
|
139174
|
+
statements,
|
|
139175
|
+
/*blankLineBetween*/
|
|
139176
|
+
true
|
|
139177
|
+
);
|
|
139178
|
+
} else {
|
|
139179
|
+
changes.insertNodesAfter(targetFile, targetFile.statements[targetFile.statements.length - 1], statements);
|
|
139180
|
+
}
|
|
139181
|
+
}
|
|
139075
139182
|
function getOverloadRangeToMove(sourceFile, statement) {
|
|
139076
139183
|
if (isFunctionLikeDeclaration(statement)) {
|
|
139077
139184
|
const declarations = statement.symbol.declarations;
|
|
@@ -143537,10 +143644,10 @@ function createLanguageService(host, documentRegistry = createDocumentRegistry(h
|
|
|
143537
143644
|
host.log(message);
|
|
143538
143645
|
}
|
|
143539
143646
|
}
|
|
143540
|
-
const
|
|
143541
|
-
const getCanonicalFileName = createGetCanonicalFileName(
|
|
143647
|
+
const useCaseSensitiveFileNames2 = hostUsesCaseSensitiveFileNames(host);
|
|
143648
|
+
const getCanonicalFileName = createGetCanonicalFileName(useCaseSensitiveFileNames2);
|
|
143542
143649
|
const sourceMapper = getSourceMapper({
|
|
143543
|
-
useCaseSensitiveFileNames: () =>
|
|
143650
|
+
useCaseSensitiveFileNames: () => useCaseSensitiveFileNames2,
|
|
143544
143651
|
getCurrentDirectory: () => currentDirectory,
|
|
143545
143652
|
getProgram,
|
|
143546
143653
|
fileExists: maybeBind(host, host.fileExists),
|
|
@@ -143588,7 +143695,7 @@ function createLanguageService(host, documentRegistry = createDocumentRegistry(h
|
|
|
143588
143695
|
getSourceFileByPath: getOrCreateSourceFileByPath,
|
|
143589
143696
|
getCancellationToken: () => cancellationToken,
|
|
143590
143697
|
getCanonicalFileName,
|
|
143591
|
-
useCaseSensitiveFileNames: () =>
|
|
143698
|
+
useCaseSensitiveFileNames: () => useCaseSensitiveFileNames2,
|
|
143592
143699
|
getNewLine: () => getNewLineCharacter(newSettings),
|
|
143593
143700
|
getDefaultLibFileName: (options2) => host.getDefaultLibFileName(options2),
|
|
143594
143701
|
writeFile: noop,
|
|
@@ -143632,7 +143739,7 @@ function createLanguageService(host, documentRegistry = createDocumentRegistry(h
|
|
|
143632
143739
|
compilerHost.getSourceFile = getSourceFileWithCache;
|
|
143633
143740
|
(_c = host.setCompilerHost) == null ? void 0 : _c.call(host, compilerHost);
|
|
143634
143741
|
const parseConfigHost = {
|
|
143635
|
-
useCaseSensitiveFileNames,
|
|
143742
|
+
useCaseSensitiveFileNames: useCaseSensitiveFileNames2,
|
|
143636
143743
|
fileExists: (fileName) => compilerHost.fileExists(fileName),
|
|
143637
143744
|
readFile: (fileName) => compilerHost.readFile(fileName),
|
|
143638
143745
|
readDirectory: (...args) => compilerHost.readDirectory(...args),
|
|
@@ -167015,6 +167122,10 @@ function getSymbolKindOfConstructorPropertyMethodAccessorFunctionOrVar(typeCheck
|
|
|
167015
167122
|
return "parameter" /* parameterElement */;
|
|
167016
167123
|
} else if (symbol.valueDeclaration && isVarConst(symbol.valueDeclaration)) {
|
|
167017
167124
|
return "const" /* constElement */;
|
|
167125
|
+
} else if (symbol.valueDeclaration && isVarUsing(symbol.valueDeclaration)) {
|
|
167126
|
+
return "using" /* variableUsingElement */;
|
|
167127
|
+
} else if (symbol.valueDeclaration && isVarAwaitUsing(symbol.valueDeclaration)) {
|
|
167128
|
+
return "await using" /* variableAwaitUsingElement */;
|
|
167018
167129
|
} else if (forEach(symbol.declarations, isLet)) {
|
|
167019
167130
|
return "let" /* letElement */;
|
|
167020
167131
|
}
|
|
@@ -167408,7 +167519,7 @@ function getSymbolDisplayPartsDocumentationAndSymbolKind(typeChecker, symbol, so
|
|
|
167408
167519
|
} else {
|
|
167409
167520
|
addPrefixForAnyFunctionOrVar(symbol, symbolKind);
|
|
167410
167521
|
}
|
|
167411
|
-
if (symbolKind === "property" /* memberVariableElement */ || symbolKind === "accessor" /* memberAccessorVariableElement */ || symbolKind === "getter" /* memberGetAccessorElement */ || symbolKind === "setter" /* memberSetAccessorElement */ || symbolKind === "JSX attribute" /* jsxAttribute */ || symbolFlags & 3 /* Variable */ || symbolKind === "local var" /* localVariableElement */ || symbolKind === "index" /* indexSignatureElement */ || isThisExpression) {
|
|
167522
|
+
if (symbolKind === "property" /* memberVariableElement */ || symbolKind === "accessor" /* memberAccessorVariableElement */ || symbolKind === "getter" /* memberGetAccessorElement */ || symbolKind === "setter" /* memberSetAccessorElement */ || symbolKind === "JSX attribute" /* jsxAttribute */ || symbolFlags & 3 /* Variable */ || symbolKind === "local var" /* localVariableElement */ || symbolKind === "index" /* indexSignatureElement */ || symbolKind === "using" /* variableUsingElement */ || symbolKind === "await using" /* variableAwaitUsingElement */ || isThisExpression) {
|
|
167412
167523
|
displayParts.push(punctuationPart(59 /* ColonToken */));
|
|
167413
167524
|
displayParts.push(spacePart());
|
|
167414
167525
|
if (type.symbol && type.symbol.flags & 262144 /* TypeParameter */ && symbolKind !== "index" /* indexSignatureElement */) {
|
|
@@ -167558,6 +167669,8 @@ function getSymbolDisplayPartsDocumentationAndSymbolKind(typeChecker, symbol, so
|
|
|
167558
167669
|
case "let" /* letElement */:
|
|
167559
167670
|
case "const" /* constElement */:
|
|
167560
167671
|
case "constructor" /* constructorImplementationElement */:
|
|
167672
|
+
case "using" /* variableUsingElement */:
|
|
167673
|
+
case "await using" /* variableAwaitUsingElement */:
|
|
167561
167674
|
displayParts.push(textOrKeywordPart(symbolKind2));
|
|
167562
167675
|
return;
|
|
167563
167676
|
default:
|
|
@@ -167942,6 +168055,9 @@ var ChangeTracker = class _ChangeTracker {
|
|
|
167942
168055
|
insertNodeBefore(sourceFile, before, newNode, blankLineBetween = false, options = {}) {
|
|
167943
168056
|
this.insertNodeAt(sourceFile, getAdjustedStartPosition(sourceFile, before, options), newNode, this.getOptionsForInsertNodeBefore(before, newNode, blankLineBetween));
|
|
167944
168057
|
}
|
|
168058
|
+
insertNodesBefore(sourceFile, before, newNodes, blankLineBetween = false, options = {}) {
|
|
168059
|
+
this.insertNodesAt(sourceFile, getAdjustedStartPosition(sourceFile, before, options), newNodes, this.getOptionsForInsertNodeBefore(before, first(newNodes), blankLineBetween));
|
|
168060
|
+
}
|
|
167945
168061
|
insertModifierAt(sourceFile, pos, modifier, options = {}) {
|
|
167946
168062
|
this.insertNodeAt(sourceFile, pos, factory.createToken(modifier), options);
|
|
167947
168063
|
}
|
|
@@ -177111,7 +177227,7 @@ var Project3 = class _Project {
|
|
|
177111
177227
|
return this.projectService.includePackageJsonAutoImports();
|
|
177112
177228
|
}
|
|
177113
177229
|
/** @internal */
|
|
177114
|
-
|
|
177230
|
+
getHostForAutoImportProvider() {
|
|
177115
177231
|
var _a, _b;
|
|
177116
177232
|
if (this.program) {
|
|
177117
177233
|
return {
|
|
@@ -177122,7 +177238,8 @@ var Project3 = class _Project {
|
|
|
177122
177238
|
readFile: this.projectService.host.readFile.bind(this.projectService.host),
|
|
177123
177239
|
getDirectories: this.projectService.host.getDirectories.bind(this.projectService.host),
|
|
177124
177240
|
trace: (_b = this.projectService.host.trace) == null ? void 0 : _b.bind(this.projectService.host),
|
|
177125
|
-
useCaseSensitiveFileNames: this.program.useCaseSensitiveFileNames()
|
|
177241
|
+
useCaseSensitiveFileNames: this.program.useCaseSensitiveFileNames(),
|
|
177242
|
+
readDirectory: this.projectService.host.readDirectory.bind(this.projectService.host)
|
|
177126
177243
|
};
|
|
177127
177244
|
}
|
|
177128
177245
|
return this.projectService.host;
|
|
@@ -177150,7 +177267,7 @@ var Project3 = class _Project {
|
|
|
177150
177267
|
if (dependencySelection) {
|
|
177151
177268
|
(_a = tracing) == null ? void 0 : _a.push(tracing.Phase.Session, "getPackageJsonAutoImportProvider");
|
|
177152
177269
|
const start2 = timestamp();
|
|
177153
|
-
this.autoImportProviderHost = AutoImportProviderProject.create(dependencySelection, this, this.
|
|
177270
|
+
this.autoImportProviderHost = AutoImportProviderProject.create(dependencySelection, this, this.getHostForAutoImportProvider(), this.documentRegistry);
|
|
177154
177271
|
if (this.autoImportProviderHost) {
|
|
177155
177272
|
updateProjectIfDirty(this.autoImportProviderHost);
|
|
177156
177273
|
this.sendPerformanceEvent("CreatePackageJsonAutoImportProvider", timestamp() - start2);
|
|
@@ -177388,7 +177505,7 @@ var _AutoImportProviderProject = class _AutoImportProviderProject extends Projec
|
|
|
177388
177505
|
this.getParsedCommandLine = maybeBind(this.hostProject, this.hostProject.getParsedCommandLine);
|
|
177389
177506
|
}
|
|
177390
177507
|
/** @internal */
|
|
177391
|
-
static getRootFileNames(dependencySelection, hostProject,
|
|
177508
|
+
static getRootFileNames(dependencySelection, hostProject, host, compilerOptions) {
|
|
177392
177509
|
var _a, _b;
|
|
177393
177510
|
if (!dependencySelection) {
|
|
177394
177511
|
return emptyArray;
|
|
@@ -177418,7 +177535,7 @@ var _AutoImportProviderProject = class _AutoImportProviderProject extends Projec
|
|
|
177418
177535
|
name,
|
|
177419
177536
|
hostProject.currentDirectory,
|
|
177420
177537
|
compilerOptions,
|
|
177421
|
-
|
|
177538
|
+
host,
|
|
177422
177539
|
program.getModuleResolutionCache()
|
|
177423
177540
|
);
|
|
177424
177541
|
if (packageJson) {
|
|
@@ -177435,7 +177552,7 @@ var _AutoImportProviderProject = class _AutoImportProviderProject extends Projec
|
|
|
177435
177552
|
`@types/${name}`,
|
|
177436
177553
|
directory,
|
|
177437
177554
|
compilerOptions,
|
|
177438
|
-
|
|
177555
|
+
host,
|
|
177439
177556
|
program.getModuleResolutionCache()
|
|
177440
177557
|
);
|
|
177441
177558
|
if (typesPackageJson) {
|
|
@@ -177475,12 +177592,12 @@ var _AutoImportProviderProject = class _AutoImportProviderProject extends Projec
|
|
|
177475
177592
|
const entrypoints = getEntrypointsFromPackageJsonInfo(
|
|
177476
177593
|
packageJson,
|
|
177477
177594
|
compilerOptions,
|
|
177478
|
-
|
|
177595
|
+
host,
|
|
177479
177596
|
program2.getModuleResolutionCache(),
|
|
177480
177597
|
resolveJs
|
|
177481
177598
|
);
|
|
177482
177599
|
if (entrypoints) {
|
|
177483
|
-
const real = (_a2 =
|
|
177600
|
+
const real = (_a2 = host.realpath) == null ? void 0 : _a2.call(host, packageJson.packageDirectory);
|
|
177484
177601
|
const isSymlink = real && real !== packageJson.packageDirectory;
|
|
177485
177602
|
if (isSymlink) {
|
|
177486
177603
|
symlinkCache.setSymlinkedDirectory(packageJson.packageDirectory, {
|
|
@@ -177498,7 +177615,7 @@ var _AutoImportProviderProject = class _AutoImportProviderProject extends Projec
|
|
|
177498
177615
|
}
|
|
177499
177616
|
}
|
|
177500
177617
|
/** @internal */
|
|
177501
|
-
static create(dependencySelection, hostProject,
|
|
177618
|
+
static create(dependencySelection, hostProject, host, documentRegistry) {
|
|
177502
177619
|
if (dependencySelection === 0 /* Off */) {
|
|
177503
177620
|
return void 0;
|
|
177504
177621
|
}
|
|
@@ -177506,7 +177623,7 @@ var _AutoImportProviderProject = class _AutoImportProviderProject extends Projec
|
|
|
177506
177623
|
...hostProject.getCompilerOptions(),
|
|
177507
177624
|
...this.compilerOptionsOverrides
|
|
177508
177625
|
};
|
|
177509
|
-
const rootNames = this.getRootFileNames(dependencySelection, hostProject,
|
|
177626
|
+
const rootNames = this.getRootFileNames(dependencySelection, hostProject, host, compilerOptions);
|
|
177510
177627
|
if (!rootNames.length) {
|
|
177511
177628
|
return void 0;
|
|
177512
177629
|
}
|
|
@@ -177525,7 +177642,7 @@ var _AutoImportProviderProject = class _AutoImportProviderProject extends Projec
|
|
|
177525
177642
|
rootFileNames = _AutoImportProviderProject.getRootFileNames(
|
|
177526
177643
|
this.hostProject.includePackageJsonAutoImports(),
|
|
177527
177644
|
this.hostProject,
|
|
177528
|
-
this.hostProject.
|
|
177645
|
+
this.hostProject.getHostForAutoImportProvider(),
|
|
177529
177646
|
this.getCompilationSettings()
|
|
177530
177647
|
);
|
|
177531
177648
|
}
|
|
@@ -177564,7 +177681,7 @@ var _AutoImportProviderProject = class _AutoImportProviderProject extends Projec
|
|
|
177564
177681
|
onPackageJsonChange() {
|
|
177565
177682
|
throw new Error("package.json changes should be notified on an AutoImportProvider's host project");
|
|
177566
177683
|
}
|
|
177567
|
-
|
|
177684
|
+
getHostForAutoImportProvider() {
|
|
177568
177685
|
throw new Error("AutoImportProviderProject cannot provide its own host; use `hostProject.getModuleResolutionHostForAutomImportProvider()` instead.");
|
|
177569
177686
|
}
|
|
177570
177687
|
getProjectReferences() {
|