typescript 5.2.0-dev.20230707 → 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 +85 -85
- package/lib/tsserver.js +239 -135
- package/lib/tsserverlibrary.d.ts +5 -1
- package/lib/tsserverlibrary.js +239 -135
- package/lib/typescript.d.ts +4 -0
- package/lib/typescript.js +226 -123
- package/lib/typingsInstaller.js +55 -55
- 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;
|
|
@@ -20755,7 +20755,7 @@ function getSubPatternFromSpec(spec, basePath, usage, { singleAsteriskRegexFragm
|
|
|
20755
20755
|
function replaceWildcardCharacter(match, singleAsteriskRegexFragment) {
|
|
20756
20756
|
return match === "*" ? singleAsteriskRegexFragment : match === "?" ? "[^/]" : "\\" + match;
|
|
20757
20757
|
}
|
|
20758
|
-
function getFileMatcherPatterns(path, excludes, includes,
|
|
20758
|
+
function getFileMatcherPatterns(path, excludes, includes, useCaseSensitiveFileNames2, currentDirectory) {
|
|
20759
20759
|
path = normalizePath(path);
|
|
20760
20760
|
currentDirectory = normalizePath(currentDirectory);
|
|
20761
20761
|
const absolutePath = combinePaths(currentDirectory, path);
|
|
@@ -20764,22 +20764,22 @@ function getFileMatcherPatterns(path, excludes, includes, useCaseSensitiveFileNa
|
|
|
20764
20764
|
includeFilePattern: getRegularExpressionForWildcard(includes, absolutePath, "files"),
|
|
20765
20765
|
includeDirectoryPattern: getRegularExpressionForWildcard(includes, absolutePath, "directories"),
|
|
20766
20766
|
excludePattern: getRegularExpressionForWildcard(excludes, absolutePath, "exclude"),
|
|
20767
|
-
basePaths: getBasePaths(path, includes,
|
|
20767
|
+
basePaths: getBasePaths(path, includes, useCaseSensitiveFileNames2)
|
|
20768
20768
|
};
|
|
20769
20769
|
}
|
|
20770
|
-
function getRegexFromPattern(pattern,
|
|
20771
|
-
return new RegExp(pattern,
|
|
20770
|
+
function getRegexFromPattern(pattern, useCaseSensitiveFileNames2) {
|
|
20771
|
+
return new RegExp(pattern, useCaseSensitiveFileNames2 ? "" : "i");
|
|
20772
20772
|
}
|
|
20773
|
-
function matchFiles(path, extensions, excludes, includes,
|
|
20773
|
+
function matchFiles(path, extensions, excludes, includes, useCaseSensitiveFileNames2, currentDirectory, depth, getFileSystemEntries, realpath) {
|
|
20774
20774
|
path = normalizePath(path);
|
|
20775
20775
|
currentDirectory = normalizePath(currentDirectory);
|
|
20776
|
-
const patterns = getFileMatcherPatterns(path, excludes, includes,
|
|
20777
|
-
const includeFileRegexes = patterns.includeFilePatterns && patterns.includeFilePatterns.map((pattern) => getRegexFromPattern(pattern,
|
|
20778
|
-
const includeDirectoryRegex = patterns.includeDirectoryPattern && getRegexFromPattern(patterns.includeDirectoryPattern,
|
|
20779
|
-
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);
|
|
20780
20780
|
const results = includeFileRegexes ? includeFileRegexes.map(() => []) : [[]];
|
|
20781
20781
|
const visited = /* @__PURE__ */ new Map();
|
|
20782
|
-
const toCanonical = createGetCanonicalFileName(
|
|
20782
|
+
const toCanonical = createGetCanonicalFileName(useCaseSensitiveFileNames2);
|
|
20783
20783
|
for (const basePath of patterns.basePaths) {
|
|
20784
20784
|
visitDirectory(basePath, combinePaths(currentDirectory, basePath), depth);
|
|
20785
20785
|
}
|
|
@@ -20821,7 +20821,7 @@ function matchFiles(path, extensions, excludes, includes, useCaseSensitiveFileNa
|
|
|
20821
20821
|
}
|
|
20822
20822
|
}
|
|
20823
20823
|
}
|
|
20824
|
-
function getBasePaths(path, includes,
|
|
20824
|
+
function getBasePaths(path, includes, useCaseSensitiveFileNames2) {
|
|
20825
20825
|
const basePaths = [path];
|
|
20826
20826
|
if (includes) {
|
|
20827
20827
|
const includeBasePaths = [];
|
|
@@ -20829,9 +20829,9 @@ function getBasePaths(path, includes, useCaseSensitiveFileNames) {
|
|
|
20829
20829
|
const absolute = isRootedDiskPath(include) ? include : normalizePath(combinePaths(path, include));
|
|
20830
20830
|
includeBasePaths.push(getIncludeBasePath(absolute));
|
|
20831
20831
|
}
|
|
20832
|
-
includeBasePaths.sort(getStringComparer(!
|
|
20832
|
+
includeBasePaths.sort(getStringComparer(!useCaseSensitiveFileNames2));
|
|
20833
20833
|
for (const includeBasePath of includeBasePaths) {
|
|
20834
|
-
if (every(basePaths, (basePath) => !containsPath(basePath, includeBasePath, path, !
|
|
20834
|
+
if (every(basePaths, (basePath) => !containsPath(basePath, includeBasePath, path, !useCaseSensitiveFileNames2))) {
|
|
20835
20835
|
basePaths.push(includeBasePath);
|
|
20836
20836
|
}
|
|
20837
20837
|
}
|
|
@@ -40948,19 +40948,19 @@ function getFileNamesFromConfigSpecs(configFileSpecs, basePath, options, host, e
|
|
|
40948
40948
|
const wildcardFiles = arrayFrom(wildcardFileMap.values());
|
|
40949
40949
|
return literalFiles.concat(wildcardFiles, arrayFrom(wildCardJsonFileMap.values()));
|
|
40950
40950
|
}
|
|
40951
|
-
function isExcludedFile(pathToCheck, spec, basePath,
|
|
40951
|
+
function isExcludedFile(pathToCheck, spec, basePath, useCaseSensitiveFileNames2, currentDirectory) {
|
|
40952
40952
|
const { validatedFilesSpec, validatedIncludeSpecs, validatedExcludeSpecs } = spec;
|
|
40953
40953
|
if (!length(validatedIncludeSpecs) || !length(validatedExcludeSpecs))
|
|
40954
40954
|
return false;
|
|
40955
40955
|
basePath = normalizePath(basePath);
|
|
40956
|
-
const keyMapper = createGetCanonicalFileName(
|
|
40956
|
+
const keyMapper = createGetCanonicalFileName(useCaseSensitiveFileNames2);
|
|
40957
40957
|
if (validatedFilesSpec) {
|
|
40958
40958
|
for (const fileName of validatedFilesSpec) {
|
|
40959
40959
|
if (keyMapper(getNormalizedAbsolutePath(fileName, basePath)) === pathToCheck)
|
|
40960
40960
|
return false;
|
|
40961
40961
|
}
|
|
40962
40962
|
}
|
|
40963
|
-
return matchesExcludeWorker(pathToCheck, validatedExcludeSpecs,
|
|
40963
|
+
return matchesExcludeWorker(pathToCheck, validatedExcludeSpecs, useCaseSensitiveFileNames2, currentDirectory, basePath);
|
|
40964
40964
|
}
|
|
40965
40965
|
function invalidDotDotAfterRecursiveWildcard(s) {
|
|
40966
40966
|
const wildcardIndex = startsWith(s, "**/") ? 0 : s.indexOf("/**/");
|
|
@@ -40970,17 +40970,17 @@ function invalidDotDotAfterRecursiveWildcard(s) {
|
|
|
40970
40970
|
const lastDotIndex = endsWith(s, "/..") ? s.length : s.lastIndexOf("/../");
|
|
40971
40971
|
return lastDotIndex > wildcardIndex;
|
|
40972
40972
|
}
|
|
40973
|
-
function matchesExclude(pathToCheck, excludeSpecs,
|
|
40973
|
+
function matchesExclude(pathToCheck, excludeSpecs, useCaseSensitiveFileNames2, currentDirectory) {
|
|
40974
40974
|
return matchesExcludeWorker(
|
|
40975
40975
|
pathToCheck,
|
|
40976
40976
|
filter(excludeSpecs, (spec) => !invalidDotDotAfterRecursiveWildcard(spec)),
|
|
40977
|
-
|
|
40977
|
+
useCaseSensitiveFileNames2,
|
|
40978
40978
|
currentDirectory
|
|
40979
40979
|
);
|
|
40980
40980
|
}
|
|
40981
|
-
function matchesExcludeWorker(pathToCheck, excludeSpecs,
|
|
40981
|
+
function matchesExcludeWorker(pathToCheck, excludeSpecs, useCaseSensitiveFileNames2, currentDirectory, basePath) {
|
|
40982
40982
|
const excludePattern = getRegularExpressionForWildcard(excludeSpecs, combinePaths(normalizePath(currentDirectory), basePath), "exclude");
|
|
40983
|
-
const excludeRegex = excludePattern && getRegexFromPattern(excludePattern,
|
|
40983
|
+
const excludeRegex = excludePattern && getRegexFromPattern(excludePattern, useCaseSensitiveFileNames2);
|
|
40984
40984
|
if (!excludeRegex)
|
|
40985
40985
|
return false;
|
|
40986
40986
|
if (excludeRegex.test(pathToCheck))
|
|
@@ -41010,9 +41010,9 @@ function specToDiagnostic(spec, disallowTrailingRecursion) {
|
|
|
41010
41010
|
return [Diagnostics.File_specification_cannot_contain_a_parent_directory_that_appears_after_a_recursive_directory_wildcard_Asterisk_Asterisk_Colon_0, spec];
|
|
41011
41011
|
}
|
|
41012
41012
|
}
|
|
41013
|
-
function getWildcardDirectories({ validatedIncludeSpecs: include, validatedExcludeSpecs: exclude }, path,
|
|
41013
|
+
function getWildcardDirectories({ validatedIncludeSpecs: include, validatedExcludeSpecs: exclude }, path, useCaseSensitiveFileNames2) {
|
|
41014
41014
|
const rawExcludeRegex = getRegularExpressionForWildcard(exclude, path, "exclude");
|
|
41015
|
-
const excludeRegex = rawExcludeRegex && new RegExp(rawExcludeRegex,
|
|
41015
|
+
const excludeRegex = rawExcludeRegex && new RegExp(rawExcludeRegex, useCaseSensitiveFileNames2 ? "" : "i");
|
|
41016
41016
|
const wildcardDirectories = {};
|
|
41017
41017
|
if (include !== void 0) {
|
|
41018
41018
|
const recursiveKeys = [];
|
|
@@ -41021,7 +41021,7 @@ function getWildcardDirectories({ validatedIncludeSpecs: include, validatedExclu
|
|
|
41021
41021
|
if (excludeRegex && excludeRegex.test(spec)) {
|
|
41022
41022
|
continue;
|
|
41023
41023
|
}
|
|
41024
|
-
const match = getWildcardDirectoryFromSpec(spec,
|
|
41024
|
+
const match = getWildcardDirectoryFromSpec(spec, useCaseSensitiveFileNames2);
|
|
41025
41025
|
if (match) {
|
|
41026
41026
|
const { key, flags } = match;
|
|
41027
41027
|
const existingFlags = wildcardDirectories[key];
|
|
@@ -41036,7 +41036,7 @@ function getWildcardDirectories({ validatedIncludeSpecs: include, validatedExclu
|
|
|
41036
41036
|
for (const key in wildcardDirectories) {
|
|
41037
41037
|
if (hasProperty(wildcardDirectories, key)) {
|
|
41038
41038
|
for (const recursiveKey of recursiveKeys) {
|
|
41039
|
-
if (key !== recursiveKey && containsPath(recursiveKey, key, path, !
|
|
41039
|
+
if (key !== recursiveKey && containsPath(recursiveKey, key, path, !useCaseSensitiveFileNames2)) {
|
|
41040
41040
|
delete wildcardDirectories[key];
|
|
41041
41041
|
}
|
|
41042
41042
|
}
|
|
@@ -41045,20 +41045,20 @@ function getWildcardDirectories({ validatedIncludeSpecs: include, validatedExclu
|
|
|
41045
41045
|
}
|
|
41046
41046
|
return wildcardDirectories;
|
|
41047
41047
|
}
|
|
41048
|
-
function getWildcardDirectoryFromSpec(spec,
|
|
41048
|
+
function getWildcardDirectoryFromSpec(spec, useCaseSensitiveFileNames2) {
|
|
41049
41049
|
const match = wildcardDirectoryPattern.exec(spec);
|
|
41050
41050
|
if (match) {
|
|
41051
41051
|
const questionWildcardIndex = spec.indexOf("?");
|
|
41052
41052
|
const starWildcardIndex = spec.indexOf("*");
|
|
41053
41053
|
const lastDirectorySeperatorIndex = spec.lastIndexOf(directorySeparator);
|
|
41054
41054
|
return {
|
|
41055
|
-
key:
|
|
41055
|
+
key: useCaseSensitiveFileNames2 ? match[0] : toFileNameLowerCase(match[0]),
|
|
41056
41056
|
flags: questionWildcardIndex !== -1 && questionWildcardIndex < lastDirectorySeperatorIndex || starWildcardIndex !== -1 && starWildcardIndex < lastDirectorySeperatorIndex ? 1 /* Recursive */ : 0 /* None */
|
|
41057
41057
|
};
|
|
41058
41058
|
}
|
|
41059
41059
|
if (isImplicitGlob(spec.substring(spec.lastIndexOf(directorySeparator) + 1))) {
|
|
41060
41060
|
return {
|
|
41061
|
-
key: removeTrailingDirectorySeparator(
|
|
41061
|
+
key: removeTrailingDirectorySeparator(useCaseSensitiveFileNames2 ? spec : toFileNameLowerCase(spec)),
|
|
41062
41062
|
flags: 1 /* Recursive */
|
|
41063
41063
|
};
|
|
41064
41064
|
}
|
|
@@ -41204,6 +41204,18 @@ function formatExtensions(extensions) {
|
|
|
41204
41204
|
result.push("JSON");
|
|
41205
41205
|
return result.join(", ");
|
|
41206
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
|
+
}
|
|
41207
41219
|
function resolvedTypeScriptOnly(resolved) {
|
|
41208
41220
|
if (!resolved) {
|
|
41209
41221
|
return void 0;
|
|
@@ -41378,8 +41390,8 @@ function getDefaultTypeRoots(currentDirectory) {
|
|
|
41378
41390
|
}
|
|
41379
41391
|
var nodeModulesAtTypes = combinePaths("node_modules", "@types");
|
|
41380
41392
|
function arePathsEqual(path1, path2, host) {
|
|
41381
|
-
const
|
|
41382
|
-
return comparePaths(path1, path2, !
|
|
41393
|
+
const useCaseSensitiveFileNames2 = typeof host.useCaseSensitiveFileNames === "function" ? host.useCaseSensitiveFileNames() : host.useCaseSensitiveFileNames;
|
|
41394
|
+
return comparePaths(path1, path2, !useCaseSensitiveFileNames2) === 0 /* EqualTo */;
|
|
41383
41395
|
}
|
|
41384
41396
|
function getOriginalAndResolvedFileName(fileName, host, traceEnabled) {
|
|
41385
41397
|
const resolvedFileName = realPath(fileName, host, traceEnabled);
|
|
@@ -42656,7 +42668,7 @@ function getEntrypointsFromPackageJsonInfo(packageJsonInfo, options, host, cache
|
|
|
42656
42668
|
arrayIsEqualTo
|
|
42657
42669
|
);
|
|
42658
42670
|
for (const conditions of conditionSets) {
|
|
42659
|
-
const loadPackageJsonExportsState = { ...loadPackageJsonMainState, failedLookupLocations: [], conditions };
|
|
42671
|
+
const loadPackageJsonExportsState = { ...loadPackageJsonMainState, failedLookupLocations: [], conditions, host };
|
|
42660
42672
|
const exportResolutions = loadEntrypointsFromExportMap(
|
|
42661
42673
|
packageJsonInfo,
|
|
42662
42674
|
packageJsonInfo.contents.packageJsonContent.exports,
|
|
@@ -42688,23 +42700,42 @@ function loadEntrypointsFromExportMap(scope, exports, state, extensions) {
|
|
|
42688
42700
|
return entrypoints;
|
|
42689
42701
|
function loadEntrypointsFromTargetExports(target) {
|
|
42690
42702
|
var _a, _b;
|
|
42691
|
-
if (typeof target === "string" && startsWith(target, "./")
|
|
42692
|
-
|
|
42693
|
-
|
|
42694
|
-
|
|
42695
|
-
|
|
42696
|
-
|
|
42697
|
-
|
|
42698
|
-
|
|
42699
|
-
|
|
42700
|
-
|
|
42701
|
-
|
|
42702
|
-
|
|
42703
|
-
|
|
42704
|
-
|
|
42705
|
-
|
|
42706
|
-
|
|
42707
|
-
|
|
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
|
+
}
|
|
42708
42739
|
}
|
|
42709
42740
|
} else if (Array.isArray(target)) {
|
|
42710
42741
|
for (const t of target) {
|
|
@@ -43263,13 +43294,10 @@ function getLoadModuleFromTargetImportOrExport(extensions, state, cache, redirec
|
|
|
43263
43294
|
function combineDirectoryPath(root, dir) {
|
|
43264
43295
|
return ensureTrailingDirectorySeparator(combinePaths(root, dir));
|
|
43265
43296
|
}
|
|
43266
|
-
function useCaseSensitiveFileNames() {
|
|
43267
|
-
return !state.host.useCaseSensitiveFileNames ? true : typeof state.host.useCaseSensitiveFileNames === "boolean" ? state.host.useCaseSensitiveFileNames : state.host.useCaseSensitiveFileNames();
|
|
43268
|
-
}
|
|
43269
43297
|
function tryLoadInputFileForPath(finalPath, entry, packagePath, isImports2) {
|
|
43270
43298
|
var _a, _b, _c, _d;
|
|
43271
|
-
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)) {
|
|
43272
|
-
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) });
|
|
43273
43301
|
const commonSourceDirGuesses = [];
|
|
43274
43302
|
if (state.compilerOptions.rootDir || state.compilerOptions.composite && state.compilerOptions.configFilePath) {
|
|
43275
43303
|
const commonDir = toAbsolutePath(getCommonSourceDirectory(state.compilerOptions, () => [], ((_b = (_a = state.host).getCurrentDirectory) == null ? void 0 : _b.call(_a)) || "", getCanonicalFileName));
|
|
@@ -43298,7 +43326,7 @@ function getLoadModuleFromTargetImportOrExport(extensions, state, cache, redirec
|
|
|
43298
43326
|
for (const commonSourceDirGuess of commonSourceDirGuesses) {
|
|
43299
43327
|
const candidateDirectories = getOutputDirectoriesForBaseDirectory(commonSourceDirGuess);
|
|
43300
43328
|
for (const candidateDir of candidateDirectories) {
|
|
43301
|
-
if (containsPath(candidateDir, finalPath, !useCaseSensitiveFileNames())) {
|
|
43329
|
+
if (containsPath(candidateDir, finalPath, !useCaseSensitiveFileNames(state))) {
|
|
43302
43330
|
const pathFragment = finalPath.slice(candidateDir.length + 1);
|
|
43303
43331
|
const possibleInputBase = combinePaths(commonSourceDirGuess, pathFragment);
|
|
43304
43332
|
const jsAndDtsExtensions = [".mjs" /* Mjs */, ".cjs" /* Cjs */, ".js" /* Js */, ".json" /* Json */, ".d.mts" /* Dmts */, ".d.cts" /* Dcts */, ".d.ts" /* Dts */];
|
|
@@ -43308,7 +43336,7 @@ function getLoadModuleFromTargetImportOrExport(extensions, state, cache, redirec
|
|
|
43308
43336
|
for (const possibleExt of inputExts) {
|
|
43309
43337
|
if (!extensionIsOk(extensions, possibleExt))
|
|
43310
43338
|
continue;
|
|
43311
|
-
const possibleInputWithInputExtension = changeAnyExtension(possibleInputBase, possibleExt, ext, !useCaseSensitiveFileNames());
|
|
43339
|
+
const possibleInputWithInputExtension = changeAnyExtension(possibleInputBase, possibleExt, ext, !useCaseSensitiveFileNames(state));
|
|
43312
43340
|
if (state.host.fileExists(possibleInputWithInputExtension)) {
|
|
43313
43341
|
return toSearchResult(withPackageId(scope, loadFileNameFromPackageJsonField(
|
|
43314
43342
|
extensions,
|
|
@@ -43725,6 +43753,9 @@ function traceIfEnabled(state, diagnostic, ...args) {
|
|
|
43725
43753
|
trace(state.host, diagnostic, ...args);
|
|
43726
43754
|
}
|
|
43727
43755
|
}
|
|
43756
|
+
function useCaseSensitiveFileNames(state) {
|
|
43757
|
+
return !state.host.useCaseSensitiveFileNames ? true : typeof state.host.useCaseSensitiveFileNames === "boolean" ? state.host.useCaseSensitiveFileNames : state.host.useCaseSensitiveFileNames();
|
|
43758
|
+
}
|
|
43728
43759
|
|
|
43729
43760
|
// src/compiler/binder.ts
|
|
43730
43761
|
var ModuleInstanceState = /* @__PURE__ */ ((ModuleInstanceState2) => {
|
|
@@ -47282,7 +47313,7 @@ function tryGetModuleNameFromExports(options, targetFilePath, packageDirectory,
|
|
|
47282
47313
|
for (const key of getOwnKeys(exports)) {
|
|
47283
47314
|
if (key === "default" || conditions.indexOf(key) >= 0 || isApplicableVersionedTypesKey(conditions, key)) {
|
|
47284
47315
|
const subTarget = exports[key];
|
|
47285
|
-
const result = tryGetModuleNameFromExports(options, targetFilePath, packageDirectory, packageName, subTarget, conditions);
|
|
47316
|
+
const result = tryGetModuleNameFromExports(options, targetFilePath, packageDirectory, packageName, subTarget, conditions, mode);
|
|
47286
47317
|
if (result) {
|
|
47287
47318
|
return result;
|
|
47288
47319
|
}
|
|
@@ -118865,14 +118896,14 @@ function getEmitListItem(emit, parenthesizerRule) {
|
|
|
118865
118896
|
}
|
|
118866
118897
|
|
|
118867
118898
|
// src/compiler/watchUtilities.ts
|
|
118868
|
-
function createCachedDirectoryStructureHost(host, currentDirectory,
|
|
118899
|
+
function createCachedDirectoryStructureHost(host, currentDirectory, useCaseSensitiveFileNames2) {
|
|
118869
118900
|
if (!host.getDirectories || !host.readDirectory) {
|
|
118870
118901
|
return void 0;
|
|
118871
118902
|
}
|
|
118872
118903
|
const cachedReadDirectoryResult = /* @__PURE__ */ new Map();
|
|
118873
|
-
const getCanonicalFileName = createGetCanonicalFileName(
|
|
118904
|
+
const getCanonicalFileName = createGetCanonicalFileName(useCaseSensitiveFileNames2);
|
|
118874
118905
|
return {
|
|
118875
|
-
useCaseSensitiveFileNames,
|
|
118906
|
+
useCaseSensitiveFileNames: useCaseSensitiveFileNames2,
|
|
118876
118907
|
fileExists,
|
|
118877
118908
|
readFile: (path, encoding) => host.readFile(path, encoding),
|
|
118878
118909
|
directoryExists: host.directoryExists && directoryExists,
|
|
@@ -118994,7 +119025,7 @@ function createCachedDirectoryStructureHost(host, currentDirectory, useCaseSensi
|
|
|
118994
119025
|
const rootResult = tryReadDirectory2(rootDir, rootDirPath);
|
|
118995
119026
|
let rootSymLinkResult;
|
|
118996
119027
|
if (rootResult !== void 0) {
|
|
118997
|
-
return matchFiles(rootDir, extensions, excludes, includes,
|
|
119028
|
+
return matchFiles(rootDir, extensions, excludes, includes, useCaseSensitiveFileNames2, currentDirectory, depth, getFileSystemEntries, realpath);
|
|
118998
119029
|
}
|
|
118999
119030
|
return host.readDirectory(rootDir, extensions, excludes, includes, depth);
|
|
119000
119031
|
function getFileSystemEntries(dir) {
|
|
@@ -119195,7 +119226,7 @@ function isIgnoredFileFromWildCardWatching({
|
|
|
119195
119226
|
program,
|
|
119196
119227
|
extraFileExtensions,
|
|
119197
119228
|
currentDirectory,
|
|
119198
|
-
useCaseSensitiveFileNames,
|
|
119229
|
+
useCaseSensitiveFileNames: useCaseSensitiveFileNames2,
|
|
119199
119230
|
writeLog,
|
|
119200
119231
|
toPath: toPath3
|
|
119201
119232
|
}) {
|
|
@@ -119211,7 +119242,7 @@ function isIgnoredFileFromWildCardWatching({
|
|
|
119211
119242
|
writeLog(`Project: ${configFileName} Detected file add/remove of non supported extension: ${fileOrDirectory}`);
|
|
119212
119243
|
return true;
|
|
119213
119244
|
}
|
|
119214
|
-
if (isExcludedFile(fileOrDirectory, options.configFile.configFileSpecs, getNormalizedAbsolutePath(getDirectoryPath(configFileName), currentDirectory),
|
|
119245
|
+
if (isExcludedFile(fileOrDirectory, options.configFile.configFileSpecs, getNormalizedAbsolutePath(getDirectoryPath(configFileName), currentDirectory), useCaseSensitiveFileNames2, currentDirectory)) {
|
|
119215
119246
|
writeLog(`Project: ${configFileName} Detected excluded file: ${fileOrDirectory}`);
|
|
119216
119247
|
return true;
|
|
119217
119248
|
}
|
|
@@ -119274,7 +119305,7 @@ function getWatchFactory(host, watchLogLevel, log, getDetailWatchInfo2) {
|
|
|
119274
119305
|
function createExcludeHandlingAddWatch(key) {
|
|
119275
119306
|
return (file, cb, flags, options, detailInfo1, detailInfo2) => {
|
|
119276
119307
|
var _a;
|
|
119277
|
-
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(
|
|
119278
119309
|
/*thisArgs*/
|
|
119279
119310
|
void 0,
|
|
119280
119311
|
file,
|
|
@@ -119286,7 +119317,7 @@ function getWatchFactory(host, watchLogLevel, log, getDetailWatchInfo2) {
|
|
|
119286
119317
|
) : excludeWatcherFactory(file, flags, options, detailInfo1, detailInfo2);
|
|
119287
119318
|
};
|
|
119288
119319
|
}
|
|
119289
|
-
function
|
|
119320
|
+
function useCaseSensitiveFileNames2() {
|
|
119290
119321
|
return typeof host.useCaseSensitiveFileNames === "boolean" ? host.useCaseSensitiveFileNames : host.useCaseSensitiveFileNames();
|
|
119291
119322
|
}
|
|
119292
119323
|
function createExcludeWatcherWithLogging(file, flags, options, detailInfo1, detailInfo2) {
|
|
@@ -126371,12 +126402,12 @@ function getMatchedIncludeSpec(program, fileName) {
|
|
|
126371
126402
|
return true;
|
|
126372
126403
|
const isJsonFile = fileExtensionIs(fileName, ".json" /* Json */);
|
|
126373
126404
|
const basePath = getDirectoryPath(getNormalizedAbsolutePath(configFile.fileName, program.getCurrentDirectory()));
|
|
126374
|
-
const
|
|
126405
|
+
const useCaseSensitiveFileNames2 = program.useCaseSensitiveFileNames();
|
|
126375
126406
|
return find((_b = configFile == null ? void 0 : configFile.configFileSpecs) == null ? void 0 : _b.validatedIncludeSpecs, (includeSpec) => {
|
|
126376
126407
|
if (isJsonFile && !endsWith(includeSpec, ".json" /* Json */))
|
|
126377
126408
|
return false;
|
|
126378
126409
|
const pattern = getPatternFromSpec(includeSpec, basePath, "files");
|
|
126379
|
-
return !!pattern && getRegexFromPattern(`(${pattern})$`,
|
|
126410
|
+
return !!pattern && getRegexFromPattern(`(${pattern})$`, useCaseSensitiveFileNames2).test(fileName);
|
|
126380
126411
|
});
|
|
126381
126412
|
}
|
|
126382
126413
|
function fileIncludeReasonToDiagnostics(program, reason, fileNameConvertor) {
|
|
@@ -126605,7 +126636,7 @@ function createWatchFactory(host, options) {
|
|
|
126605
126636
|
return result;
|
|
126606
126637
|
}
|
|
126607
126638
|
function createCompilerHostFromProgramHost(host, getCompilerOptions, directoryStructureHost = host) {
|
|
126608
|
-
const
|
|
126639
|
+
const useCaseSensitiveFileNames2 = host.useCaseSensitiveFileNames();
|
|
126609
126640
|
const compilerHost = {
|
|
126610
126641
|
getSourceFile: createGetSourceFile(
|
|
126611
126642
|
(fileName, encoding) => !encoding ? compilerHost.readFile(fileName) : host.readFile(fileName, encoding),
|
|
@@ -126621,8 +126652,8 @@ function createCompilerHostFromProgramHost(host, getCompilerOptions, directorySt
|
|
|
126621
126652
|
(path) => host.directoryExists(path)
|
|
126622
126653
|
),
|
|
126623
126654
|
getCurrentDirectory: memoize(() => host.getCurrentDirectory()),
|
|
126624
|
-
useCaseSensitiveFileNames: () =>
|
|
126625
|
-
getCanonicalFileName: createGetCanonicalFileName(
|
|
126655
|
+
useCaseSensitiveFileNames: () => useCaseSensitiveFileNames2,
|
|
126656
|
+
getCanonicalFileName: createGetCanonicalFileName(useCaseSensitiveFileNames2),
|
|
126626
126657
|
getNewLine: () => getNewLineCharacter(getCompilerOptions()),
|
|
126627
126658
|
fileExists: (f) => host.fileExists(f),
|
|
126628
126659
|
readFile: (f) => host.readFile(f),
|
|
@@ -126862,7 +126893,7 @@ function createWatchProgram(host) {
|
|
|
126862
126893
|
const sourceFilesCache = /* @__PURE__ */ new Map();
|
|
126863
126894
|
let missingFilePathsRequestedForRelease;
|
|
126864
126895
|
let hasChangedCompilerOptions = false;
|
|
126865
|
-
const
|
|
126896
|
+
const useCaseSensitiveFileNames2 = host.useCaseSensitiveFileNames();
|
|
126866
126897
|
const currentDirectory = host.getCurrentDirectory();
|
|
126867
126898
|
const { configFileName, optionsToExtend: optionsToExtendForConfigFile = {}, watchOptionsToExtend, extraFileExtensions, createProgram: createProgram2 } = host;
|
|
126868
126899
|
let { rootFiles: rootFileNames, options: compilerOptions, watchOptions, projectReferences } = host;
|
|
@@ -126870,7 +126901,7 @@ function createWatchProgram(host) {
|
|
|
126870
126901
|
let configFileParsingDiagnostics;
|
|
126871
126902
|
let canConfigFileJsonReportNoInputFiles = false;
|
|
126872
126903
|
let hasChangedConfigFileParsingErrors = false;
|
|
126873
|
-
const cachedDirectoryStructureHost = configFileName === void 0 ? void 0 : createCachedDirectoryStructureHost(host, currentDirectory,
|
|
126904
|
+
const cachedDirectoryStructureHost = configFileName === void 0 ? void 0 : createCachedDirectoryStructureHost(host, currentDirectory, useCaseSensitiveFileNames2);
|
|
126874
126905
|
const directoryStructureHost = cachedDirectoryStructureHost || host;
|
|
126875
126906
|
const parseConfigFileHost = parseConfigHostFromCompilerHostLike(host, directoryStructureHost);
|
|
126876
126907
|
let newLine = updateNewLine();
|
|
@@ -126888,8 +126919,8 @@ function createWatchProgram(host) {
|
|
|
126888
126919
|
Debug.assert(compilerOptions);
|
|
126889
126920
|
Debug.assert(rootFileNames);
|
|
126890
126921
|
const { watchFile: watchFile2, watchDirectory, writeLog } = createWatchFactory(host, compilerOptions);
|
|
126891
|
-
const getCanonicalFileName = createGetCanonicalFileName(
|
|
126892
|
-
writeLog(`Current directory: ${currentDirectory} CaseSensitiveFileNames: ${
|
|
126922
|
+
const getCanonicalFileName = createGetCanonicalFileName(useCaseSensitiveFileNames2);
|
|
126923
|
+
writeLog(`Current directory: ${currentDirectory} CaseSensitiveFileNames: ${useCaseSensitiveFileNames2}`);
|
|
126893
126924
|
let configFileWatcher;
|
|
126894
126925
|
if (configFileName) {
|
|
126895
126926
|
configFileWatcher = watchFile2(configFileName, scheduleProgramReload, 2e3 /* High */, watchOptions, WatchType.ConfigFile);
|
|
@@ -127395,7 +127426,7 @@ function createWatchProgram(host) {
|
|
|
127395
127426
|
options: compilerOptions,
|
|
127396
127427
|
program: getCurrentBuilderProgram() || rootFileNames,
|
|
127397
127428
|
currentDirectory,
|
|
127398
|
-
useCaseSensitiveFileNames,
|
|
127429
|
+
useCaseSensitiveFileNames: useCaseSensitiveFileNames2,
|
|
127399
127430
|
writeLog,
|
|
127400
127431
|
toPath: toPath3
|
|
127401
127432
|
}))
|
|
@@ -127485,7 +127516,7 @@ function createWatchProgram(host) {
|
|
|
127485
127516
|
options: config.parsedCommandLine.options,
|
|
127486
127517
|
program: config.parsedCommandLine.fileNames,
|
|
127487
127518
|
currentDirectory,
|
|
127488
|
-
useCaseSensitiveFileNames,
|
|
127519
|
+
useCaseSensitiveFileNames: useCaseSensitiveFileNames2,
|
|
127489
127520
|
writeLog,
|
|
127490
127521
|
toPath: toPath3
|
|
127491
127522
|
}))
|
|
@@ -130099,6 +130130,8 @@ var ScriptElementKind = /* @__PURE__ */ ((ScriptElementKind2) => {
|
|
|
130099
130130
|
ScriptElementKind2["enumMemberElement"] = "enum member";
|
|
130100
130131
|
ScriptElementKind2["variableElement"] = "var";
|
|
130101
130132
|
ScriptElementKind2["localVariableElement"] = "local var";
|
|
130133
|
+
ScriptElementKind2["variableUsingElement"] = "using";
|
|
130134
|
+
ScriptElementKind2["variableAwaitUsingElement"] = "await using";
|
|
130102
130135
|
ScriptElementKind2["functionElement"] = "function";
|
|
130103
130136
|
ScriptElementKind2["localFunctionElement"] = "local function";
|
|
130104
130137
|
ScriptElementKind2["memberFunctionElement"] = "method";
|
|
@@ -133237,10 +133270,10 @@ function isImportablePath(fromPath, toPath3, getCanonicalFileName, globalCachePa
|
|
|
133237
133270
|
}
|
|
133238
133271
|
function forEachExternalModuleToImportFrom(program, host, preferences, useAutoImportProvider, cb) {
|
|
133239
133272
|
var _a, _b;
|
|
133240
|
-
const
|
|
133273
|
+
const useCaseSensitiveFileNames2 = hostUsesCaseSensitiveFileNames(host);
|
|
133241
133274
|
const excludePatterns = preferences.autoImportFileExcludePatterns && mapDefined(preferences.autoImportFileExcludePatterns, (spec) => {
|
|
133242
133275
|
const pattern = getPatternFromSpec(spec, "", "exclude");
|
|
133243
|
-
return pattern ? getRegexFromPattern(pattern,
|
|
133276
|
+
return pattern ? getRegexFromPattern(pattern, useCaseSensitiveFileNames2) : void 0;
|
|
133244
133277
|
});
|
|
133245
133278
|
forEachExternalModule(program.getTypeChecker(), program.getSourceFiles(), excludePatterns, (module2, file) => cb(
|
|
133246
133279
|
module2,
|
|
@@ -134702,12 +134735,12 @@ var DocumentHighlights;
|
|
|
134702
134735
|
function isDocumentRegistryEntry(entry) {
|
|
134703
134736
|
return !!entry.sourceFile;
|
|
134704
134737
|
}
|
|
134705
|
-
function createDocumentRegistry(
|
|
134706
|
-
return createDocumentRegistryInternal(
|
|
134738
|
+
function createDocumentRegistry(useCaseSensitiveFileNames2, currentDirectory) {
|
|
134739
|
+
return createDocumentRegistryInternal(useCaseSensitiveFileNames2, currentDirectory);
|
|
134707
134740
|
}
|
|
134708
|
-
function createDocumentRegistryInternal(
|
|
134741
|
+
function createDocumentRegistryInternal(useCaseSensitiveFileNames2, currentDirectory = "", externalCache) {
|
|
134709
134742
|
const buckets = /* @__PURE__ */ new Map();
|
|
134710
|
-
const getCanonicalFileName = createGetCanonicalFileName(!!
|
|
134743
|
+
const getCanonicalFileName = createGetCanonicalFileName(!!useCaseSensitiveFileNames2);
|
|
134711
134744
|
function reportStats() {
|
|
134712
134745
|
const bucketInfoArray = arrayFrom(buckets.keys()).filter((name) => name && name.charAt(0) === "_").map((name) => {
|
|
134713
134746
|
const entries = buckets.get(name);
|
|
@@ -134910,12 +134943,12 @@ function getDocumentRegistryBucketKeyWithMode(key, mode) {
|
|
|
134910
134943
|
|
|
134911
134944
|
// src/services/getEditsForFileRename.ts
|
|
134912
134945
|
function getEditsForFileRename(program, oldFileOrDirPath, newFileOrDirPath, host, formatContext, preferences, sourceMapper) {
|
|
134913
|
-
const
|
|
134914
|
-
const getCanonicalFileName = createGetCanonicalFileName(
|
|
134946
|
+
const useCaseSensitiveFileNames2 = hostUsesCaseSensitiveFileNames(host);
|
|
134947
|
+
const getCanonicalFileName = createGetCanonicalFileName(useCaseSensitiveFileNames2);
|
|
134915
134948
|
const oldToNew = getPathUpdater(oldFileOrDirPath, newFileOrDirPath, getCanonicalFileName, sourceMapper);
|
|
134916
134949
|
const newToOld = getPathUpdater(newFileOrDirPath, oldFileOrDirPath, getCanonicalFileName, sourceMapper);
|
|
134917
134950
|
return ts_textChanges_exports.ChangeTracker.with({ host, formatContext, preferences }, (changeTracker) => {
|
|
134918
|
-
updateTsconfigFiles(program, changeTracker, oldToNew, oldFileOrDirPath, newFileOrDirPath, host.getCurrentDirectory(),
|
|
134951
|
+
updateTsconfigFiles(program, changeTracker, oldToNew, oldFileOrDirPath, newFileOrDirPath, host.getCurrentDirectory(), useCaseSensitiveFileNames2);
|
|
134919
134952
|
updateImports(program, changeTracker, oldToNew, newToOld, host, getCanonicalFileName);
|
|
134920
134953
|
});
|
|
134921
134954
|
}
|
|
@@ -134937,7 +134970,7 @@ function makeCorrespondingRelativeChange(a0, b0, a1, getCanonicalFileName) {
|
|
|
134937
134970
|
const rel = getRelativePathFromFile(a0, b0, getCanonicalFileName);
|
|
134938
134971
|
return combinePathsSafe(getDirectoryPath(a1), rel);
|
|
134939
134972
|
}
|
|
134940
|
-
function updateTsconfigFiles(program, changeTracker, oldToNew, oldFileOrDirPath, newFileOrDirPath, currentDirectory,
|
|
134973
|
+
function updateTsconfigFiles(program, changeTracker, oldToNew, oldFileOrDirPath, newFileOrDirPath, currentDirectory, useCaseSensitiveFileNames2) {
|
|
134941
134974
|
const { configFile } = program.getCompilerOptions();
|
|
134942
134975
|
if (!configFile)
|
|
134943
134976
|
return;
|
|
@@ -134961,10 +134994,10 @@ function updateTsconfigFiles(program, changeTracker, oldToNew, oldFileOrDirPath,
|
|
|
134961
134994
|
/*excludes*/
|
|
134962
134995
|
[],
|
|
134963
134996
|
includes,
|
|
134964
|
-
|
|
134997
|
+
useCaseSensitiveFileNames2,
|
|
134965
134998
|
currentDirectory
|
|
134966
134999
|
);
|
|
134967
|
-
if (getRegexFromPattern(Debug.checkDefined(matchers.includeFilePattern),
|
|
135000
|
+
if (getRegexFromPattern(Debug.checkDefined(matchers.includeFilePattern), useCaseSensitiveFileNames2).test(oldFileOrDirPath) && !getRegexFromPattern(Debug.checkDefined(matchers.includeFilePattern), useCaseSensitiveFileNames2).test(newFileOrDirPath)) {
|
|
134968
135001
|
changeTracker.insertNodeAfter(configFile, last(property.initializer.elements), factory.createStringLiteral(relativePath(newFileOrDirPath)));
|
|
134969
135002
|
}
|
|
134970
135003
|
return;
|
|
@@ -135012,7 +135045,7 @@ function updateTsconfigFiles(program, changeTracker, oldToNew, oldFileOrDirPath,
|
|
|
135012
135045
|
configDir,
|
|
135013
135046
|
path,
|
|
135014
135047
|
/*ignoreCase*/
|
|
135015
|
-
!
|
|
135048
|
+
!useCaseSensitiveFileNames2
|
|
135016
135049
|
);
|
|
135017
135050
|
}
|
|
135018
135051
|
}
|
|
@@ -138292,7 +138325,7 @@ function getNewStatementsAndRemoveFromOldFile2(oldFile, targetFile, usage, chang
|
|
|
138292
138325
|
const body = addExports(oldFile, toMove.all, usage.oldFileImportsFromTargetFile, useEsModuleSyntax);
|
|
138293
138326
|
if (typeof targetFile !== "string") {
|
|
138294
138327
|
if (targetFile.statements.length > 0) {
|
|
138295
|
-
changes
|
|
138328
|
+
moveStatementsToTargetFile(changes, program, body, targetFile, toMove);
|
|
138296
138329
|
} else {
|
|
138297
138330
|
changes.insertNodesAtEndOfFile(
|
|
138298
138331
|
targetFile,
|
|
@@ -139085,6 +139118,67 @@ function isNonVariableTopLevelDeclaration(node) {
|
|
|
139085
139118
|
return false;
|
|
139086
139119
|
}
|
|
139087
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
|
+
}
|
|
139088
139182
|
function getOverloadRangeToMove(sourceFile, statement) {
|
|
139089
139183
|
if (isFunctionLikeDeclaration(statement)) {
|
|
139090
139184
|
const declarations = statement.symbol.declarations;
|
|
@@ -143550,10 +143644,10 @@ function createLanguageService(host, documentRegistry = createDocumentRegistry(h
|
|
|
143550
143644
|
host.log(message);
|
|
143551
143645
|
}
|
|
143552
143646
|
}
|
|
143553
|
-
const
|
|
143554
|
-
const getCanonicalFileName = createGetCanonicalFileName(
|
|
143647
|
+
const useCaseSensitiveFileNames2 = hostUsesCaseSensitiveFileNames(host);
|
|
143648
|
+
const getCanonicalFileName = createGetCanonicalFileName(useCaseSensitiveFileNames2);
|
|
143555
143649
|
const sourceMapper = getSourceMapper({
|
|
143556
|
-
useCaseSensitiveFileNames: () =>
|
|
143650
|
+
useCaseSensitiveFileNames: () => useCaseSensitiveFileNames2,
|
|
143557
143651
|
getCurrentDirectory: () => currentDirectory,
|
|
143558
143652
|
getProgram,
|
|
143559
143653
|
fileExists: maybeBind(host, host.fileExists),
|
|
@@ -143601,7 +143695,7 @@ function createLanguageService(host, documentRegistry = createDocumentRegistry(h
|
|
|
143601
143695
|
getSourceFileByPath: getOrCreateSourceFileByPath,
|
|
143602
143696
|
getCancellationToken: () => cancellationToken,
|
|
143603
143697
|
getCanonicalFileName,
|
|
143604
|
-
useCaseSensitiveFileNames: () =>
|
|
143698
|
+
useCaseSensitiveFileNames: () => useCaseSensitiveFileNames2,
|
|
143605
143699
|
getNewLine: () => getNewLineCharacter(newSettings),
|
|
143606
143700
|
getDefaultLibFileName: (options2) => host.getDefaultLibFileName(options2),
|
|
143607
143701
|
writeFile: noop,
|
|
@@ -143645,7 +143739,7 @@ function createLanguageService(host, documentRegistry = createDocumentRegistry(h
|
|
|
143645
143739
|
compilerHost.getSourceFile = getSourceFileWithCache;
|
|
143646
143740
|
(_c = host.setCompilerHost) == null ? void 0 : _c.call(host, compilerHost);
|
|
143647
143741
|
const parseConfigHost = {
|
|
143648
|
-
useCaseSensitiveFileNames,
|
|
143742
|
+
useCaseSensitiveFileNames: useCaseSensitiveFileNames2,
|
|
143649
143743
|
fileExists: (fileName) => compilerHost.fileExists(fileName),
|
|
143650
143744
|
readFile: (fileName) => compilerHost.readFile(fileName),
|
|
143651
143745
|
readDirectory: (...args) => compilerHost.readDirectory(...args),
|
|
@@ -167028,6 +167122,10 @@ function getSymbolKindOfConstructorPropertyMethodAccessorFunctionOrVar(typeCheck
|
|
|
167028
167122
|
return "parameter" /* parameterElement */;
|
|
167029
167123
|
} else if (symbol.valueDeclaration && isVarConst(symbol.valueDeclaration)) {
|
|
167030
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 */;
|
|
167031
167129
|
} else if (forEach(symbol.declarations, isLet)) {
|
|
167032
167130
|
return "let" /* letElement */;
|
|
167033
167131
|
}
|
|
@@ -167421,7 +167519,7 @@ function getSymbolDisplayPartsDocumentationAndSymbolKind(typeChecker, symbol, so
|
|
|
167421
167519
|
} else {
|
|
167422
167520
|
addPrefixForAnyFunctionOrVar(symbol, symbolKind);
|
|
167423
167521
|
}
|
|
167424
|
-
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) {
|
|
167425
167523
|
displayParts.push(punctuationPart(59 /* ColonToken */));
|
|
167426
167524
|
displayParts.push(spacePart());
|
|
167427
167525
|
if (type.symbol && type.symbol.flags & 262144 /* TypeParameter */ && symbolKind !== "index" /* indexSignatureElement */) {
|
|
@@ -167571,6 +167669,8 @@ function getSymbolDisplayPartsDocumentationAndSymbolKind(typeChecker, symbol, so
|
|
|
167571
167669
|
case "let" /* letElement */:
|
|
167572
167670
|
case "const" /* constElement */:
|
|
167573
167671
|
case "constructor" /* constructorImplementationElement */:
|
|
167672
|
+
case "using" /* variableUsingElement */:
|
|
167673
|
+
case "await using" /* variableAwaitUsingElement */:
|
|
167574
167674
|
displayParts.push(textOrKeywordPart(symbolKind2));
|
|
167575
167675
|
return;
|
|
167576
167676
|
default:
|
|
@@ -167955,6 +168055,9 @@ var ChangeTracker = class _ChangeTracker {
|
|
|
167955
168055
|
insertNodeBefore(sourceFile, before, newNode, blankLineBetween = false, options = {}) {
|
|
167956
168056
|
this.insertNodeAt(sourceFile, getAdjustedStartPosition(sourceFile, before, options), newNode, this.getOptionsForInsertNodeBefore(before, newNode, blankLineBetween));
|
|
167957
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
|
+
}
|
|
167958
168061
|
insertModifierAt(sourceFile, pos, modifier, options = {}) {
|
|
167959
168062
|
this.insertNodeAt(sourceFile, pos, factory.createToken(modifier), options);
|
|
167960
168063
|
}
|
|
@@ -177124,7 +177227,7 @@ var Project3 = class _Project {
|
|
|
177124
177227
|
return this.projectService.includePackageJsonAutoImports();
|
|
177125
177228
|
}
|
|
177126
177229
|
/** @internal */
|
|
177127
|
-
|
|
177230
|
+
getHostForAutoImportProvider() {
|
|
177128
177231
|
var _a, _b;
|
|
177129
177232
|
if (this.program) {
|
|
177130
177233
|
return {
|
|
@@ -177135,7 +177238,8 @@ var Project3 = class _Project {
|
|
|
177135
177238
|
readFile: this.projectService.host.readFile.bind(this.projectService.host),
|
|
177136
177239
|
getDirectories: this.projectService.host.getDirectories.bind(this.projectService.host),
|
|
177137
177240
|
trace: (_b = this.projectService.host.trace) == null ? void 0 : _b.bind(this.projectService.host),
|
|
177138
|
-
useCaseSensitiveFileNames: this.program.useCaseSensitiveFileNames()
|
|
177241
|
+
useCaseSensitiveFileNames: this.program.useCaseSensitiveFileNames(),
|
|
177242
|
+
readDirectory: this.projectService.host.readDirectory.bind(this.projectService.host)
|
|
177139
177243
|
};
|
|
177140
177244
|
}
|
|
177141
177245
|
return this.projectService.host;
|
|
@@ -177163,7 +177267,7 @@ var Project3 = class _Project {
|
|
|
177163
177267
|
if (dependencySelection) {
|
|
177164
177268
|
(_a = tracing) == null ? void 0 : _a.push(tracing.Phase.Session, "getPackageJsonAutoImportProvider");
|
|
177165
177269
|
const start2 = timestamp();
|
|
177166
|
-
this.autoImportProviderHost = AutoImportProviderProject.create(dependencySelection, this, this.
|
|
177270
|
+
this.autoImportProviderHost = AutoImportProviderProject.create(dependencySelection, this, this.getHostForAutoImportProvider(), this.documentRegistry);
|
|
177167
177271
|
if (this.autoImportProviderHost) {
|
|
177168
177272
|
updateProjectIfDirty(this.autoImportProviderHost);
|
|
177169
177273
|
this.sendPerformanceEvent("CreatePackageJsonAutoImportProvider", timestamp() - start2);
|
|
@@ -177401,7 +177505,7 @@ var _AutoImportProviderProject = class _AutoImportProviderProject extends Projec
|
|
|
177401
177505
|
this.getParsedCommandLine = maybeBind(this.hostProject, this.hostProject.getParsedCommandLine);
|
|
177402
177506
|
}
|
|
177403
177507
|
/** @internal */
|
|
177404
|
-
static getRootFileNames(dependencySelection, hostProject,
|
|
177508
|
+
static getRootFileNames(dependencySelection, hostProject, host, compilerOptions) {
|
|
177405
177509
|
var _a, _b;
|
|
177406
177510
|
if (!dependencySelection) {
|
|
177407
177511
|
return emptyArray;
|
|
@@ -177431,7 +177535,7 @@ var _AutoImportProviderProject = class _AutoImportProviderProject extends Projec
|
|
|
177431
177535
|
name,
|
|
177432
177536
|
hostProject.currentDirectory,
|
|
177433
177537
|
compilerOptions,
|
|
177434
|
-
|
|
177538
|
+
host,
|
|
177435
177539
|
program.getModuleResolutionCache()
|
|
177436
177540
|
);
|
|
177437
177541
|
if (packageJson) {
|
|
@@ -177448,7 +177552,7 @@ var _AutoImportProviderProject = class _AutoImportProviderProject extends Projec
|
|
|
177448
177552
|
`@types/${name}`,
|
|
177449
177553
|
directory,
|
|
177450
177554
|
compilerOptions,
|
|
177451
|
-
|
|
177555
|
+
host,
|
|
177452
177556
|
program.getModuleResolutionCache()
|
|
177453
177557
|
);
|
|
177454
177558
|
if (typesPackageJson) {
|
|
@@ -177488,12 +177592,12 @@ var _AutoImportProviderProject = class _AutoImportProviderProject extends Projec
|
|
|
177488
177592
|
const entrypoints = getEntrypointsFromPackageJsonInfo(
|
|
177489
177593
|
packageJson,
|
|
177490
177594
|
compilerOptions,
|
|
177491
|
-
|
|
177595
|
+
host,
|
|
177492
177596
|
program2.getModuleResolutionCache(),
|
|
177493
177597
|
resolveJs
|
|
177494
177598
|
);
|
|
177495
177599
|
if (entrypoints) {
|
|
177496
|
-
const real = (_a2 =
|
|
177600
|
+
const real = (_a2 = host.realpath) == null ? void 0 : _a2.call(host, packageJson.packageDirectory);
|
|
177497
177601
|
const isSymlink = real && real !== packageJson.packageDirectory;
|
|
177498
177602
|
if (isSymlink) {
|
|
177499
177603
|
symlinkCache.setSymlinkedDirectory(packageJson.packageDirectory, {
|
|
@@ -177511,7 +177615,7 @@ var _AutoImportProviderProject = class _AutoImportProviderProject extends Projec
|
|
|
177511
177615
|
}
|
|
177512
177616
|
}
|
|
177513
177617
|
/** @internal */
|
|
177514
|
-
static create(dependencySelection, hostProject,
|
|
177618
|
+
static create(dependencySelection, hostProject, host, documentRegistry) {
|
|
177515
177619
|
if (dependencySelection === 0 /* Off */) {
|
|
177516
177620
|
return void 0;
|
|
177517
177621
|
}
|
|
@@ -177519,7 +177623,7 @@ var _AutoImportProviderProject = class _AutoImportProviderProject extends Projec
|
|
|
177519
177623
|
...hostProject.getCompilerOptions(),
|
|
177520
177624
|
...this.compilerOptionsOverrides
|
|
177521
177625
|
};
|
|
177522
|
-
const rootNames = this.getRootFileNames(dependencySelection, hostProject,
|
|
177626
|
+
const rootNames = this.getRootFileNames(dependencySelection, hostProject, host, compilerOptions);
|
|
177523
177627
|
if (!rootNames.length) {
|
|
177524
177628
|
return void 0;
|
|
177525
177629
|
}
|
|
@@ -177538,7 +177642,7 @@ var _AutoImportProviderProject = class _AutoImportProviderProject extends Projec
|
|
|
177538
177642
|
rootFileNames = _AutoImportProviderProject.getRootFileNames(
|
|
177539
177643
|
this.hostProject.includePackageJsonAutoImports(),
|
|
177540
177644
|
this.hostProject,
|
|
177541
|
-
this.hostProject.
|
|
177645
|
+
this.hostProject.getHostForAutoImportProvider(),
|
|
177542
177646
|
this.getCompilationSettings()
|
|
177543
177647
|
);
|
|
177544
177648
|
}
|
|
@@ -177577,7 +177681,7 @@ var _AutoImportProviderProject = class _AutoImportProviderProject extends Projec
|
|
|
177577
177681
|
onPackageJsonChange() {
|
|
177578
177682
|
throw new Error("package.json changes should be notified on an AutoImportProvider's host project");
|
|
177579
177683
|
}
|
|
177580
|
-
|
|
177684
|
+
getHostForAutoImportProvider() {
|
|
177581
177685
|
throw new Error("AutoImportProviderProject cannot provide its own host; use `hostProject.getModuleResolutionHostForAutomImportProvider()` instead.");
|
|
177582
177686
|
}
|
|
177583
177687
|
getProjectReferences() {
|