@typescript-deploys/pr-build 5.2.0-pr-54718-7 → 5.2.0-pr-54922-6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/tsc.js +150 -115
- package/lib/tsserver.js +323 -172
- package/lib/tsserverlibrary.d.ts +2 -2
- package/lib/tsserverlibrary.js +323 -172
- package/lib/typescript.d.ts +1 -1
- package/lib/typescript.js +310 -160
- package/lib/typingsInstaller.js +83 -74
- package/package.json +2 -2
package/lib/tsc.js
CHANGED
|
@@ -18,7 +18,7 @@ and limitations under the License.
|
|
|
18
18
|
|
|
19
19
|
// src/compiler/corePublic.ts
|
|
20
20
|
var versionMajorMinor = "5.2";
|
|
21
|
-
var version = `${versionMajorMinor}.0-insiders.
|
|
21
|
+
var version = `${versionMajorMinor}.0-insiders.20230707`;
|
|
22
22
|
|
|
23
23
|
// src/compiler/core.ts
|
|
24
24
|
var emptyArray = [];
|
|
@@ -1145,8 +1145,8 @@ function unorderedRemoveFirstItemWhere(array, predicate) {
|
|
|
1145
1145
|
}
|
|
1146
1146
|
return false;
|
|
1147
1147
|
}
|
|
1148
|
-
function createGetCanonicalFileName(
|
|
1149
|
-
return
|
|
1148
|
+
function createGetCanonicalFileName(useCaseSensitiveFileNames2) {
|
|
1149
|
+
return useCaseSensitiveFileNames2 ? identity : toFileNameLowerCase;
|
|
1150
1150
|
}
|
|
1151
1151
|
function patternText({ prefix, suffix }) {
|
|
1152
1152
|
return `${prefix}*${suffix}`;
|
|
@@ -4173,10 +4173,10 @@ function createDynamicPriorityPollingWatchFile(host) {
|
|
|
4173
4173
|
pollingIntervalQueue(pollingInterval).pollScheduled = host.setTimeout(pollingInterval === 250 /* Low */ ? pollLowPollingIntervalQueue : pollPollingIntervalQueue, pollingInterval, pollingInterval === 250 /* Low */ ? "pollLowPollingIntervalQueue" : "pollPollingIntervalQueue", pollingIntervalQueue(pollingInterval));
|
|
4174
4174
|
}
|
|
4175
4175
|
}
|
|
4176
|
-
function createUseFsEventsOnParentDirectoryWatchFile(fsWatch,
|
|
4176
|
+
function createUseFsEventsOnParentDirectoryWatchFile(fsWatch, useCaseSensitiveFileNames2) {
|
|
4177
4177
|
const fileWatcherCallbacks = createMultiMap();
|
|
4178
4178
|
const dirWatchers = /* @__PURE__ */ new Map();
|
|
4179
|
-
const toCanonicalName = createGetCanonicalFileName(
|
|
4179
|
+
const toCanonicalName = createGetCanonicalFileName(useCaseSensitiveFileNames2);
|
|
4180
4180
|
return nonPollingWatchFile;
|
|
4181
4181
|
function nonPollingWatchFile(fileName, callback, _pollingInterval, fallbackOptions) {
|
|
4182
4182
|
const filePath = toCanonicalName(fileName);
|
|
@@ -4252,8 +4252,8 @@ function createFixedChunkSizePollingWatchFile(host) {
|
|
|
4252
4252
|
pollScheduled = host.setTimeout(pollQueue, 2e3 /* High */, "pollQueue");
|
|
4253
4253
|
}
|
|
4254
4254
|
}
|
|
4255
|
-
function createSingleWatcherPerName(cache,
|
|
4256
|
-
const toCanonicalFileName = createGetCanonicalFileName(
|
|
4255
|
+
function createSingleWatcherPerName(cache, useCaseSensitiveFileNames2, name, callback, createWatcher) {
|
|
4256
|
+
const toCanonicalFileName = createGetCanonicalFileName(useCaseSensitiveFileNames2);
|
|
4257
4257
|
const path = toCanonicalFileName(name);
|
|
4258
4258
|
const existing = cache.get(path);
|
|
4259
4259
|
if (existing) {
|
|
@@ -4305,7 +4305,7 @@ function setSysLog(logger) {
|
|
|
4305
4305
|
}
|
|
4306
4306
|
function createDirectoryWatcherSupportingRecursive({
|
|
4307
4307
|
watchDirectory,
|
|
4308
|
-
useCaseSensitiveFileNames,
|
|
4308
|
+
useCaseSensitiveFileNames: useCaseSensitiveFileNames2,
|
|
4309
4309
|
getCurrentDirectory,
|
|
4310
4310
|
getAccessibleSortedChildDirectories,
|
|
4311
4311
|
fileSystemEntryExists,
|
|
@@ -4317,8 +4317,8 @@ function createDirectoryWatcherSupportingRecursive({
|
|
|
4317
4317
|
const callbackCache = createMultiMap();
|
|
4318
4318
|
const cacheToUpdateChildWatches = /* @__PURE__ */ new Map();
|
|
4319
4319
|
let timerToUpdateChildWatches;
|
|
4320
|
-
const filePathComparer = getStringComparer(!
|
|
4321
|
-
const toCanonicalFilePath = createGetCanonicalFileName(
|
|
4320
|
+
const filePathComparer = getStringComparer(!useCaseSensitiveFileNames2);
|
|
4321
|
+
const toCanonicalFilePath = createGetCanonicalFileName(useCaseSensitiveFileNames2);
|
|
4322
4322
|
return (dirName, callback, recursive, options) => recursive ? createDirectoryWatcher(dirName, options, callback) : watchDirectory(dirName, callback, recursive, options);
|
|
4323
4323
|
function createDirectoryWatcher(dirName, options, callback) {
|
|
4324
4324
|
const dirPath = toCanonicalFilePath(dirName);
|
|
@@ -4485,12 +4485,12 @@ function createDirectoryWatcherSupportingRecursive({
|
|
|
4485
4485
|
}
|
|
4486
4486
|
}
|
|
4487
4487
|
function isIgnoredPath(path, options) {
|
|
4488
|
-
return some(ignoredPaths, (searchPath) => isInPath(path, searchPath)) || isIgnoredByWatchOptions(path, options,
|
|
4488
|
+
return some(ignoredPaths, (searchPath) => isInPath(path, searchPath)) || isIgnoredByWatchOptions(path, options, useCaseSensitiveFileNames2, getCurrentDirectory);
|
|
4489
4489
|
}
|
|
4490
4490
|
function isInPath(path, searchPath) {
|
|
4491
4491
|
if (stringContains(path, searchPath))
|
|
4492
4492
|
return true;
|
|
4493
|
-
if (
|
|
4493
|
+
if (useCaseSensitiveFileNames2)
|
|
4494
4494
|
return false;
|
|
4495
4495
|
return stringContains(toCanonicalFilePath(path), searchPath);
|
|
4496
4496
|
}
|
|
@@ -4508,14 +4508,14 @@ function createFsWatchCallbackForFileWatcherCallback(fileName, callback, getModi
|
|
|
4508
4508
|
}
|
|
4509
4509
|
};
|
|
4510
4510
|
}
|
|
4511
|
-
function isIgnoredByWatchOptions(pathToCheck, options,
|
|
4512
|
-
return ((options == null ? void 0 : options.excludeDirectories) || (options == null ? void 0 : options.excludeFiles)) && (matchesExclude(pathToCheck, options == null ? void 0 : options.excludeFiles,
|
|
4511
|
+
function isIgnoredByWatchOptions(pathToCheck, options, useCaseSensitiveFileNames2, getCurrentDirectory) {
|
|
4512
|
+
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()));
|
|
4513
4513
|
}
|
|
4514
|
-
function createFsWatchCallbackForDirectoryWatcherCallback(directoryName, callback, options,
|
|
4514
|
+
function createFsWatchCallbackForDirectoryWatcherCallback(directoryName, callback, options, useCaseSensitiveFileNames2, getCurrentDirectory) {
|
|
4515
4515
|
return (eventName, relativeFileName) => {
|
|
4516
4516
|
if (eventName === "rename") {
|
|
4517
4517
|
const fileName = !relativeFileName ? directoryName : normalizePath(combinePaths(directoryName, relativeFileName));
|
|
4518
|
-
if (!relativeFileName || !isIgnoredByWatchOptions(fileName, options,
|
|
4518
|
+
if (!relativeFileName || !isIgnoredByWatchOptions(fileName, options, useCaseSensitiveFileNames2, getCurrentDirectory)) {
|
|
4519
4519
|
callback(fileName);
|
|
4520
4520
|
}
|
|
4521
4521
|
}
|
|
@@ -4528,7 +4528,7 @@ function createSystemWatchFunctions({
|
|
|
4528
4528
|
clearTimeout: clearTimeout2,
|
|
4529
4529
|
fsWatchWorker,
|
|
4530
4530
|
fileSystemEntryExists,
|
|
4531
|
-
useCaseSensitiveFileNames,
|
|
4531
|
+
useCaseSensitiveFileNames: useCaseSensitiveFileNames2,
|
|
4532
4532
|
getCurrentDirectory,
|
|
4533
4533
|
fsSupportsRecursiveFsWatch,
|
|
4534
4534
|
getAccessibleSortedChildDirectories,
|
|
@@ -4600,7 +4600,7 @@ function createSystemWatchFunctions({
|
|
|
4600
4600
|
);
|
|
4601
4601
|
case 5 /* UseFsEventsOnParentDirectory */:
|
|
4602
4602
|
if (!nonPollingWatchFile) {
|
|
4603
|
-
nonPollingWatchFile = createUseFsEventsOnParentDirectoryWatchFile(fsWatch,
|
|
4603
|
+
nonPollingWatchFile = createUseFsEventsOnParentDirectoryWatchFile(fsWatch, useCaseSensitiveFileNames2);
|
|
4604
4604
|
}
|
|
4605
4605
|
return nonPollingWatchFile(fileName, callback, pollingInterval, getFallbackOptions(options));
|
|
4606
4606
|
default:
|
|
@@ -4649,7 +4649,7 @@ function createSystemWatchFunctions({
|
|
|
4649
4649
|
return fsWatch(
|
|
4650
4650
|
directoryName,
|
|
4651
4651
|
1 /* Directory */,
|
|
4652
|
-
createFsWatchCallbackForDirectoryWatcherCallback(directoryName, callback, options,
|
|
4652
|
+
createFsWatchCallbackForDirectoryWatcherCallback(directoryName, callback, options, useCaseSensitiveFileNames2, getCurrentDirectory),
|
|
4653
4653
|
recursive,
|
|
4654
4654
|
500 /* Medium */,
|
|
4655
4655
|
getFallbackOptions(options)
|
|
@@ -4657,7 +4657,7 @@ function createSystemWatchFunctions({
|
|
|
4657
4657
|
}
|
|
4658
4658
|
if (!hostRecursiveDirectoryWatcher) {
|
|
4659
4659
|
hostRecursiveDirectoryWatcher = createDirectoryWatcherSupportingRecursive({
|
|
4660
|
-
useCaseSensitiveFileNames,
|
|
4660
|
+
useCaseSensitiveFileNames: useCaseSensitiveFileNames2,
|
|
4661
4661
|
getCurrentDirectory,
|
|
4662
4662
|
fileSystemEntryExists,
|
|
4663
4663
|
getAccessibleSortedChildDirectories,
|
|
@@ -4703,7 +4703,7 @@ function createSystemWatchFunctions({
|
|
|
4703
4703
|
return fsWatch(
|
|
4704
4704
|
directoryName,
|
|
4705
4705
|
1 /* Directory */,
|
|
4706
|
-
createFsWatchCallbackForDirectoryWatcherCallback(directoryName, callback, options,
|
|
4706
|
+
createFsWatchCallbackForDirectoryWatcherCallback(directoryName, callback, options, useCaseSensitiveFileNames2, getCurrentDirectory),
|
|
4707
4707
|
recursive,
|
|
4708
4708
|
500 /* Medium */,
|
|
4709
4709
|
getFallbackOptions(watchDirectoryOptions)
|
|
@@ -4731,7 +4731,7 @@ function createSystemWatchFunctions({
|
|
|
4731
4731
|
function pollingWatchFile(fileName, callback, pollingInterval, options) {
|
|
4732
4732
|
return createSingleWatcherPerName(
|
|
4733
4733
|
pollingWatches,
|
|
4734
|
-
|
|
4734
|
+
useCaseSensitiveFileNames2,
|
|
4735
4735
|
fileName,
|
|
4736
4736
|
callback,
|
|
4737
4737
|
(cb) => pollingWatchFileWorker(fileName, cb, pollingInterval, options)
|
|
@@ -4740,7 +4740,7 @@ function createSystemWatchFunctions({
|
|
|
4740
4740
|
function fsWatch(fileOrDirectory, entryKind, callback, recursive, fallbackPollingInterval, fallbackOptions) {
|
|
4741
4741
|
return createSingleWatcherPerName(
|
|
4742
4742
|
recursive ? fsWatchesRecursive : fsWatches,
|
|
4743
|
-
|
|
4743
|
+
useCaseSensitiveFileNames2,
|
|
4744
4744
|
fileOrDirectory,
|
|
4745
4745
|
callback,
|
|
4746
4746
|
(cb) => fsWatchHandlingExistenceOnHost(fileOrDirectory, entryKind, cb, recursive, fallbackPollingInterval, fallbackOptions)
|
|
@@ -4868,7 +4868,7 @@ var sys = (() => {
|
|
|
4868
4868
|
const Buffer = require("buffer").Buffer;
|
|
4869
4869
|
const isLinuxOrMacOs = process.platform === "linux" || process.platform === "darwin";
|
|
4870
4870
|
const platform = _os.platform();
|
|
4871
|
-
const
|
|
4871
|
+
const useCaseSensitiveFileNames2 = isFileSystemCaseSensitive();
|
|
4872
4872
|
const fsRealpath = !!_fs.realpathSync.native ? process.platform === "win32" ? fsRealPathHandlingLongPath : _fs.realpathSync.native : _fs.realpathSync;
|
|
4873
4873
|
const executingFilePath = __filename.endsWith("sys.js") ? _path.join(_path.dirname(__dirname), "__fake__.js") : __filename;
|
|
4874
4874
|
const fsSupportsRecursiveFsWatch = process.platform === "win32" || process.platform === "darwin";
|
|
@@ -4879,7 +4879,7 @@ var sys = (() => {
|
|
|
4879
4879
|
setTimeout,
|
|
4880
4880
|
clearTimeout,
|
|
4881
4881
|
fsWatchWorker,
|
|
4882
|
-
useCaseSensitiveFileNames,
|
|
4882
|
+
useCaseSensitiveFileNames: useCaseSensitiveFileNames2,
|
|
4883
4883
|
getCurrentDirectory,
|
|
4884
4884
|
fileSystemEntryExists,
|
|
4885
4885
|
// Node 4.0 `fs.watch` function supports the "recursive" option on both OSX and Windows
|
|
@@ -4896,7 +4896,7 @@ var sys = (() => {
|
|
|
4896
4896
|
const nodeSystem = {
|
|
4897
4897
|
args: process.argv.slice(2),
|
|
4898
4898
|
newLine: _os.EOL,
|
|
4899
|
-
useCaseSensitiveFileNames,
|
|
4899
|
+
useCaseSensitiveFileNames: useCaseSensitiveFileNames2,
|
|
4900
4900
|
write(s) {
|
|
4901
4901
|
process.stdout.write(s);
|
|
4902
4902
|
},
|
|
@@ -5025,12 +5025,12 @@ var sys = (() => {
|
|
|
5025
5025
|
for (const node of profile.nodes) {
|
|
5026
5026
|
if (node.callFrame.url) {
|
|
5027
5027
|
const url = normalizeSlashes(node.callFrame.url);
|
|
5028
|
-
if (containsPath(fileUrlRoot, url,
|
|
5028
|
+
if (containsPath(fileUrlRoot, url, useCaseSensitiveFileNames2)) {
|
|
5029
5029
|
node.callFrame.url = getRelativePathToDirectoryOrUrl(
|
|
5030
5030
|
fileUrlRoot,
|
|
5031
5031
|
url,
|
|
5032
5032
|
fileUrlRoot,
|
|
5033
|
-
createGetCanonicalFileName(
|
|
5033
|
+
createGetCanonicalFileName(useCaseSensitiveFileNames2),
|
|
5034
5034
|
/*isAbsolutePathAnUrl*/
|
|
5035
5035
|
true
|
|
5036
5036
|
);
|
|
@@ -5210,7 +5210,7 @@ var sys = (() => {
|
|
|
5210
5210
|
}
|
|
5211
5211
|
}
|
|
5212
5212
|
function readDirectory(path, extensions, excludes, includes, depth) {
|
|
5213
|
-
return matchFiles(path, extensions, excludes, includes,
|
|
5213
|
+
return matchFiles(path, extensions, excludes, includes, useCaseSensitiveFileNames2, process.cwd(), depth, getAccessibleFileSystemEntries, realpath);
|
|
5214
5214
|
}
|
|
5215
5215
|
function fileSystemEntryExists(path, entryKind) {
|
|
5216
5216
|
const originalStackTraceLimit = Error.stackTraceLimit;
|
|
@@ -7465,6 +7465,7 @@ var Diagnostics = {
|
|
|
7465
7465
|
Parameter_modifiers_can_only_be_used_in_TypeScript_files: diag(8012, 1 /* Error */, "Parameter_modifiers_can_only_be_used_in_TypeScript_files_8012", "Parameter modifiers can only be used in TypeScript files."),
|
|
7466
7466
|
Non_null_assertions_can_only_be_used_in_TypeScript_files: diag(8013, 1 /* Error */, "Non_null_assertions_can_only_be_used_in_TypeScript_files_8013", "Non-null assertions can only be used in TypeScript files."),
|
|
7467
7467
|
Type_assertion_expressions_can_only_be_used_in_TypeScript_files: diag(8016, 1 /* Error */, "Type_assertion_expressions_can_only_be_used_in_TypeScript_files_8016", "Type assertion expressions can only be used in TypeScript files."),
|
|
7468
|
+
Signature_declarations_can_only_be_used_in_TypeScript_files: diag(8017, 1 /* Error */, "Signature_declarations_can_only_be_used_in_TypeScript_files_8017", "Signature declarations can only be used in TypeScript files."),
|
|
7468
7469
|
Report_errors_in_js_files: diag(8019, 3 /* Message */, "Report_errors_in_js_files_8019", "Report errors in .js files."),
|
|
7469
7470
|
JSDoc_types_can_only_be_used_inside_documentation_comments: diag(8020, 1 /* Error */, "JSDoc_types_can_only_be_used_inside_documentation_comments_8020", "JSDoc types can only be used inside documentation comments."),
|
|
7470
7471
|
JSDoc_typedef_tag_should_either_have_a_type_annotation_or_be_followed_by_property_or_member_tags: diag(8021, 1 /* Error */, "JSDoc_typedef_tag_should_either_have_a_type_annotation_or_be_followed_by_property_or_member_tags_8021", "JSDoc '@typedef' tag should either have a type annotation or be followed by '@property' or '@member' tags."),
|
|
@@ -8572,7 +8573,7 @@ function createScanner(languageVersion, skipTrivia2, languageVariant = 0 /* Stan
|
|
|
8572
8573
|
if (withMinus)
|
|
8573
8574
|
start2--;
|
|
8574
8575
|
error(Diagnostics.Octal_literals_are_not_allowed_Use_the_syntax_0, start2, pos - start2, literal);
|
|
8575
|
-
return
|
|
8576
|
+
return 9 /* NumericLiteral */;
|
|
8576
8577
|
}
|
|
8577
8578
|
} else {
|
|
8578
8579
|
mainFragment = scanNumberFragment();
|
|
@@ -8612,20 +8613,18 @@ function createScanner(languageVersion, skipTrivia2, languageVariant = 0 /* Stan
|
|
|
8612
8613
|
}
|
|
8613
8614
|
if (tokenFlags & 8192 /* ContainsLeadingZero */) {
|
|
8614
8615
|
error(Diagnostics.Decimals_with_leading_zeros_are_not_allowed, start2, end2 - start2);
|
|
8615
|
-
|
|
8616
|
+
tokenValue = "" + +result;
|
|
8617
|
+
return 9 /* NumericLiteral */;
|
|
8616
8618
|
}
|
|
8617
8619
|
if (decimalFragment !== void 0 || tokenFlags & 16 /* Scientific */) {
|
|
8618
8620
|
checkForIdentifierStartAfterNumericLiteral(start2, decimalFragment === void 0 && !!(tokenFlags & 16 /* Scientific */));
|
|
8619
|
-
|
|
8620
|
-
|
|
8621
|
-
value: "" + +result
|
|
8622
|
-
// if value is not an integer, it can be safely coerced to a number
|
|
8623
|
-
};
|
|
8621
|
+
tokenValue = "" + +result;
|
|
8622
|
+
return 9 /* NumericLiteral */;
|
|
8624
8623
|
} else {
|
|
8625
8624
|
tokenValue = result;
|
|
8626
8625
|
const type = checkBigIntSuffix();
|
|
8627
8626
|
checkForIdentifierStartAfterNumericLiteral(start2);
|
|
8628
|
-
return
|
|
8627
|
+
return type;
|
|
8629
8628
|
}
|
|
8630
8629
|
}
|
|
8631
8630
|
function checkForIdentifierStartAfterNumericLiteral(numericStart, isScientific) {
|
|
@@ -9234,7 +9233,7 @@ function createScanner(languageVersion, skipTrivia2, languageVariant = 0 /* Stan
|
|
|
9234
9233
|
return token = 41 /* MinusToken */;
|
|
9235
9234
|
case 46 /* dot */:
|
|
9236
9235
|
if (isDigit(text.charCodeAt(pos + 1))) {
|
|
9237
|
-
|
|
9236
|
+
scanNumber();
|
|
9238
9237
|
return token = 9 /* NumericLiteral */;
|
|
9239
9238
|
}
|
|
9240
9239
|
if (text.charCodeAt(pos + 1) === 46 /* dot */ && text.charCodeAt(pos + 2) === 46 /* dot */) {
|
|
@@ -9352,8 +9351,7 @@ function createScanner(languageVersion, skipTrivia2, languageVariant = 0 /* Stan
|
|
|
9352
9351
|
case 55 /* _7 */:
|
|
9353
9352
|
case 56 /* _8 */:
|
|
9354
9353
|
case 57 /* _9 */:
|
|
9355
|
-
|
|
9356
|
-
return token;
|
|
9354
|
+
return token = scanNumber();
|
|
9357
9355
|
case 58 /* colon */:
|
|
9358
9356
|
pos++;
|
|
9359
9357
|
return token = 59 /* ColonToken */;
|
|
@@ -16591,7 +16589,7 @@ function getSubPatternFromSpec(spec, basePath, usage, { singleAsteriskRegexFragm
|
|
|
16591
16589
|
function replaceWildcardCharacter(match, singleAsteriskRegexFragment) {
|
|
16592
16590
|
return match === "*" ? singleAsteriskRegexFragment : match === "?" ? "[^/]" : "\\" + match;
|
|
16593
16591
|
}
|
|
16594
|
-
function getFileMatcherPatterns(path, excludes, includes,
|
|
16592
|
+
function getFileMatcherPatterns(path, excludes, includes, useCaseSensitiveFileNames2, currentDirectory) {
|
|
16595
16593
|
path = normalizePath(path);
|
|
16596
16594
|
currentDirectory = normalizePath(currentDirectory);
|
|
16597
16595
|
const absolutePath = combinePaths(currentDirectory, path);
|
|
@@ -16600,22 +16598,22 @@ function getFileMatcherPatterns(path, excludes, includes, useCaseSensitiveFileNa
|
|
|
16600
16598
|
includeFilePattern: getRegularExpressionForWildcard(includes, absolutePath, "files"),
|
|
16601
16599
|
includeDirectoryPattern: getRegularExpressionForWildcard(includes, absolutePath, "directories"),
|
|
16602
16600
|
excludePattern: getRegularExpressionForWildcard(excludes, absolutePath, "exclude"),
|
|
16603
|
-
basePaths: getBasePaths(path, includes,
|
|
16601
|
+
basePaths: getBasePaths(path, includes, useCaseSensitiveFileNames2)
|
|
16604
16602
|
};
|
|
16605
16603
|
}
|
|
16606
|
-
function getRegexFromPattern(pattern,
|
|
16607
|
-
return new RegExp(pattern,
|
|
16604
|
+
function getRegexFromPattern(pattern, useCaseSensitiveFileNames2) {
|
|
16605
|
+
return new RegExp(pattern, useCaseSensitiveFileNames2 ? "" : "i");
|
|
16608
16606
|
}
|
|
16609
|
-
function matchFiles(path, extensions, excludes, includes,
|
|
16607
|
+
function matchFiles(path, extensions, excludes, includes, useCaseSensitiveFileNames2, currentDirectory, depth, getFileSystemEntries, realpath) {
|
|
16610
16608
|
path = normalizePath(path);
|
|
16611
16609
|
currentDirectory = normalizePath(currentDirectory);
|
|
16612
|
-
const patterns = getFileMatcherPatterns(path, excludes, includes,
|
|
16613
|
-
const includeFileRegexes = patterns.includeFilePatterns && patterns.includeFilePatterns.map((pattern) => getRegexFromPattern(pattern,
|
|
16614
|
-
const includeDirectoryRegex = patterns.includeDirectoryPattern && getRegexFromPattern(patterns.includeDirectoryPattern,
|
|
16615
|
-
const excludeRegex = patterns.excludePattern && getRegexFromPattern(patterns.excludePattern,
|
|
16610
|
+
const patterns = getFileMatcherPatterns(path, excludes, includes, useCaseSensitiveFileNames2, currentDirectory);
|
|
16611
|
+
const includeFileRegexes = patterns.includeFilePatterns && patterns.includeFilePatterns.map((pattern) => getRegexFromPattern(pattern, useCaseSensitiveFileNames2));
|
|
16612
|
+
const includeDirectoryRegex = patterns.includeDirectoryPattern && getRegexFromPattern(patterns.includeDirectoryPattern, useCaseSensitiveFileNames2);
|
|
16613
|
+
const excludeRegex = patterns.excludePattern && getRegexFromPattern(patterns.excludePattern, useCaseSensitiveFileNames2);
|
|
16616
16614
|
const results = includeFileRegexes ? includeFileRegexes.map(() => []) : [[]];
|
|
16617
16615
|
const visited = /* @__PURE__ */ new Map();
|
|
16618
|
-
const toCanonical = createGetCanonicalFileName(
|
|
16616
|
+
const toCanonical = createGetCanonicalFileName(useCaseSensitiveFileNames2);
|
|
16619
16617
|
for (const basePath of patterns.basePaths) {
|
|
16620
16618
|
visitDirectory(basePath, combinePaths(currentDirectory, basePath), depth);
|
|
16621
16619
|
}
|
|
@@ -16657,7 +16655,7 @@ function matchFiles(path, extensions, excludes, includes, useCaseSensitiveFileNa
|
|
|
16657
16655
|
}
|
|
16658
16656
|
}
|
|
16659
16657
|
}
|
|
16660
|
-
function getBasePaths(path, includes,
|
|
16658
|
+
function getBasePaths(path, includes, useCaseSensitiveFileNames2) {
|
|
16661
16659
|
const basePaths = [path];
|
|
16662
16660
|
if (includes) {
|
|
16663
16661
|
const includeBasePaths = [];
|
|
@@ -16665,9 +16663,9 @@ function getBasePaths(path, includes, useCaseSensitiveFileNames) {
|
|
|
16665
16663
|
const absolute = isRootedDiskPath(include) ? include : normalizePath(combinePaths(path, include));
|
|
16666
16664
|
includeBasePaths.push(getIncludeBasePath(absolute));
|
|
16667
16665
|
}
|
|
16668
|
-
includeBasePaths.sort(getStringComparer(!
|
|
16666
|
+
includeBasePaths.sort(getStringComparer(!useCaseSensitiveFileNames2));
|
|
16669
16667
|
for (const includeBasePath of includeBasePaths) {
|
|
16670
|
-
if (every(basePaths, (basePath) => !containsPath(basePath, includeBasePath, path, !
|
|
16668
|
+
if (every(basePaths, (basePath) => !containsPath(basePath, includeBasePath, path, !useCaseSensitiveFileNames2))) {
|
|
16671
16669
|
basePaths.push(includeBasePath);
|
|
16672
16670
|
}
|
|
16673
16671
|
}
|
|
@@ -26594,7 +26592,8 @@ var Parser;
|
|
|
26594
26592
|
nextToken();
|
|
26595
26593
|
const statements = parseList(0 /* SourceElements */, parseStatement);
|
|
26596
26594
|
Debug.assert(token() === 1 /* EndOfFileToken */);
|
|
26597
|
-
const
|
|
26595
|
+
const endHasJSDoc = hasPrecedingJSDocComment();
|
|
26596
|
+
const endOfFileToken = withJSDoc(parseTokenNode(), endHasJSDoc);
|
|
26598
26597
|
const sourceFile = createSourceFile2(fileName, languageVersion2, scriptKind2, isDeclarationFile, statements, endOfFileToken, sourceFlags, setExternalModuleIndicator2);
|
|
26599
26598
|
processCommentPragmas(sourceFile, sourceText);
|
|
26600
26599
|
processPragmasIntoFields(sourceFile, reportPragmaDiagnostic);
|
|
@@ -26614,11 +26613,11 @@ var Parser;
|
|
|
26614
26613
|
parseDiagnostics.push(createDetachedDiagnostic(fileName, pos, end, diagnostic));
|
|
26615
26614
|
}
|
|
26616
26615
|
}
|
|
26617
|
-
function withJSDoc(node, hasJSDoc) {
|
|
26618
|
-
return hasJSDoc ? addJSDocComment(node) : node;
|
|
26619
|
-
}
|
|
26620
26616
|
let hasDeprecatedTag = false;
|
|
26621
|
-
function
|
|
26617
|
+
function withJSDoc(node, hasJSDoc) {
|
|
26618
|
+
if (!hasJSDoc) {
|
|
26619
|
+
return node;
|
|
26620
|
+
}
|
|
26622
26621
|
Debug.assert(!node.jsDoc);
|
|
26623
26622
|
const jsDoc = mapDefined(getJSDocCommentRanges(node, sourceText), (comment) => JSDocParser.parseJSDocComment(node, comment.pos, comment.end - comment.pos));
|
|
26624
26623
|
if (jsDoc.length)
|
|
@@ -29133,12 +29132,14 @@ var Parser;
|
|
|
29133
29132
|
return arrowExpression;
|
|
29134
29133
|
}
|
|
29135
29134
|
const pos = getNodePos();
|
|
29135
|
+
const hasJSDoc = hasPrecedingJSDocComment();
|
|
29136
29136
|
const expr = parseBinaryExpressionOrHigher(0 /* Lowest */);
|
|
29137
29137
|
if (expr.kind === 80 /* Identifier */ && token() === 39 /* EqualsGreaterThanToken */) {
|
|
29138
29138
|
return parseSimpleArrowFunctionExpression(
|
|
29139
29139
|
pos,
|
|
29140
29140
|
expr,
|
|
29141
29141
|
allowReturnTypeInArrowFunction,
|
|
29142
|
+
hasJSDoc,
|
|
29142
29143
|
/*asyncModifier*/
|
|
29143
29144
|
void 0
|
|
29144
29145
|
);
|
|
@@ -29184,7 +29185,7 @@ var Parser;
|
|
|
29184
29185
|
), pos);
|
|
29185
29186
|
}
|
|
29186
29187
|
}
|
|
29187
|
-
function parseSimpleArrowFunctionExpression(pos, identifier, allowReturnTypeInArrowFunction, asyncModifier) {
|
|
29188
|
+
function parseSimpleArrowFunctionExpression(pos, identifier, allowReturnTypeInArrowFunction, hasJSDoc, asyncModifier) {
|
|
29188
29189
|
Debug.assert(token() === 39 /* EqualsGreaterThanToken */, "parseSimpleArrowFunctionExpression should only have been called if we had a =>");
|
|
29189
29190
|
const parameter = factory2.createParameterDeclaration(
|
|
29190
29191
|
/*modifiers*/
|
|
@@ -29217,7 +29218,7 @@ var Parser;
|
|
|
29217
29218
|
equalsGreaterThanToken,
|
|
29218
29219
|
body
|
|
29219
29220
|
);
|
|
29220
|
-
return
|
|
29221
|
+
return withJSDoc(finishNode(node, pos), hasJSDoc);
|
|
29221
29222
|
}
|
|
29222
29223
|
function tryParseParenthesizedArrowFunctionExpression(allowReturnTypeInArrowFunction) {
|
|
29223
29224
|
const triState = isParenthesizedArrowFunctionExpression();
|
|
@@ -29345,9 +29346,10 @@ var Parser;
|
|
|
29345
29346
|
if (token() === 134 /* AsyncKeyword */) {
|
|
29346
29347
|
if (lookAhead(isUnParenthesizedAsyncArrowFunctionWorker) === 1 /* True */) {
|
|
29347
29348
|
const pos = getNodePos();
|
|
29349
|
+
const hasJSDoc = hasPrecedingJSDocComment();
|
|
29348
29350
|
const asyncModifier = parseModifiersForArrowFunction();
|
|
29349
29351
|
const expr = parseBinaryExpressionOrHigher(0 /* Lowest */);
|
|
29350
|
-
return parseSimpleArrowFunctionExpression(pos, expr, allowReturnTypeInArrowFunction, asyncModifier);
|
|
29352
|
+
return parseSimpleArrowFunctionExpression(pos, expr, allowReturnTypeInArrowFunction, hasJSDoc, asyncModifier);
|
|
29351
29353
|
}
|
|
29352
29354
|
}
|
|
29353
29355
|
return void 0;
|
|
@@ -34102,6 +34104,7 @@ var commandOptionsWithoutBuild = [
|
|
|
34102
34104
|
{
|
|
34103
34105
|
name: "checkJs",
|
|
34104
34106
|
type: "boolean",
|
|
34107
|
+
affectsModuleResolution: true,
|
|
34105
34108
|
showInSimplifiedHelpView: true,
|
|
34106
34109
|
category: Diagnostics.JavaScript_Support,
|
|
34107
34110
|
description: Diagnostics.Enable_error_reporting_in_type_checked_JavaScript_files,
|
|
@@ -36512,19 +36515,19 @@ function getFileNamesFromConfigSpecs(configFileSpecs, basePath, options, host, e
|
|
|
36512
36515
|
const wildcardFiles = arrayFrom(wildcardFileMap.values());
|
|
36513
36516
|
return literalFiles.concat(wildcardFiles, arrayFrom(wildCardJsonFileMap.values()));
|
|
36514
36517
|
}
|
|
36515
|
-
function isExcludedFile(pathToCheck, spec, basePath,
|
|
36518
|
+
function isExcludedFile(pathToCheck, spec, basePath, useCaseSensitiveFileNames2, currentDirectory) {
|
|
36516
36519
|
const { validatedFilesSpec, validatedIncludeSpecs, validatedExcludeSpecs } = spec;
|
|
36517
36520
|
if (!length(validatedIncludeSpecs) || !length(validatedExcludeSpecs))
|
|
36518
36521
|
return false;
|
|
36519
36522
|
basePath = normalizePath(basePath);
|
|
36520
|
-
const keyMapper = createGetCanonicalFileName(
|
|
36523
|
+
const keyMapper = createGetCanonicalFileName(useCaseSensitiveFileNames2);
|
|
36521
36524
|
if (validatedFilesSpec) {
|
|
36522
36525
|
for (const fileName of validatedFilesSpec) {
|
|
36523
36526
|
if (keyMapper(getNormalizedAbsolutePath(fileName, basePath)) === pathToCheck)
|
|
36524
36527
|
return false;
|
|
36525
36528
|
}
|
|
36526
36529
|
}
|
|
36527
|
-
return matchesExcludeWorker(pathToCheck, validatedExcludeSpecs,
|
|
36530
|
+
return matchesExcludeWorker(pathToCheck, validatedExcludeSpecs, useCaseSensitiveFileNames2, currentDirectory, basePath);
|
|
36528
36531
|
}
|
|
36529
36532
|
function invalidDotDotAfterRecursiveWildcard(s) {
|
|
36530
36533
|
const wildcardIndex = startsWith(s, "**/") ? 0 : s.indexOf("/**/");
|
|
@@ -36534,17 +36537,17 @@ function invalidDotDotAfterRecursiveWildcard(s) {
|
|
|
36534
36537
|
const lastDotIndex = endsWith(s, "/..") ? s.length : s.lastIndexOf("/../");
|
|
36535
36538
|
return lastDotIndex > wildcardIndex;
|
|
36536
36539
|
}
|
|
36537
|
-
function matchesExclude(pathToCheck, excludeSpecs,
|
|
36540
|
+
function matchesExclude(pathToCheck, excludeSpecs, useCaseSensitiveFileNames2, currentDirectory) {
|
|
36538
36541
|
return matchesExcludeWorker(
|
|
36539
36542
|
pathToCheck,
|
|
36540
36543
|
filter(excludeSpecs, (spec) => !invalidDotDotAfterRecursiveWildcard(spec)),
|
|
36541
|
-
|
|
36544
|
+
useCaseSensitiveFileNames2,
|
|
36542
36545
|
currentDirectory
|
|
36543
36546
|
);
|
|
36544
36547
|
}
|
|
36545
|
-
function matchesExcludeWorker(pathToCheck, excludeSpecs,
|
|
36548
|
+
function matchesExcludeWorker(pathToCheck, excludeSpecs, useCaseSensitiveFileNames2, currentDirectory, basePath) {
|
|
36546
36549
|
const excludePattern = getRegularExpressionForWildcard(excludeSpecs, combinePaths(normalizePath(currentDirectory), basePath), "exclude");
|
|
36547
|
-
const excludeRegex = excludePattern && getRegexFromPattern(excludePattern,
|
|
36550
|
+
const excludeRegex = excludePattern && getRegexFromPattern(excludePattern, useCaseSensitiveFileNames2);
|
|
36548
36551
|
if (!excludeRegex)
|
|
36549
36552
|
return false;
|
|
36550
36553
|
if (excludeRegex.test(pathToCheck))
|
|
@@ -36574,9 +36577,9 @@ function specToDiagnostic(spec, disallowTrailingRecursion) {
|
|
|
36574
36577
|
return [Diagnostics.File_specification_cannot_contain_a_parent_directory_that_appears_after_a_recursive_directory_wildcard_Asterisk_Asterisk_Colon_0, spec];
|
|
36575
36578
|
}
|
|
36576
36579
|
}
|
|
36577
|
-
function getWildcardDirectories({ validatedIncludeSpecs: include, validatedExcludeSpecs: exclude }, path,
|
|
36580
|
+
function getWildcardDirectories({ validatedIncludeSpecs: include, validatedExcludeSpecs: exclude }, path, useCaseSensitiveFileNames2) {
|
|
36578
36581
|
const rawExcludeRegex = getRegularExpressionForWildcard(exclude, path, "exclude");
|
|
36579
|
-
const excludeRegex = rawExcludeRegex && new RegExp(rawExcludeRegex,
|
|
36582
|
+
const excludeRegex = rawExcludeRegex && new RegExp(rawExcludeRegex, useCaseSensitiveFileNames2 ? "" : "i");
|
|
36580
36583
|
const wildcardDirectories = {};
|
|
36581
36584
|
if (include !== void 0) {
|
|
36582
36585
|
const recursiveKeys = [];
|
|
@@ -36585,7 +36588,7 @@ function getWildcardDirectories({ validatedIncludeSpecs: include, validatedExclu
|
|
|
36585
36588
|
if (excludeRegex && excludeRegex.test(spec)) {
|
|
36586
36589
|
continue;
|
|
36587
36590
|
}
|
|
36588
|
-
const match = getWildcardDirectoryFromSpec(spec,
|
|
36591
|
+
const match = getWildcardDirectoryFromSpec(spec, useCaseSensitiveFileNames2);
|
|
36589
36592
|
if (match) {
|
|
36590
36593
|
const { key, flags } = match;
|
|
36591
36594
|
const existingFlags = wildcardDirectories[key];
|
|
@@ -36600,7 +36603,7 @@ function getWildcardDirectories({ validatedIncludeSpecs: include, validatedExclu
|
|
|
36600
36603
|
for (const key in wildcardDirectories) {
|
|
36601
36604
|
if (hasProperty(wildcardDirectories, key)) {
|
|
36602
36605
|
for (const recursiveKey of recursiveKeys) {
|
|
36603
|
-
if (key !== recursiveKey && containsPath(recursiveKey, key, path, !
|
|
36606
|
+
if (key !== recursiveKey && containsPath(recursiveKey, key, path, !useCaseSensitiveFileNames2)) {
|
|
36604
36607
|
delete wildcardDirectories[key];
|
|
36605
36608
|
}
|
|
36606
36609
|
}
|
|
@@ -36609,20 +36612,20 @@ function getWildcardDirectories({ validatedIncludeSpecs: include, validatedExclu
|
|
|
36609
36612
|
}
|
|
36610
36613
|
return wildcardDirectories;
|
|
36611
36614
|
}
|
|
36612
|
-
function getWildcardDirectoryFromSpec(spec,
|
|
36615
|
+
function getWildcardDirectoryFromSpec(spec, useCaseSensitiveFileNames2) {
|
|
36613
36616
|
const match = wildcardDirectoryPattern.exec(spec);
|
|
36614
36617
|
if (match) {
|
|
36615
36618
|
const questionWildcardIndex = spec.indexOf("?");
|
|
36616
36619
|
const starWildcardIndex = spec.indexOf("*");
|
|
36617
36620
|
const lastDirectorySeperatorIndex = spec.lastIndexOf(directorySeparator);
|
|
36618
36621
|
return {
|
|
36619
|
-
key:
|
|
36622
|
+
key: useCaseSensitiveFileNames2 ? match[0] : toFileNameLowerCase(match[0]),
|
|
36620
36623
|
flags: questionWildcardIndex !== -1 && questionWildcardIndex < lastDirectorySeperatorIndex || starWildcardIndex !== -1 && starWildcardIndex < lastDirectorySeperatorIndex ? 1 /* Recursive */ : 0 /* None */
|
|
36621
36624
|
};
|
|
36622
36625
|
}
|
|
36623
36626
|
if (isImplicitGlob(spec.substring(spec.lastIndexOf(directorySeparator) + 1))) {
|
|
36624
36627
|
return {
|
|
36625
|
-
key: removeTrailingDirectorySeparator(
|
|
36628
|
+
key: removeTrailingDirectorySeparator(useCaseSensitiveFileNames2 ? spec : toFileNameLowerCase(spec)),
|
|
36626
36629
|
flags: 1 /* Recursive */
|
|
36627
36630
|
};
|
|
36628
36631
|
}
|
|
@@ -36904,8 +36907,8 @@ function getDefaultTypeRoots(currentDirectory) {
|
|
|
36904
36907
|
}
|
|
36905
36908
|
var nodeModulesAtTypes = combinePaths("node_modules", "@types");
|
|
36906
36909
|
function arePathsEqual(path1, path2, host) {
|
|
36907
|
-
const
|
|
36908
|
-
return comparePaths(path1, path2, !
|
|
36910
|
+
const useCaseSensitiveFileNames2 = typeof host.useCaseSensitiveFileNames === "function" ? host.useCaseSensitiveFileNames() : host.useCaseSensitiveFileNames;
|
|
36911
|
+
return comparePaths(path1, path2, !useCaseSensitiveFileNames2) === 0 /* EqualTo */;
|
|
36909
36912
|
}
|
|
36910
36913
|
function getOriginalAndResolvedFileName(fileName, host, traceEnabled) {
|
|
36911
36914
|
const resolvedFileName = realPath(fileName, host, traceEnabled);
|
|
@@ -38300,6 +38303,9 @@ function loadModuleFromSelfNameReference(extensions, moduleName, directory, stat
|
|
|
38300
38303
|
}
|
|
38301
38304
|
const trailingParts = parts.slice(nameParts.length);
|
|
38302
38305
|
const subpath = !length(trailingParts) ? "." : `.${directorySeparator}${trailingParts.join(directorySeparator)}`;
|
|
38306
|
+
if (getAllowJSCompilerOption(state.compilerOptions) && !pathContainsNodeModules(directory)) {
|
|
38307
|
+
return loadModuleFromExports(scope, extensions, subpath, state, cache, redirectedReference);
|
|
38308
|
+
}
|
|
38303
38309
|
const priorityExtensions = extensions & (1 /* TypeScript */ | 4 /* Declaration */);
|
|
38304
38310
|
const secondaryExtensions = extensions & ~(1 /* TypeScript */ | 4 /* Declaration */);
|
|
38305
38311
|
return loadModuleFromExports(scope, priorityExtensions, subpath, state, cache, redirectedReference) || loadModuleFromExports(scope, secondaryExtensions, subpath, state, cache, redirectedReference);
|
|
@@ -38647,13 +38653,10 @@ function getLoadModuleFromTargetImportOrExport(extensions, state, cache, redirec
|
|
|
38647
38653
|
function combineDirectoryPath(root, dir) {
|
|
38648
38654
|
return ensureTrailingDirectorySeparator(combinePaths(root, dir));
|
|
38649
38655
|
}
|
|
38650
|
-
function useCaseSensitiveFileNames() {
|
|
38651
|
-
return !state.host.useCaseSensitiveFileNames ? true : typeof state.host.useCaseSensitiveFileNames === "boolean" ? state.host.useCaseSensitiveFileNames : state.host.useCaseSensitiveFileNames();
|
|
38652
|
-
}
|
|
38653
38656
|
function tryLoadInputFileForPath(finalPath, entry, packagePath, isImports2) {
|
|
38654
38657
|
var _a, _b, _c, _d;
|
|
38655
|
-
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)) {
|
|
38656
|
-
const getCanonicalFileName = hostGetCanonicalFileName({ useCaseSensitiveFileNames });
|
|
38658
|
+
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)) {
|
|
38659
|
+
const getCanonicalFileName = hostGetCanonicalFileName({ useCaseSensitiveFileNames: () => useCaseSensitiveFileNames(state) });
|
|
38657
38660
|
const commonSourceDirGuesses = [];
|
|
38658
38661
|
if (state.compilerOptions.rootDir || state.compilerOptions.composite && state.compilerOptions.configFilePath) {
|
|
38659
38662
|
const commonDir = toAbsolutePath(getCommonSourceDirectory(state.compilerOptions, () => [], ((_b = (_a = state.host).getCurrentDirectory) == null ? void 0 : _b.call(_a)) || "", getCanonicalFileName));
|
|
@@ -38682,7 +38685,7 @@ function getLoadModuleFromTargetImportOrExport(extensions, state, cache, redirec
|
|
|
38682
38685
|
for (const commonSourceDirGuess of commonSourceDirGuesses) {
|
|
38683
38686
|
const candidateDirectories = getOutputDirectoriesForBaseDirectory(commonSourceDirGuess);
|
|
38684
38687
|
for (const candidateDir of candidateDirectories) {
|
|
38685
|
-
if (containsPath(candidateDir, finalPath, !useCaseSensitiveFileNames())) {
|
|
38688
|
+
if (containsPath(candidateDir, finalPath, !useCaseSensitiveFileNames(state))) {
|
|
38686
38689
|
const pathFragment = finalPath.slice(candidateDir.length + 1);
|
|
38687
38690
|
const possibleInputBase = combinePaths(commonSourceDirGuess, pathFragment);
|
|
38688
38691
|
const jsAndDtsExtensions = [".mjs" /* Mjs */, ".cjs" /* Cjs */, ".js" /* Js */, ".json" /* Json */, ".d.mts" /* Dmts */, ".d.cts" /* Dcts */, ".d.ts" /* Dts */];
|
|
@@ -38692,7 +38695,7 @@ function getLoadModuleFromTargetImportOrExport(extensions, state, cache, redirec
|
|
|
38692
38695
|
for (const possibleExt of inputExts) {
|
|
38693
38696
|
if (!extensionIsOk(extensions, possibleExt))
|
|
38694
38697
|
continue;
|
|
38695
|
-
const possibleInputWithInputExtension = changeAnyExtension(possibleInputBase, possibleExt, ext, !useCaseSensitiveFileNames());
|
|
38698
|
+
const possibleInputWithInputExtension = changeAnyExtension(possibleInputBase, possibleExt, ext, !useCaseSensitiveFileNames(state));
|
|
38696
38699
|
if (state.host.fileExists(possibleInputWithInputExtension)) {
|
|
38697
38700
|
return toSearchResult(withPackageId(scope, loadFileNameFromPackageJsonField(
|
|
38698
38701
|
extensions,
|
|
@@ -39109,6 +39112,9 @@ function traceIfEnabled(state, diagnostic, ...args) {
|
|
|
39109
39112
|
trace(state.host, diagnostic, ...args);
|
|
39110
39113
|
}
|
|
39111
39114
|
}
|
|
39115
|
+
function useCaseSensitiveFileNames(state) {
|
|
39116
|
+
return !state.host.useCaseSensitiveFileNames ? true : typeof state.host.useCaseSensitiveFileNames === "boolean" ? state.host.useCaseSensitiveFileNames : state.host.useCaseSensitiveFileNames();
|
|
39117
|
+
}
|
|
39112
39118
|
|
|
39113
39119
|
// src/compiler/binder.ts
|
|
39114
39120
|
function getModuleInstanceState(node, visited) {
|
|
@@ -42526,7 +42532,9 @@ function tryGetModuleNameFromPaths(relativeToBaseUrl, paths, allowedEndings, hos
|
|
|
42526
42532
|
for (const { ending, value } of candidates) {
|
|
42527
42533
|
if (value.length >= prefix.length + suffix.length && startsWith(value, prefix) && endsWith(value, suffix) && validateEnding({ ending, value })) {
|
|
42528
42534
|
const matchedStar = value.substring(prefix.length, value.length - suffix.length);
|
|
42529
|
-
|
|
42535
|
+
if (!pathIsRelative(matchedStar)) {
|
|
42536
|
+
return key.replace("*", matchedStar);
|
|
42537
|
+
}
|
|
42530
42538
|
}
|
|
42531
42539
|
}
|
|
42532
42540
|
} else if (some(candidates, (c) => c.ending !== 0 /* Minimal */ && pattern === c.value) || some(candidates, (c) => c.ending === 0 /* Minimal */ && pattern === c.value && validateEnding(c))) {
|
|
@@ -42598,7 +42606,7 @@ function tryGetModuleNameFromExports(options, targetFilePath, packageDirectory,
|
|
|
42598
42606
|
for (const key of getOwnKeys(exports)) {
|
|
42599
42607
|
if (key === "default" || conditions.indexOf(key) >= 0 || isApplicableVersionedTypesKey(conditions, key)) {
|
|
42600
42608
|
const subTarget = exports[key];
|
|
42601
|
-
const result = tryGetModuleNameFromExports(options, targetFilePath, packageDirectory, packageName, subTarget, conditions);
|
|
42609
|
+
const result = tryGetModuleNameFromExports(options, targetFilePath, packageDirectory, packageName, subTarget, conditions, mode);
|
|
42602
42610
|
if (result) {
|
|
42603
42611
|
return result;
|
|
42604
42612
|
}
|
|
@@ -43755,7 +43763,7 @@ function createTypeChecker(host) {
|
|
|
43755
43763
|
};
|
|
43756
43764
|
var amalgamatedDuplicates;
|
|
43757
43765
|
var reverseMappedCache = /* @__PURE__ */ new Map();
|
|
43758
|
-
var
|
|
43766
|
+
var homomorphicMappedTypeInferenceStack = [];
|
|
43759
43767
|
var ambientModulesCache;
|
|
43760
43768
|
var patternAmbientModules;
|
|
43761
43769
|
var patternAmbientModuleAugmentations;
|
|
@@ -48346,6 +48354,7 @@ function createTypeChecker(host) {
|
|
|
48346
48354
|
);
|
|
48347
48355
|
}
|
|
48348
48356
|
function signatureToSignatureDeclarationHelper(signature, kind, context, options) {
|
|
48357
|
+
var _a;
|
|
48349
48358
|
const suppressAny = context.flags & 256 /* SuppressAnyReturnType */;
|
|
48350
48359
|
if (suppressAny)
|
|
48351
48360
|
context.flags &= ~256 /* SuppressAnyReturnType */;
|
|
@@ -48481,6 +48490,20 @@ function createTypeChecker(host) {
|
|
|
48481
48490
|
if (typeArguments) {
|
|
48482
48491
|
node.typeArguments = factory.createNodeArray(typeArguments);
|
|
48483
48492
|
}
|
|
48493
|
+
if (((_a = signature.declaration) == null ? void 0 : _a.kind) === 330 /* JSDocSignature */ && signature.declaration.parent.kind === 346 /* JSDocOverloadTag */) {
|
|
48494
|
+
const comment = getTextOfNode(
|
|
48495
|
+
signature.declaration.parent.parent,
|
|
48496
|
+
/*includeTrivia*/
|
|
48497
|
+
true
|
|
48498
|
+
).slice(2, -2).split(/\r\n|\n|\r/).map((line) => line.replace(/^\s+/, " ")).join("\n");
|
|
48499
|
+
addSyntheticLeadingComment(
|
|
48500
|
+
node,
|
|
48501
|
+
3 /* MultiLineCommentTrivia */,
|
|
48502
|
+
comment,
|
|
48503
|
+
/*hasTrailingNewLine*/
|
|
48504
|
+
true
|
|
48505
|
+
);
|
|
48506
|
+
}
|
|
48484
48507
|
cleanup == null ? void 0 : cleanup();
|
|
48485
48508
|
return node;
|
|
48486
48509
|
}
|
|
@@ -55258,7 +55281,7 @@ function createTypeChecker(host) {
|
|
|
55258
55281
|
return ((_a = type.target.localTypeParameters) == null ? void 0 : _a.map(() => errorType)) || emptyArray;
|
|
55259
55282
|
}
|
|
55260
55283
|
const node = type.node;
|
|
55261
|
-
const typeArguments = !node ? emptyArray : node.kind === 183 /* TypeReference */ ? concatenate(type.target.outerTypeParameters, getEffectiveTypeArguments(node, type.target.localTypeParameters)) : node.kind === 188 /* ArrayType */ ? [getTypeFromTypeNode(node.elementType)] : map(node.elements,
|
|
55284
|
+
const typeArguments = !node ? emptyArray : node.kind === 183 /* TypeReference */ ? concatenate(type.target.outerTypeParameters, getEffectiveTypeArguments(node, type.target.localTypeParameters)) : node.kind === 188 /* ArrayType */ ? [getTypeFromTypeNode(node.elementType)] : map(node.elements, getTypeFromTypeNode);
|
|
55262
55285
|
if (popTypeResolution()) {
|
|
55263
55286
|
type.resolvedTypeArguments = type.mapper ? instantiateTypes(typeArguments, type.mapper) : typeArguments;
|
|
55264
55287
|
} else {
|
|
@@ -63144,17 +63167,18 @@ function createTypeChecker(host) {
|
|
|
63144
63167
|
);
|
|
63145
63168
|
}
|
|
63146
63169
|
function inferTypeForHomomorphicMappedType(source, target, constraint) {
|
|
63147
|
-
|
|
63148
|
-
|
|
63170
|
+
const cacheKey = source.id + "," + target.id + "," + constraint.id;
|
|
63171
|
+
if (reverseMappedCache.has(cacheKey)) {
|
|
63172
|
+
return reverseMappedCache.get(cacheKey);
|
|
63149
63173
|
}
|
|
63150
|
-
const
|
|
63151
|
-
if (
|
|
63152
|
-
return
|
|
63174
|
+
const recursionKey = source.id + "," + (target.target || target).id;
|
|
63175
|
+
if (contains(homomorphicMappedTypeInferenceStack, recursionKey)) {
|
|
63176
|
+
return void 0;
|
|
63153
63177
|
}
|
|
63154
|
-
|
|
63178
|
+
homomorphicMappedTypeInferenceStack.push(recursionKey);
|
|
63155
63179
|
const type = createReverseMappedType(source, target, constraint);
|
|
63156
|
-
|
|
63157
|
-
reverseMappedCache.set(
|
|
63180
|
+
homomorphicMappedTypeInferenceStack.pop();
|
|
63181
|
+
reverseMappedCache.set(cacheKey, type);
|
|
63158
63182
|
return type;
|
|
63159
63183
|
}
|
|
63160
63184
|
function isPartiallyInferableType(type) {
|
|
@@ -113983,14 +114007,14 @@ function getEmitListItem(emit, parenthesizerRule) {
|
|
|
113983
114007
|
}
|
|
113984
114008
|
|
|
113985
114009
|
// src/compiler/watchUtilities.ts
|
|
113986
|
-
function createCachedDirectoryStructureHost(host, currentDirectory,
|
|
114010
|
+
function createCachedDirectoryStructureHost(host, currentDirectory, useCaseSensitiveFileNames2) {
|
|
113987
114011
|
if (!host.getDirectories || !host.readDirectory) {
|
|
113988
114012
|
return void 0;
|
|
113989
114013
|
}
|
|
113990
114014
|
const cachedReadDirectoryResult = /* @__PURE__ */ new Map();
|
|
113991
|
-
const getCanonicalFileName = createGetCanonicalFileName(
|
|
114015
|
+
const getCanonicalFileName = createGetCanonicalFileName(useCaseSensitiveFileNames2);
|
|
113992
114016
|
return {
|
|
113993
|
-
useCaseSensitiveFileNames,
|
|
114017
|
+
useCaseSensitiveFileNames: useCaseSensitiveFileNames2,
|
|
113994
114018
|
fileExists,
|
|
113995
114019
|
readFile: (path, encoding) => host.readFile(path, encoding),
|
|
113996
114020
|
directoryExists: host.directoryExists && directoryExists,
|
|
@@ -114112,7 +114136,7 @@ function createCachedDirectoryStructureHost(host, currentDirectory, useCaseSensi
|
|
|
114112
114136
|
const rootResult = tryReadDirectory(rootDir, rootDirPath);
|
|
114113
114137
|
let rootSymLinkResult;
|
|
114114
114138
|
if (rootResult !== void 0) {
|
|
114115
|
-
return matchFiles(rootDir, extensions, excludes, includes,
|
|
114139
|
+
return matchFiles(rootDir, extensions, excludes, includes, useCaseSensitiveFileNames2, currentDirectory, depth, getFileSystemEntries, realpath);
|
|
114116
114140
|
}
|
|
114117
114141
|
return host.readDirectory(rootDir, extensions, excludes, includes, depth);
|
|
114118
114142
|
function getFileSystemEntries(dir) {
|
|
@@ -114296,7 +114320,7 @@ function isIgnoredFileFromWildCardWatching({
|
|
|
114296
114320
|
program,
|
|
114297
114321
|
extraFileExtensions,
|
|
114298
114322
|
currentDirectory,
|
|
114299
|
-
useCaseSensitiveFileNames,
|
|
114323
|
+
useCaseSensitiveFileNames: useCaseSensitiveFileNames2,
|
|
114300
114324
|
writeLog,
|
|
114301
114325
|
toPath: toPath3
|
|
114302
114326
|
}) {
|
|
@@ -114312,7 +114336,7 @@ function isIgnoredFileFromWildCardWatching({
|
|
|
114312
114336
|
writeLog(`Project: ${configFileName} Detected file add/remove of non supported extension: ${fileOrDirectory}`);
|
|
114313
114337
|
return true;
|
|
114314
114338
|
}
|
|
114315
|
-
if (isExcludedFile(fileOrDirectory, options.configFile.configFileSpecs, getNormalizedAbsolutePath(getDirectoryPath(configFileName), currentDirectory),
|
|
114339
|
+
if (isExcludedFile(fileOrDirectory, options.configFile.configFileSpecs, getNormalizedAbsolutePath(getDirectoryPath(configFileName), currentDirectory), useCaseSensitiveFileNames2, currentDirectory)) {
|
|
114316
114340
|
writeLog(`Project: ${configFileName} Detected excluded file: ${fileOrDirectory}`);
|
|
114317
114341
|
return true;
|
|
114318
114342
|
}
|
|
@@ -114369,7 +114393,7 @@ function getWatchFactory(host, watchLogLevel, log, getDetailWatchInfo) {
|
|
|
114369
114393
|
function createExcludeHandlingAddWatch(key) {
|
|
114370
114394
|
return (file, cb, flags, options, detailInfo1, detailInfo2) => {
|
|
114371
114395
|
var _a;
|
|
114372
|
-
return !matchesExclude(file, key === "watchFile" ? options == null ? void 0 : options.excludeFiles : options == null ? void 0 : options.excludeDirectories,
|
|
114396
|
+
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(
|
|
114373
114397
|
/*thisArgs*/
|
|
114374
114398
|
void 0,
|
|
114375
114399
|
file,
|
|
@@ -114381,7 +114405,7 @@ function getWatchFactory(host, watchLogLevel, log, getDetailWatchInfo) {
|
|
|
114381
114405
|
) : excludeWatcherFactory(file, flags, options, detailInfo1, detailInfo2);
|
|
114382
114406
|
};
|
|
114383
114407
|
}
|
|
114384
|
-
function
|
|
114408
|
+
function useCaseSensitiveFileNames2() {
|
|
114385
114409
|
return typeof host.useCaseSensitiveFileNames === "boolean" ? host.useCaseSensitiveFileNames : host.useCaseSensitiveFileNames();
|
|
114386
114410
|
}
|
|
114387
114411
|
function createExcludeWatcherWithLogging(file, flags, options, detailInfo1, detailInfo2) {
|
|
@@ -116473,6 +116497,14 @@ function createProgram(rootNamesOrOptions, _options, _host, _oldProgram, _config
|
|
|
116473
116497
|
case 265 /* TypeAliasDeclaration */:
|
|
116474
116498
|
diagnostics.push(createDiagnosticForNode2(node, Diagnostics.Type_aliases_can_only_be_used_in_TypeScript_files));
|
|
116475
116499
|
return "skip";
|
|
116500
|
+
case 176 /* Constructor */:
|
|
116501
|
+
case 174 /* MethodDeclaration */:
|
|
116502
|
+
case 262 /* FunctionDeclaration */:
|
|
116503
|
+
if (!node.body) {
|
|
116504
|
+
diagnostics.push(createDiagnosticForNode2(node, Diagnostics.Signature_declarations_can_only_be_used_in_TypeScript_files));
|
|
116505
|
+
return "skip";
|
|
116506
|
+
}
|
|
116507
|
+
return;
|
|
116476
116508
|
case 266 /* EnumDeclaration */:
|
|
116477
116509
|
const enumKeyword = Debug.checkDefined(tokenToString(94 /* EnumKeyword */));
|
|
116478
116510
|
diagnostics.push(createDiagnosticForNode2(node, Diagnostics._0_declarations_can_only_be_used_in_TypeScript_files, enumKeyword));
|
|
@@ -118388,6 +118420,9 @@ function parseConfigHostFromCompilerHostLike(host, directoryStructureHost = host
|
|
|
118388
118420
|
return directoryStructureHost.readDirectory(root, extensions, excludes, includes, depth);
|
|
118389
118421
|
},
|
|
118390
118422
|
readFile: (f) => directoryStructureHost.readFile(f),
|
|
118423
|
+
directoryExists: maybeBind(directoryStructureHost, directoryStructureHost.directoryExists),
|
|
118424
|
+
getDirectories: maybeBind(directoryStructureHost, directoryStructureHost.getDirectories),
|
|
118425
|
+
realpath: maybeBind(directoryStructureHost, directoryStructureHost.realpath),
|
|
118391
118426
|
useCaseSensitiveFileNames: host.useCaseSensitiveFileNames(),
|
|
118392
118427
|
getCurrentDirectory: () => host.getCurrentDirectory(),
|
|
118393
118428
|
onUnRecoverableConfigFileDiagnostic: host.onUnRecoverableConfigFileDiagnostic || returnUndefined,
|
|
@@ -121392,12 +121427,12 @@ function getMatchedIncludeSpec(program, fileName) {
|
|
|
121392
121427
|
return true;
|
|
121393
121428
|
const isJsonFile = fileExtensionIs(fileName, ".json" /* Json */);
|
|
121394
121429
|
const basePath = getDirectoryPath(getNormalizedAbsolutePath(configFile.fileName, program.getCurrentDirectory()));
|
|
121395
|
-
const
|
|
121430
|
+
const useCaseSensitiveFileNames2 = program.useCaseSensitiveFileNames();
|
|
121396
121431
|
return find((_b = configFile == null ? void 0 : configFile.configFileSpecs) == null ? void 0 : _b.validatedIncludeSpecs, (includeSpec) => {
|
|
121397
121432
|
if (isJsonFile && !endsWith(includeSpec, ".json" /* Json */))
|
|
121398
121433
|
return false;
|
|
121399
121434
|
const pattern = getPatternFromSpec(includeSpec, basePath, "files");
|
|
121400
|
-
return !!pattern && getRegexFromPattern(`(${pattern})$`,
|
|
121435
|
+
return !!pattern && getRegexFromPattern(`(${pattern})$`, useCaseSensitiveFileNames2).test(fileName);
|
|
121401
121436
|
});
|
|
121402
121437
|
}
|
|
121403
121438
|
function fileIncludeReasonToDiagnostics(program, reason, fileNameConvertor) {
|
|
@@ -121626,7 +121661,7 @@ function createWatchFactory(host, options) {
|
|
|
121626
121661
|
return result;
|
|
121627
121662
|
}
|
|
121628
121663
|
function createCompilerHostFromProgramHost(host, getCompilerOptions, directoryStructureHost = host) {
|
|
121629
|
-
const
|
|
121664
|
+
const useCaseSensitiveFileNames2 = host.useCaseSensitiveFileNames();
|
|
121630
121665
|
const compilerHost = {
|
|
121631
121666
|
getSourceFile: createGetSourceFile(
|
|
121632
121667
|
(fileName, encoding) => !encoding ? compilerHost.readFile(fileName) : host.readFile(fileName, encoding),
|
|
@@ -121642,8 +121677,8 @@ function createCompilerHostFromProgramHost(host, getCompilerOptions, directorySt
|
|
|
121642
121677
|
(path) => host.directoryExists(path)
|
|
121643
121678
|
),
|
|
121644
121679
|
getCurrentDirectory: memoize(() => host.getCurrentDirectory()),
|
|
121645
|
-
useCaseSensitiveFileNames: () =>
|
|
121646
|
-
getCanonicalFileName: createGetCanonicalFileName(
|
|
121680
|
+
useCaseSensitiveFileNames: () => useCaseSensitiveFileNames2,
|
|
121681
|
+
getCanonicalFileName: createGetCanonicalFileName(useCaseSensitiveFileNames2),
|
|
121647
121682
|
getNewLine: () => getNewLineCharacter(getCompilerOptions()),
|
|
121648
121683
|
fileExists: (f) => host.fileExists(f),
|
|
121649
121684
|
readFile: (f) => host.readFile(f),
|
|
@@ -121858,7 +121893,7 @@ function createWatchProgram(host) {
|
|
|
121858
121893
|
const sourceFilesCache = /* @__PURE__ */ new Map();
|
|
121859
121894
|
let missingFilePathsRequestedForRelease;
|
|
121860
121895
|
let hasChangedCompilerOptions = false;
|
|
121861
|
-
const
|
|
121896
|
+
const useCaseSensitiveFileNames2 = host.useCaseSensitiveFileNames();
|
|
121862
121897
|
const currentDirectory = host.getCurrentDirectory();
|
|
121863
121898
|
const { configFileName, optionsToExtend: optionsToExtendForConfigFile = {}, watchOptionsToExtend, extraFileExtensions, createProgram: createProgram2 } = host;
|
|
121864
121899
|
let { rootFiles: rootFileNames, options: compilerOptions, watchOptions, projectReferences } = host;
|
|
@@ -121866,7 +121901,7 @@ function createWatchProgram(host) {
|
|
|
121866
121901
|
let configFileParsingDiagnostics;
|
|
121867
121902
|
let canConfigFileJsonReportNoInputFiles = false;
|
|
121868
121903
|
let hasChangedConfigFileParsingErrors = false;
|
|
121869
|
-
const cachedDirectoryStructureHost = configFileName === void 0 ? void 0 : createCachedDirectoryStructureHost(host, currentDirectory,
|
|
121904
|
+
const cachedDirectoryStructureHost = configFileName === void 0 ? void 0 : createCachedDirectoryStructureHost(host, currentDirectory, useCaseSensitiveFileNames2);
|
|
121870
121905
|
const directoryStructureHost = cachedDirectoryStructureHost || host;
|
|
121871
121906
|
const parseConfigFileHost = parseConfigHostFromCompilerHostLike(host, directoryStructureHost);
|
|
121872
121907
|
let newLine = updateNewLine();
|
|
@@ -121884,8 +121919,8 @@ function createWatchProgram(host) {
|
|
|
121884
121919
|
Debug.assert(compilerOptions);
|
|
121885
121920
|
Debug.assert(rootFileNames);
|
|
121886
121921
|
const { watchFile: watchFile2, watchDirectory, writeLog } = createWatchFactory(host, compilerOptions);
|
|
121887
|
-
const getCanonicalFileName = createGetCanonicalFileName(
|
|
121888
|
-
writeLog(`Current directory: ${currentDirectory} CaseSensitiveFileNames: ${
|
|
121922
|
+
const getCanonicalFileName = createGetCanonicalFileName(useCaseSensitiveFileNames2);
|
|
121923
|
+
writeLog(`Current directory: ${currentDirectory} CaseSensitiveFileNames: ${useCaseSensitiveFileNames2}`);
|
|
121889
121924
|
let configFileWatcher;
|
|
121890
121925
|
if (configFileName) {
|
|
121891
121926
|
configFileWatcher = watchFile2(configFileName, scheduleProgramReload, 2e3 /* High */, watchOptions, WatchType.ConfigFile);
|
|
@@ -122391,7 +122426,7 @@ function createWatchProgram(host) {
|
|
|
122391
122426
|
options: compilerOptions,
|
|
122392
122427
|
program: getCurrentBuilderProgram() || rootFileNames,
|
|
122393
122428
|
currentDirectory,
|
|
122394
|
-
useCaseSensitiveFileNames,
|
|
122429
|
+
useCaseSensitiveFileNames: useCaseSensitiveFileNames2,
|
|
122395
122430
|
writeLog,
|
|
122396
122431
|
toPath: toPath3
|
|
122397
122432
|
}))
|
|
@@ -122481,7 +122516,7 @@ function createWatchProgram(host) {
|
|
|
122481
122516
|
options: config.parsedCommandLine.options,
|
|
122482
122517
|
program: config.parsedCommandLine.fileNames,
|
|
122483
122518
|
currentDirectory,
|
|
122484
|
-
useCaseSensitiveFileNames,
|
|
122519
|
+
useCaseSensitiveFileNames: useCaseSensitiveFileNames2,
|
|
122485
122520
|
writeLog,
|
|
122486
122521
|
toPath: toPath3
|
|
122487
122522
|
}))
|