typescript 5.3.0-dev.20230825 → 5.3.0-dev.20230827
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/cancellationToken.js +1 -1
- package/lib/tsc.js +57 -58
- package/lib/tsserver.js +78 -82
- package/lib/typescript.js +78 -81
- package/lib/typingsInstaller.js +19 -22
- package/package.json +2 -2
package/lib/tsserver.js
CHANGED
|
@@ -2157,7 +2157,6 @@ __export(server_exports, {
|
|
|
2157
2157
|
startsWithDirectory: () => startsWithDirectory,
|
|
2158
2158
|
startsWithUnderscore: () => startsWithUnderscore,
|
|
2159
2159
|
startsWithUseStrict: () => startsWithUseStrict,
|
|
2160
|
-
stringContains: () => stringContains,
|
|
2161
2160
|
stringContainsAt: () => stringContainsAt,
|
|
2162
2161
|
stringToToken: () => stringToToken,
|
|
2163
2162
|
stripQuotes: () => stripQuotes,
|
|
@@ -2333,7 +2332,7 @@ module.exports = __toCommonJS(server_exports);
|
|
|
2333
2332
|
|
|
2334
2333
|
// src/compiler/corePublic.ts
|
|
2335
2334
|
var versionMajorMinor = "5.3";
|
|
2336
|
-
var version = `${versionMajorMinor}.0-dev.
|
|
2335
|
+
var version = `${versionMajorMinor}.0-dev.20230827`;
|
|
2337
2336
|
var Comparison = /* @__PURE__ */ ((Comparison3) => {
|
|
2338
2337
|
Comparison3[Comparison3["LessThan"] = -1] = "LessThan";
|
|
2339
2338
|
Comparison3[Comparison3["EqualTo"] = 0] = "EqualTo";
|
|
@@ -3779,9 +3778,6 @@ function removeSuffix(str, suffix) {
|
|
|
3779
3778
|
function tryRemoveSuffix(str, suffix) {
|
|
3780
3779
|
return endsWith(str, suffix) ? str.slice(0, str.length - suffix.length) : void 0;
|
|
3781
3780
|
}
|
|
3782
|
-
function stringContains(str, substring) {
|
|
3783
|
-
return str.indexOf(substring) !== -1;
|
|
3784
|
-
}
|
|
3785
3781
|
function removeMinAndVersionNumbers(fileName) {
|
|
3786
3782
|
let end = fileName.length;
|
|
3787
3783
|
for (let pos = end - 1; pos > 0; pos--) {
|
|
@@ -8025,11 +8021,11 @@ function createDirectoryWatcherSupportingRecursive({
|
|
|
8025
8021
|
return some(ignoredPaths, (searchPath) => isInPath(path, searchPath)) || isIgnoredByWatchOptions(path, options, useCaseSensitiveFileNames2, getCurrentDirectory);
|
|
8026
8022
|
}
|
|
8027
8023
|
function isInPath(path, searchPath) {
|
|
8028
|
-
if (
|
|
8024
|
+
if (path.includes(searchPath))
|
|
8029
8025
|
return true;
|
|
8030
8026
|
if (useCaseSensitiveFileNames2)
|
|
8031
8027
|
return false;
|
|
8032
|
-
return
|
|
8028
|
+
return toCanonicalFilePath(path).includes(searchPath);
|
|
8033
8029
|
}
|
|
8034
8030
|
}
|
|
8035
8031
|
var FileSystemEntryKind = /* @__PURE__ */ ((FileSystemEntryKind2) => {
|
|
@@ -8877,7 +8873,7 @@ function pathIsBareSpecifier(path) {
|
|
|
8877
8873
|
return !pathIsAbsolute(path) && !pathIsRelative(path);
|
|
8878
8874
|
}
|
|
8879
8875
|
function hasExtension(fileName) {
|
|
8880
|
-
return
|
|
8876
|
+
return getBaseFileName(fileName).includes(".");
|
|
8881
8877
|
}
|
|
8882
8878
|
function fileExtensionIs(path, extension) {
|
|
8883
8879
|
return path.length > extension.length && endsWith(path, extension);
|
|
@@ -9022,7 +9018,7 @@ function getPathFromPathComponents(pathComponents2, length2) {
|
|
|
9022
9018
|
return root + pathComponents2.slice(1, length2).join(directorySeparator);
|
|
9023
9019
|
}
|
|
9024
9020
|
function normalizeSlashes(path) {
|
|
9025
|
-
return path.
|
|
9021
|
+
return path.includes("\\") ? path.replace(backslashRegExp, directorySeparator) : path;
|
|
9026
9022
|
}
|
|
9027
9023
|
function reducePathComponents(components) {
|
|
9028
9024
|
if (!some(components))
|
|
@@ -15244,7 +15240,7 @@ function createModuleNotFoundChain(sourceFile, host, moduleReference, mode, pack
|
|
|
15244
15240
|
void 0,
|
|
15245
15241
|
Diagnostics.There_are_types_at_0_but_this_result_could_not_be_resolved_when_respecting_package_json_exports_The_1_library_may_need_to_update_its_package_json_or_typings,
|
|
15246
15242
|
node10Result,
|
|
15247
|
-
node10Result.
|
|
15243
|
+
node10Result.includes(nodeModulesPathPart + "@types/") ? `@types/${mangleScopedPackageName(packageName)}` : packageName
|
|
15248
15244
|
) : host.typesPackageExists(packageName) ? chainDiagnosticMessages(
|
|
15249
15245
|
/*details*/
|
|
15250
15246
|
void 0,
|
|
@@ -18753,7 +18749,7 @@ function isQuoteOrBacktick(charCode) {
|
|
|
18753
18749
|
}
|
|
18754
18750
|
function isIntrinsicJsxName(name) {
|
|
18755
18751
|
const ch = name.charCodeAt(0);
|
|
18756
|
-
return ch >= 97 /* a */ && ch <= 122 /* z */ ||
|
|
18752
|
+
return ch >= 97 /* a */ && ch <= 122 /* z */ || name.includes("-");
|
|
18757
18753
|
}
|
|
18758
18754
|
var indentStrings = ["", " "];
|
|
18759
18755
|
function getIndentString(level) {
|
|
@@ -18767,7 +18763,7 @@ function getIndentSize() {
|
|
|
18767
18763
|
return indentStrings[1].length;
|
|
18768
18764
|
}
|
|
18769
18765
|
function isNightly() {
|
|
18770
|
-
return
|
|
18766
|
+
return version.includes("-dev") || version.includes("-insiders");
|
|
18771
18767
|
}
|
|
18772
18768
|
function createTextWriter(newLine) {
|
|
18773
18769
|
var output;
|
|
@@ -18957,7 +18953,7 @@ function getExternalModuleNameFromDeclaration(host, resolver, declaration) {
|
|
|
18957
18953
|
return void 0;
|
|
18958
18954
|
}
|
|
18959
18955
|
const specifier = getExternalModuleName(declaration);
|
|
18960
|
-
if (specifier && isStringLiteralLike(specifier) && !pathIsRelative(specifier.text) && getCanonicalAbsolutePath(host, file.path).
|
|
18956
|
+
if (specifier && isStringLiteralLike(specifier) && !pathIsRelative(specifier.text) && !getCanonicalAbsolutePath(host, file.path).includes(getCanonicalAbsolutePath(host, ensureTrailingDirectorySeparator(host.getCommonSourceDirectory())))) {
|
|
18961
18957
|
return void 0;
|
|
18962
18958
|
}
|
|
18963
18959
|
return getResolvedExternalModuleName(host, file);
|
|
@@ -20962,7 +20958,7 @@ function getSupportedExtensions(options, extraFileExtensions) {
|
|
|
20962
20958
|
const flatBuiltins = flatten(builtins);
|
|
20963
20959
|
const extensions = [
|
|
20964
20960
|
...builtins,
|
|
20965
|
-
...mapDefined(extraFileExtensions, (x) => x.scriptKind === 7 /* Deferred */ || needJsExtensions && isJSLike(x.scriptKind) && flatBuiltins.
|
|
20961
|
+
...mapDefined(extraFileExtensions, (x) => x.scriptKind === 7 /* Deferred */ || needJsExtensions && isJSLike(x.scriptKind) && !flatBuiltins.includes(x.extension) ? [x.extension] : void 0)
|
|
20966
20962
|
];
|
|
20967
20963
|
return extensions;
|
|
20968
20964
|
}
|
|
@@ -21424,7 +21420,7 @@ function expressionResultIsUnused(node) {
|
|
|
21424
21420
|
}
|
|
21425
21421
|
}
|
|
21426
21422
|
function containsIgnoredPath(path) {
|
|
21427
|
-
return some(ignoredPaths, (p) =>
|
|
21423
|
+
return some(ignoredPaths, (p) => path.includes(p));
|
|
21428
21424
|
}
|
|
21429
21425
|
function getContainingNodeArray(node) {
|
|
21430
21426
|
if (!node.parent)
|
|
@@ -37885,7 +37881,7 @@ var IncrementalParser;
|
|
|
37885
37881
|
})(InvalidPosition || (InvalidPosition = {}));
|
|
37886
37882
|
})(IncrementalParser || (IncrementalParser = {}));
|
|
37887
37883
|
function isDeclarationFileName(fileName) {
|
|
37888
|
-
return fileExtensionIsOneOf(fileName, supportedDeclarationExtensions) || fileExtensionIs(fileName, ".ts" /* Ts */) &&
|
|
37884
|
+
return fileExtensionIsOneOf(fileName, supportedDeclarationExtensions) || fileExtensionIs(fileName, ".ts" /* Ts */) && getBaseFileName(fileName).includes(".d.");
|
|
37889
37885
|
}
|
|
37890
37886
|
function parseResolutionMode(mode, pos, end, reportDiagnostic) {
|
|
37891
37887
|
if (!mode) {
|
|
@@ -39603,7 +39599,7 @@ function parseListTypeOption(opt, value = "", errors) {
|
|
|
39603
39599
|
if (startsWith(value, "-")) {
|
|
39604
39600
|
return void 0;
|
|
39605
39601
|
}
|
|
39606
|
-
if (opt.type === "listOrElement" && !
|
|
39602
|
+
if (opt.type === "listOrElement" && !value.includes(",")) {
|
|
39607
39603
|
return validateJsonOptionValue(opt, value, errors);
|
|
39608
39604
|
}
|
|
39609
39605
|
if (value === "") {
|
|
@@ -40649,7 +40645,7 @@ function parseConfig(json, sourceFile, host, basePath, configFileName, resolutio
|
|
|
40649
40645
|
var _a;
|
|
40650
40646
|
basePath = normalizeSlashes(basePath);
|
|
40651
40647
|
const resolvedPath = getNormalizedAbsolutePath(configFileName || "", basePath);
|
|
40652
|
-
if (resolutionStack.
|
|
40648
|
+
if (resolutionStack.includes(resolvedPath)) {
|
|
40653
40649
|
errors.push(createCompilerDiagnostic(Diagnostics.Circularity_detected_while_resolving_configuration_Colon_0, [...resolutionStack, resolvedPath].join(" -> ")));
|
|
40654
40650
|
return { raw: json || convertToObject(sourceFile, errors) };
|
|
40655
40651
|
}
|
|
@@ -42481,7 +42477,7 @@ function nodeModuleNameResolverWorker(features, moduleName, containingDirectory,
|
|
|
42481
42477
|
result = tryResolve(extensions, state);
|
|
42482
42478
|
}
|
|
42483
42479
|
let legacyResult;
|
|
42484
|
-
if (((_a = result == null ? void 0 : result.value) == null ? void 0 : _a.isExternalLibraryImport) && !isConfigLookup && extensions & (1 /* TypeScript */ | 4 /* Declaration */) && features & 8 /* Exports */ && !isExternalModuleNameRelative(moduleName) && !extensionIsOk(1 /* TypeScript */ | 4 /* Declaration */, result.value.resolved.extension) && conditions.
|
|
42480
|
+
if (((_a = result == null ? void 0 : result.value) == null ? void 0 : _a.isExternalLibraryImport) && !isConfigLookup && extensions & (1 /* TypeScript */ | 4 /* Declaration */) && features & 8 /* Exports */ && !isExternalModuleNameRelative(moduleName) && !extensionIsOk(1 /* TypeScript */ | 4 /* Declaration */, result.value.resolved.extension) && conditions.includes("import")) {
|
|
42485
42481
|
traceIfEnabled(state, Diagnostics.Resolution_of_non_relative_name_failed_trying_with_modern_Node_resolution_features_disabled_to_see_if_npm_library_needs_configuration_update);
|
|
42486
42482
|
const diagnosticState = {
|
|
42487
42483
|
...state,
|
|
@@ -42525,7 +42521,7 @@ function nodeModuleNameResolverWorker(features, moduleName, containingDirectory,
|
|
|
42525
42521
|
resolved2 = loadModuleFromSelfNameReference(extensions2, moduleName, containingDirectory, state2, cache, redirectedReference);
|
|
42526
42522
|
}
|
|
42527
42523
|
if (!resolved2) {
|
|
42528
|
-
if (moduleName.
|
|
42524
|
+
if (moduleName.includes(":")) {
|
|
42529
42525
|
if (traceEnabled) {
|
|
42530
42526
|
trace(host, Diagnostics.Skipping_module_0_that_looks_like_an_absolute_URI_target_file_types_Colon_1, moduleName, formatExtensions(extensions2));
|
|
42531
42527
|
}
|
|
@@ -42615,7 +42611,7 @@ function nodeLoadModuleByRelativeName(extensions, candidate, onlyRecordFailures,
|
|
|
42615
42611
|
}
|
|
42616
42612
|
var nodeModulesPathPart = "/node_modules/";
|
|
42617
42613
|
function pathContainsNodeModules(path) {
|
|
42618
|
-
return
|
|
42614
|
+
return path.includes(nodeModulesPathPart);
|
|
42619
42615
|
}
|
|
42620
42616
|
function parseNodeModuleFromPath(resolved, isFolder) {
|
|
42621
42617
|
const path = normalizePath(resolved);
|
|
@@ -42651,7 +42647,7 @@ function loadModuleFromFile(extensions, candidate, onlyRecordFailures, state) {
|
|
|
42651
42647
|
}
|
|
42652
42648
|
function loadModuleFromFileNoImplicitExtensions(extensions, candidate, onlyRecordFailures, state) {
|
|
42653
42649
|
const filename = getBaseFileName(candidate);
|
|
42654
|
-
if (filename.
|
|
42650
|
+
if (!filename.includes(".")) {
|
|
42655
42651
|
return void 0;
|
|
42656
42652
|
}
|
|
42657
42653
|
let extensionless = removeFileExtension(candidate);
|
|
@@ -42808,7 +42804,7 @@ function loadEntrypointsFromExportMap(scope, exports, state, extensions) {
|
|
|
42808
42804
|
function loadEntrypointsFromTargetExports(target) {
|
|
42809
42805
|
var _a, _b;
|
|
42810
42806
|
if (typeof target === "string" && startsWith(target, "./")) {
|
|
42811
|
-
if (target.
|
|
42807
|
+
if (target.includes("*") && state.host.readDirectory) {
|
|
42812
42808
|
if (target.indexOf("*") !== target.lastIndexOf("*")) {
|
|
42813
42809
|
return false;
|
|
42814
42810
|
}
|
|
@@ -42827,7 +42823,7 @@ function loadEntrypointsFromExportMap(scope, exports, state, extensions) {
|
|
|
42827
42823
|
});
|
|
42828
42824
|
} else {
|
|
42829
42825
|
const partsAfterFirst = getPathComponents(target).slice(2);
|
|
42830
|
-
if (partsAfterFirst.
|
|
42826
|
+
if (partsAfterFirst.includes("..") || partsAfterFirst.includes(".") || partsAfterFirst.includes("node_modules")) {
|
|
42831
42827
|
return false;
|
|
42832
42828
|
}
|
|
42833
42829
|
const resolvedTarget = combinePaths(scope.packageDirectory, target);
|
|
@@ -43195,7 +43191,7 @@ function comparePatternKeys(a, b) {
|
|
|
43195
43191
|
}
|
|
43196
43192
|
function loadModuleFromImportsOrExports(extensions, state, cache, redirectedReference, moduleName, lookupTable, scope, isImports) {
|
|
43197
43193
|
const loadModuleFromTargetImportOrExport = getLoadModuleFromTargetImportOrExport(extensions, state, cache, redirectedReference, moduleName, scope, isImports);
|
|
43198
|
-
if (!endsWith(moduleName, directorySeparator) && moduleName.
|
|
43194
|
+
if (!endsWith(moduleName, directorySeparator) && !moduleName.includes("*") && hasProperty(lookupTable, moduleName)) {
|
|
43199
43195
|
const target = lookupTable[moduleName];
|
|
43200
43196
|
return loadModuleFromTargetImportOrExport(
|
|
43201
43197
|
target,
|
|
@@ -43206,7 +43202,7 @@ function loadModuleFromImportsOrExports(extensions, state, cache, redirectedRefe
|
|
|
43206
43202
|
moduleName
|
|
43207
43203
|
);
|
|
43208
43204
|
}
|
|
43209
|
-
const expandingKeys = sort(filter(getOwnKeys(lookupTable), (k) => k.
|
|
43205
|
+
const expandingKeys = sort(filter(getOwnKeys(lookupTable), (k) => k.includes("*") || endsWith(k, "/")), comparePatternKeys);
|
|
43210
43206
|
for (const potentialTarget of expandingKeys) {
|
|
43211
43207
|
if (state.features & 16 /* ExportsPatternTrailers */ && matchesPatternWithTrailer(potentialTarget, moduleName)) {
|
|
43212
43208
|
const target = lookupTable[potentialTarget];
|
|
@@ -43300,7 +43296,7 @@ function getLoadModuleFromTargetImportOrExport(extensions, state, cache, redirec
|
|
|
43300
43296
|
}
|
|
43301
43297
|
const parts = pathIsRelative(target) ? getPathComponents(target).slice(1) : getPathComponents(target);
|
|
43302
43298
|
const partsAfterFirst = parts.slice(1);
|
|
43303
|
-
if (partsAfterFirst.
|
|
43299
|
+
if (partsAfterFirst.includes("..") || partsAfterFirst.includes(".") || partsAfterFirst.includes("node_modules")) {
|
|
43304
43300
|
if (state.traceEnabled) {
|
|
43305
43301
|
trace(state.host, Diagnostics.package_json_scope_0_has_invalid_type_for_target_of_specifier_1, scope.packageDirectory, moduleName);
|
|
43306
43302
|
}
|
|
@@ -43311,7 +43307,7 @@ function getLoadModuleFromTargetImportOrExport(extensions, state, cache, redirec
|
|
|
43311
43307
|
}
|
|
43312
43308
|
const resolvedTarget = combinePaths(scope.packageDirectory, target);
|
|
43313
43309
|
const subpathParts = getPathComponents(subpath);
|
|
43314
|
-
if (subpathParts.
|
|
43310
|
+
if (subpathParts.includes("..") || subpathParts.includes(".") || subpathParts.includes("node_modules")) {
|
|
43315
43311
|
if (state.traceEnabled) {
|
|
43316
43312
|
trace(state.host, Diagnostics.package_json_scope_0_has_invalid_type_for_target_of_specifier_1, scope.packageDirectory, moduleName);
|
|
43317
43313
|
}
|
|
@@ -43338,7 +43334,7 @@ function getLoadModuleFromTargetImportOrExport(extensions, state, cache, redirec
|
|
|
43338
43334
|
if (!Array.isArray(target)) {
|
|
43339
43335
|
traceIfEnabled(state, Diagnostics.Entering_conditional_exports);
|
|
43340
43336
|
for (const condition of getOwnKeys(target)) {
|
|
43341
|
-
if (condition === "default" || state.conditions.
|
|
43337
|
+
if (condition === "default" || state.conditions.includes(condition) || isApplicableVersionedTypesKey(state.conditions, condition)) {
|
|
43342
43338
|
traceIfEnabled(state, Diagnostics.Matched_0_condition_1, isImports ? "imports" : "exports", condition);
|
|
43343
43339
|
const subTarget = target[condition];
|
|
43344
43340
|
const result = loadModuleFromTargetImportOrExport(subTarget, subpath, pattern, key);
|
|
@@ -43399,7 +43395,7 @@ function getLoadModuleFromTargetImportOrExport(extensions, state, cache, redirec
|
|
|
43399
43395
|
}
|
|
43400
43396
|
function tryLoadInputFileForPath(finalPath, entry, packagePath, isImports2) {
|
|
43401
43397
|
var _a, _b, _c, _d;
|
|
43402
|
-
if (!state.isConfigLookup && (state.compilerOptions.declarationDir || state.compilerOptions.outDir) && finalPath.
|
|
43398
|
+
if (!state.isConfigLookup && (state.compilerOptions.declarationDir || state.compilerOptions.outDir) && !finalPath.includes("/node_modules/") && (state.compilerOptions.configFile ? containsPath(scope.packageDirectory, toAbsolutePath(state.compilerOptions.configFile.fileName), !useCaseSensitiveFileNames(state)) : true)) {
|
|
43403
43399
|
const getCanonicalFileName = hostGetCanonicalFileName({ useCaseSensitiveFileNames: () => useCaseSensitiveFileNames(state) });
|
|
43404
43400
|
const commonSourceDirGuesses = [];
|
|
43405
43401
|
if (state.compilerOptions.rootDir || state.compilerOptions.composite && state.compilerOptions.configFilePath) {
|
|
@@ -43473,7 +43469,7 @@ function getLoadModuleFromTargetImportOrExport(extensions, state, cache, redirec
|
|
|
43473
43469
|
}
|
|
43474
43470
|
}
|
|
43475
43471
|
function isApplicableVersionedTypesKey(conditions, key) {
|
|
43476
|
-
if (conditions.
|
|
43472
|
+
if (!conditions.includes("types"))
|
|
43477
43473
|
return false;
|
|
43478
43474
|
if (!startsWith(key, "types@"))
|
|
43479
43475
|
return false;
|
|
@@ -43678,7 +43674,7 @@ function getPackageNameFromTypesPackageName(mangledName) {
|
|
|
43678
43674
|
return mangledName;
|
|
43679
43675
|
}
|
|
43680
43676
|
function unmangleScopedPackageName(typesPackageName) {
|
|
43681
|
-
return
|
|
43677
|
+
return typesPackageName.includes(mangledScopedPackageSeparator) ? "@" + typesPackageName.replace(mangledScopedPackageSeparator, directorySeparator) : typesPackageName;
|
|
43682
43678
|
}
|
|
43683
43679
|
function tryFindNonRelativeModuleNameInCache(cache, moduleName, mode, containingDirectory, redirectedReference, state) {
|
|
43684
43680
|
const result = cache && cache.getFromNonRelativeNameCache(moduleName, mode, containingDirectory, redirectedReference);
|
|
@@ -47371,12 +47367,12 @@ function tryGetModuleNameFromExports(options, targetFilePath, packageDirectory,
|
|
|
47371
47367
|
/*currentDirectory*/
|
|
47372
47368
|
void 0
|
|
47373
47369
|
);
|
|
47374
|
-
const mode2 = endsWith(k, "/") ? 1 /* Directory */ :
|
|
47370
|
+
const mode2 = endsWith(k, "/") ? 1 /* Directory */ : k.includes("*") ? 2 /* Pattern */ : 0 /* Exact */;
|
|
47375
47371
|
return tryGetModuleNameFromExports(options, targetFilePath, packageDirectory, subPackageName, exports[k], conditions, mode2);
|
|
47376
47372
|
});
|
|
47377
47373
|
} else {
|
|
47378
47374
|
for (const key of getOwnKeys(exports)) {
|
|
47379
|
-
if (key === "default" || conditions.
|
|
47375
|
+
if (key === "default" || conditions.includes(key) || isApplicableVersionedTypesKey(conditions, key)) {
|
|
47380
47376
|
const subTarget = exports[key];
|
|
47381
47377
|
const result = tryGetModuleNameFromExports(options, targetFilePath, packageDirectory, packageName, subTarget, conditions, mode);
|
|
47382
47378
|
if (result) {
|
|
@@ -47542,7 +47538,7 @@ function processEnding(fileName, allowedEndings, options, host) {
|
|
|
47542
47538
|
return fileName;
|
|
47543
47539
|
} else if (fileExtensionIsOneOf(fileName, [".d.mts" /* Dmts */, ".mts" /* Mts */, ".d.cts" /* Dcts */, ".cts" /* Cts */])) {
|
|
47544
47540
|
return noExtension + getJSExtensionForFile(fileName, options);
|
|
47545
|
-
} else if (!fileExtensionIsOneOf(fileName, [".d.ts" /* Dts */]) && fileExtensionIsOneOf(fileName, [".ts" /* Ts */]) &&
|
|
47541
|
+
} else if (!fileExtensionIsOneOf(fileName, [".d.ts" /* Dts */]) && fileExtensionIsOneOf(fileName, [".ts" /* Ts */]) && fileName.includes(".d.")) {
|
|
47546
47542
|
return tryGetRealFileNameForNonJsDeclarationFileName(fileName);
|
|
47547
47543
|
}
|
|
47548
47544
|
switch (allowedEndings[0]) {
|
|
@@ -47568,7 +47564,7 @@ function processEnding(fileName, allowedEndings, options, host) {
|
|
|
47568
47564
|
}
|
|
47569
47565
|
function tryGetRealFileNameForNonJsDeclarationFileName(fileName) {
|
|
47570
47566
|
const baseName = getBaseFileName(fileName);
|
|
47571
|
-
if (!endsWith(fileName, ".ts" /* Ts */) || !
|
|
47567
|
+
if (!endsWith(fileName, ".ts" /* Ts */) || !baseName.includes(".d.") || fileExtensionIsOneOf(baseName, [".d.ts" /* Dts */]))
|
|
47572
47568
|
return void 0;
|
|
47573
47569
|
const noExtension = removeExtension(fileName, ".ts" /* Ts */);
|
|
47574
47570
|
const ext = noExtension.substring(noExtension.lastIndexOf("."));
|
|
@@ -53629,12 +53625,12 @@ function createTypeChecker(host) {
|
|
|
53629
53625
|
if (!specifier) {
|
|
53630
53626
|
specifier = getSpecifierForModuleSymbol(chain[0], context);
|
|
53631
53627
|
}
|
|
53632
|
-
if (!(context.flags & 67108864 /* AllowNodeModulesRelativePaths */) && getEmitModuleResolutionKind(compilerOptions) !== 1 /* Classic */ && specifier.
|
|
53628
|
+
if (!(context.flags & 67108864 /* AllowNodeModulesRelativePaths */) && getEmitModuleResolutionKind(compilerOptions) !== 1 /* Classic */ && specifier.includes("/node_modules/")) {
|
|
53633
53629
|
const oldSpecifier = specifier;
|
|
53634
53630
|
if (getEmitModuleResolutionKind(compilerOptions) === 3 /* Node16 */ || getEmitModuleResolutionKind(compilerOptions) === 99 /* NodeNext */) {
|
|
53635
53631
|
const swappedMode = (contextFile == null ? void 0 : contextFile.impliedNodeFormat) === 99 /* ESNext */ ? 1 /* CommonJS */ : 99 /* ESNext */;
|
|
53636
53632
|
specifier = getSpecifierForModuleSymbol(chain[0], context, swappedMode);
|
|
53637
|
-
if (specifier.
|
|
53633
|
+
if (specifier.includes("/node_modules/")) {
|
|
53638
53634
|
specifier = oldSpecifier;
|
|
53639
53635
|
} else {
|
|
53640
53636
|
assertion = factory.createImportTypeAssertionContainer(factory.createAssertClause(factory.createNodeArray([
|
|
@@ -54340,7 +54336,7 @@ function createTypeChecker(host) {
|
|
|
54340
54336
|
for (const group2 of groups) {
|
|
54341
54337
|
if (group2.length > 1) {
|
|
54342
54338
|
statements = [
|
|
54343
|
-
...filter(statements, (s) => group2.
|
|
54339
|
+
...filter(statements, (s) => !group2.includes(s)),
|
|
54344
54340
|
factory.createExportDeclaration(
|
|
54345
54341
|
/*modifiers*/
|
|
54346
54342
|
void 0,
|
|
@@ -67300,6 +67296,9 @@ function createTypeChecker(host) {
|
|
|
67300
67296
|
function isArrayLikeType(type) {
|
|
67301
67297
|
return isArrayType(type) || !(type.flags & 98304 /* Nullable */) && isTypeAssignableTo(type, anyReadonlyArrayType);
|
|
67302
67298
|
}
|
|
67299
|
+
function isMutableArrayLikeType(type) {
|
|
67300
|
+
return isMutableArrayOrTuple(type) || !(type.flags & (1 /* Any */ | 98304 /* Nullable */)) && isTypeAssignableTo(type, anyArrayType);
|
|
67301
|
+
}
|
|
67303
67302
|
function getSingleBaseForNonAugmentingSubtype(type) {
|
|
67304
67303
|
if (!(getObjectFlags(type) & 4 /* Reference */) || !(getObjectFlags(type.target) & 3 /* ClassOrInterface */)) {
|
|
67305
67304
|
return void 0;
|
|
@@ -67717,7 +67716,7 @@ function createTypeChecker(host) {
|
|
|
67717
67716
|
const param = declaration;
|
|
67718
67717
|
if (isIdentifier(param.name)) {
|
|
67719
67718
|
const originalKeywordKind = identifierToKeywordKind(param.name);
|
|
67720
|
-
if ((isCallSignatureDeclaration(param.parent) || isMethodSignature(param.parent) || isFunctionTypeNode(param.parent)) && param.parent.parameters.
|
|
67719
|
+
if ((isCallSignatureDeclaration(param.parent) || isMethodSignature(param.parent) || isFunctionTypeNode(param.parent)) && param.parent.parameters.includes(param) && (resolveName(
|
|
67721
67720
|
param,
|
|
67722
67721
|
param.name.escapedText,
|
|
67723
67722
|
788968 /* Type */,
|
|
@@ -67803,7 +67802,12 @@ function createTypeChecker(host) {
|
|
|
67803
67802
|
callback(getTypeAtPosition(source, i), getTypeAtPosition(target, i));
|
|
67804
67803
|
}
|
|
67805
67804
|
if (targetRestType) {
|
|
67806
|
-
callback(getRestTypeAtPosition(
|
|
67805
|
+
callback(getRestTypeAtPosition(
|
|
67806
|
+
source,
|
|
67807
|
+
paramCount,
|
|
67808
|
+
/*readonly*/
|
|
67809
|
+
isConstTypeVariable(targetRestType) && !someType(targetRestType, isMutableArrayLikeType)
|
|
67810
|
+
), targetRestType);
|
|
67807
67811
|
}
|
|
67808
67812
|
}
|
|
67809
67813
|
function applyToReturnTypes(source, target, callback) {
|
|
@@ -72789,7 +72793,7 @@ function createTypeChecker(host) {
|
|
|
72789
72793
|
elementTypes,
|
|
72790
72794
|
elementFlags,
|
|
72791
72795
|
/*readonly*/
|
|
72792
|
-
inConstContext
|
|
72796
|
+
inConstContext && !(contextualType && someType(contextualType, isMutableArrayLikeType))
|
|
72793
72797
|
));
|
|
72794
72798
|
}
|
|
72795
72799
|
return createArrayLiteralType(createArrayType(
|
|
@@ -73105,7 +73109,7 @@ function createTypeChecker(host) {
|
|
|
73105
73109
|
return getJsxElementTypeAt(node) || anyType;
|
|
73106
73110
|
}
|
|
73107
73111
|
function isHyphenatedJsxName(name) {
|
|
73108
|
-
return
|
|
73112
|
+
return name.includes("-");
|
|
73109
73113
|
}
|
|
73110
73114
|
function isJsxIntrinsicTagName(tagName) {
|
|
73111
73115
|
return isIdentifier(tagName) && isIntrinsicJsxName(tagName.escapedText) || isJsxNamespacedName(tagName);
|
|
@@ -74810,7 +74814,7 @@ function createTypeChecker(host) {
|
|
|
74810
74814
|
names.push(arg.tupleNameSource);
|
|
74811
74815
|
}
|
|
74812
74816
|
}
|
|
74813
|
-
return createTupleType(types, flags, inConstContext, length(names) === length(types) ? names : void 0);
|
|
74817
|
+
return createTupleType(types, flags, inConstContext && !someType(restType, isMutableArrayLikeType), length(names) === length(types) ? names : void 0);
|
|
74814
74818
|
}
|
|
74815
74819
|
function checkTypeArguments(signature, typeArgumentNodes, reportErrors2, headMessage) {
|
|
74816
74820
|
const isJavascript = isInJSFile(signature.declaration);
|
|
@@ -76891,7 +76895,7 @@ function createTypeChecker(host) {
|
|
|
76891
76895
|
}
|
|
76892
76896
|
return void 0;
|
|
76893
76897
|
}
|
|
76894
|
-
function getRestTypeAtPosition(source, pos) {
|
|
76898
|
+
function getRestTypeAtPosition(source, pos, readonly) {
|
|
76895
76899
|
const parameterCount = getParameterCount(source);
|
|
76896
76900
|
const minArgumentCount = getMinArgumentCount(source);
|
|
76897
76901
|
const restType = getEffectiveRestType(source);
|
|
@@ -76914,13 +76918,7 @@ function createTypeChecker(host) {
|
|
|
76914
76918
|
names.push(name);
|
|
76915
76919
|
}
|
|
76916
76920
|
}
|
|
76917
|
-
return createTupleType(
|
|
76918
|
-
types,
|
|
76919
|
-
flags,
|
|
76920
|
-
/*readonly*/
|
|
76921
|
-
false,
|
|
76922
|
-
length(names) === length(types) ? names : void 0
|
|
76923
|
-
);
|
|
76921
|
+
return createTupleType(types, flags, readonly, length(names) === length(types) ? names : void 0);
|
|
76924
76922
|
}
|
|
76925
76923
|
function getParameterCount(signature) {
|
|
76926
76924
|
const length2 = signature.parameters.length;
|
|
@@ -88268,7 +88266,7 @@ function createTypeChecker(host) {
|
|
|
88268
88266
|
return false;
|
|
88269
88267
|
}
|
|
88270
88268
|
function checkGrammarNumericLiteral(node) {
|
|
88271
|
-
const isFractional = getTextOfNode(node).
|
|
88269
|
+
const isFractional = getTextOfNode(node).includes(".");
|
|
88272
88270
|
const isScientific = node.numericLiteralFlags & 16 /* Scientific */;
|
|
88273
88271
|
if (isFractional || isScientific) {
|
|
88274
88272
|
return;
|
|
@@ -111414,7 +111412,7 @@ function getDeclarationDiagnostics(host, resolver, file) {
|
|
|
111414
111412
|
}
|
|
111415
111413
|
function hasInternalAnnotation(range, currentSourceFile) {
|
|
111416
111414
|
const comment = currentSourceFile.text.substring(range.pos, range.end);
|
|
111417
|
-
return
|
|
111415
|
+
return comment.includes("@internal");
|
|
111418
111416
|
}
|
|
111419
111417
|
function isInternalDeclaration(node, currentSourceFile) {
|
|
111420
111418
|
const parseTreeNode = getParseTreeNode(node);
|
|
@@ -115904,7 +115902,7 @@ function createPrinter(printerOptions = {}, handlers = {}) {
|
|
|
115904
115902
|
/*jsxAttributeEscape*/
|
|
115905
115903
|
false
|
|
115906
115904
|
);
|
|
115907
|
-
return !(expression.numericLiteralFlags & 448 /* WithSpecifier */) && !
|
|
115905
|
+
return !(expression.numericLiteralFlags & 448 /* WithSpecifier */) && !text.includes(tokenToString(25 /* DotToken */)) && !text.includes(String.fromCharCode(69 /* E */)) && !text.includes(String.fromCharCode(101 /* e */));
|
|
115908
115906
|
} else if (isAccessExpression(expression)) {
|
|
115909
115907
|
const constantValue = getConstantValue(expression);
|
|
115910
115908
|
return typeof constantValue === "number" && isFinite(constantValue) && constantValue >= 0 && Math.floor(constantValue) === constantValue;
|
|
@@ -120791,7 +120789,7 @@ function createProgram(rootNamesOrOptions, _options, _host, _oldProgram, _config
|
|
|
120791
120789
|
const resultFromDts = getRedirectReferenceForResolutionFromSourceOfProject(file.path);
|
|
120792
120790
|
if (resultFromDts)
|
|
120793
120791
|
return resultFromDts;
|
|
120794
|
-
if (!host.realpath || !options.preserveSymlinks || !
|
|
120792
|
+
if (!host.realpath || !options.preserveSymlinks || !file.originalFileName.includes(nodeModulesPathPart))
|
|
120795
120793
|
return void 0;
|
|
120796
120794
|
const realDeclarationPath = toPath3(host.realpath(file.originalFileName));
|
|
120797
120795
|
return realDeclarationPath === file.path ? void 0 : getRedirectReferenceForResolutionFromSourceOfProject(realDeclarationPath);
|
|
@@ -122049,7 +122047,7 @@ function createProgram(rootNamesOrOptions, _options, _host, _oldProgram, _config
|
|
|
122049
122047
|
const path = toPath3(fileName);
|
|
122050
122048
|
if (useSourceOfProjectReferenceRedirect) {
|
|
122051
122049
|
let source = getSourceOfProjectReferenceRedirect(path);
|
|
122052
|
-
if (!source && host.realpath && options.preserveSymlinks && isDeclarationFileName(fileName) &&
|
|
122050
|
+
if (!source && host.realpath && options.preserveSymlinks && isDeclarationFileName(fileName) && fileName.includes(nodeModulesPathPart)) {
|
|
122053
122051
|
const realPath2 = toPath3(host.realpath(fileName));
|
|
122054
122052
|
if (realPath2 !== path)
|
|
122055
122053
|
source = getSourceOfProjectReferenceRedirect(realPath2);
|
|
@@ -123409,7 +123407,7 @@ function updateHostForUseSourceOfProjectReferenceRedirect(host) {
|
|
|
123409
123407
|
var _a;
|
|
123410
123408
|
if (!host.getResolvedProjectReferences() || containsIgnoredPath(directory))
|
|
123411
123409
|
return;
|
|
123412
|
-
if (!originalRealpath || !
|
|
123410
|
+
if (!originalRealpath || !directory.includes(nodeModulesPathPart))
|
|
123413
123411
|
return;
|
|
123414
123412
|
const symlinkCache = host.getSymlinkCache();
|
|
123415
123413
|
const directoryPath = ensureTrailingDirectorySeparator(host.toPath(directory));
|
|
@@ -123437,7 +123435,7 @@ function updateHostForUseSourceOfProjectReferenceRedirect(host) {
|
|
|
123437
123435
|
if (!symlinkedDirectories)
|
|
123438
123436
|
return false;
|
|
123439
123437
|
const fileOrDirectoryPath = host.toPath(fileOrDirectory);
|
|
123440
|
-
if (!
|
|
123438
|
+
if (!fileOrDirectoryPath.includes(nodeModulesPathPart))
|
|
123441
123439
|
return false;
|
|
123442
123440
|
if (isFile && ((_a = symlinkCache.getSymlinkedFiles()) == null ? void 0 : _a.has(fileOrDirectoryPath)))
|
|
123443
123441
|
return true;
|
|
@@ -125327,7 +125325,7 @@ function removeIgnoredPath(path) {
|
|
|
125327
125325
|
if (endsWith(path, "/node_modules/.staging")) {
|
|
125328
125326
|
return removeSuffix(path, "/.staging");
|
|
125329
125327
|
}
|
|
125330
|
-
return some(ignoredPaths, (searchPath) =>
|
|
125328
|
+
return some(ignoredPaths, (searchPath) => path.includes(searchPath)) ? void 0 : path;
|
|
125331
125329
|
}
|
|
125332
125330
|
function perceivedOsRootLengthForWatching(pathComponents2, length2) {
|
|
125333
125331
|
if (length2 <= 1)
|
|
@@ -130067,7 +130065,7 @@ var Arguments;
|
|
|
130067
130065
|
Arguments2.ValidateDefaultNpmLocation = "--validateDefaultNpmLocation";
|
|
130068
130066
|
})(Arguments || (Arguments = {}));
|
|
130069
130067
|
function hasArgument(argumentName) {
|
|
130070
|
-
return sys.args.
|
|
130068
|
+
return sys.args.includes(argumentName);
|
|
130071
130069
|
}
|
|
130072
130070
|
function findArgument(argumentName) {
|
|
130073
130071
|
const index = sys.args.indexOf(argumentName);
|
|
@@ -132890,7 +132888,7 @@ function createPackageJsonImportFilter(fromFile, preferences, host) {
|
|
|
132890
132888
|
return false;
|
|
132891
132889
|
}
|
|
132892
132890
|
function getNodeModulesPackageNameFromFileName(importedFileName, moduleSpecifierResolutionHost) {
|
|
132893
|
-
if (!
|
|
132891
|
+
if (!importedFileName.includes("node_modules")) {
|
|
132894
132892
|
return void 0;
|
|
132895
132893
|
}
|
|
132896
132894
|
const specifier = ts_moduleSpecifiers_exports.getNodeModulesPackageName(
|
|
@@ -133464,7 +133462,7 @@ function forEachExternalModule(checker, allSourceFiles, excludePatterns, cb) {
|
|
|
133464
133462
|
var _a;
|
|
133465
133463
|
const isExcluded = excludePatterns && ((fileName) => excludePatterns.some((p) => p.test(fileName)));
|
|
133466
133464
|
for (const ambient of checker.getAmbientModules()) {
|
|
133467
|
-
if (!
|
|
133465
|
+
if (!ambient.name.includes("*") && !(excludePatterns && ((_a = ambient.declarations) == null ? void 0 : _a.every((d) => isExcluded(d.getSourceFile().fileName))))) {
|
|
133468
133466
|
cb(
|
|
133469
133467
|
ambient,
|
|
133470
133468
|
/*sourceFile*/
|
|
@@ -142362,7 +142360,7 @@ function collectReadsAndWrites(targetRange, scopes, enclosingTextRange, sourceFi
|
|
|
142362
142360
|
return symbolId;
|
|
142363
142361
|
}
|
|
142364
142362
|
function checkForUsedDeclarations(node) {
|
|
142365
|
-
if (node === targetRange.range || isReadonlyArray(targetRange.range) && targetRange.range.
|
|
142363
|
+
if (node === targetRange.range || isReadonlyArray(targetRange.range) && targetRange.range.includes(node)) {
|
|
142366
142364
|
return;
|
|
142367
142365
|
}
|
|
142368
142366
|
const sym = isIdentifier(node) ? getSymbolReferencedByIdentifier(node) : checker.getSymbolAtLocation(node);
|
|
@@ -144720,7 +144718,7 @@ function createLanguageService(host, documentRegistry = createDocumentRegistry(h
|
|
|
144720
144718
|
return char >= 97 /* a */ && char <= 122 /* z */ || char >= 65 /* A */ && char <= 90 /* Z */ || char >= 48 /* _0 */ && char <= 57 /* _9 */;
|
|
144721
144719
|
}
|
|
144722
144720
|
function isNodeModulesFile(path) {
|
|
144723
|
-
return
|
|
144721
|
+
return path.includes("/node_modules/");
|
|
144724
144722
|
}
|
|
144725
144723
|
}
|
|
144726
144724
|
function getRenameInfo2(fileName, position, preferences) {
|
|
@@ -153701,7 +153699,7 @@ function mayDeleteParameter(checker, sourceFile, parameter, sourceFiles, program
|
|
|
153701
153699
|
}
|
|
153702
153700
|
}
|
|
153703
153701
|
function isCallbackLike(checker, sourceFile, name) {
|
|
153704
|
-
return !!ts_FindAllReferences_exports.Core.eachSymbolReferenceInFile(name, checker, sourceFile, (reference) => isIdentifier(reference) && isCallExpression(reference.parent) && reference.parent.arguments.
|
|
153702
|
+
return !!ts_FindAllReferences_exports.Core.eachSymbolReferenceInFile(name, checker, sourceFile, (reference) => isIdentifier(reference) && isCallExpression(reference.parent) && reference.parent.arguments.includes(reference));
|
|
153705
153703
|
}
|
|
153706
153704
|
function isLastParameter(func, parameter, isFixAll) {
|
|
153707
153705
|
const parameters = func.parameters;
|
|
@@ -161082,7 +161080,7 @@ function directoryResult(name) {
|
|
|
161082
161080
|
function addReplacementSpans(text, textStart, names) {
|
|
161083
161081
|
const span = getDirectoryFragmentTextSpan(text, textStart);
|
|
161084
161082
|
const wholeSpan = text.length === 0 ? void 0 : createTextSpan(textStart, text.length);
|
|
161085
|
-
return names.map(({ name, kind, extension }) =>
|
|
161083
|
+
return names.map(({ name, kind, extension }) => name.includes(directorySeparator) || name.includes(altDirectorySeparator) ? { name, kind, extension, span: wholeSpan } : { name, kind, extension, span });
|
|
161086
161084
|
}
|
|
161087
161085
|
function getStringLiteralCompletionsFromModuleNames(sourceFile, node, compilerOptions, host, typeChecker, preferences) {
|
|
161088
161086
|
return addReplacementSpans(node.text, node.getStart(sourceFile) + 1, getStringLiteralCompletionsFromModuleNamesWorker(sourceFile, node, compilerOptions, host, typeChecker, preferences));
|
|
@@ -161408,7 +161406,7 @@ function getPatternFromFirstMatchingCondition(target, conditions) {
|
|
|
161408
161406
|
}
|
|
161409
161407
|
if (target && typeof target === "object" && !isArray(target)) {
|
|
161410
161408
|
for (const condition in target) {
|
|
161411
|
-
if (condition === "default" || conditions.
|
|
161409
|
+
if (condition === "default" || conditions.includes(condition) || isApplicableVersionedTypesKey(conditions, condition)) {
|
|
161412
161410
|
const pattern = target[condition];
|
|
161413
161411
|
return getPatternFromFirstMatchingCondition(pattern, conditions);
|
|
161414
161412
|
}
|
|
@@ -161420,7 +161418,7 @@ function getFragmentDirectory(fragment) {
|
|
|
161420
161418
|
}
|
|
161421
161419
|
function getCompletionsForPathMapping(path, patterns, fragment, packageDirectory, extensionOptions, host) {
|
|
161422
161420
|
if (!endsWith(path, "*")) {
|
|
161423
|
-
return !
|
|
161421
|
+
return !path.includes("*") ? justPathMappingName(path, "script" /* scriptElement */) : emptyArray;
|
|
161424
161422
|
}
|
|
161425
161423
|
const pathPrefix = path.slice(0, path.length - 1);
|
|
161426
161424
|
const remainingFragment = tryRemovePrefix(fragment, pathPrefix);
|
|
@@ -161490,7 +161488,7 @@ function removeLeadingDirectorySeparator(path) {
|
|
|
161490
161488
|
}
|
|
161491
161489
|
function getAmbientModuleCompletions(fragment, fragmentDirectory, checker) {
|
|
161492
161490
|
const ambientModules = checker.getAmbientModules().map((sym) => stripQuotes(sym.name));
|
|
161493
|
-
const nonRelativeModuleNames = ambientModules.filter((moduleName) => startsWith(moduleName, fragment) && moduleName.
|
|
161491
|
+
const nonRelativeModuleNames = ambientModules.filter((moduleName) => startsWith(moduleName, fragment) && !moduleName.includes("*"));
|
|
161494
161492
|
if (fragmentDirectory !== void 0) {
|
|
161495
161493
|
const moduleNameWithSeparator = ensureTrailingDirectorySeparator(fragmentDirectory);
|
|
161496
161494
|
return nonRelativeModuleNames.map((nonRelativeModuleName) => removePrefix(nonRelativeModuleName, moduleNameWithSeparator));
|
|
@@ -161606,7 +161604,7 @@ function isPathRelativeToScript(path) {
|
|
|
161606
161604
|
var tripleSlashDirectiveFragmentRegex = /^(\/\/\/\s*<reference\s+(path|types)\s*=\s*(?:'|"))([^\3"]*)$/;
|
|
161607
161605
|
var nodeModulesDependencyKeys = ["dependencies", "devDependencies", "peerDependencies", "optionalDependencies"];
|
|
161608
161606
|
function containsSlash(fragment) {
|
|
161609
|
-
return
|
|
161607
|
+
return fragment.includes(directorySeparator);
|
|
161610
161608
|
}
|
|
161611
161609
|
function isRequireCallArgument(node) {
|
|
161612
161610
|
return isCallExpression(node.parent) && firstOrUndefined(node.parent.arguments) === node && isIdentifier(node.parent.expression) && node.parent.expression.escapedText === "require";
|
|
@@ -170301,7 +170299,7 @@ function isSemicolonInsertionContext(context) {
|
|
|
170301
170299
|
return positionIsASICandidate(context.currentTokenSpan.end, context.currentTokenParent, context.sourceFile);
|
|
170302
170300
|
}
|
|
170303
170301
|
function isNotPropertyAccessOnIntegerLiteral(context) {
|
|
170304
|
-
return !isPropertyAccessExpression(context.contextNode) || !isNumericLiteral(context.contextNode.expression) || context.contextNode.expression.getText().
|
|
170302
|
+
return !isPropertyAccessExpression(context.contextNode) || !isNumericLiteral(context.contextNode.expression) || context.contextNode.expression.getText().includes(".");
|
|
170305
170303
|
}
|
|
170306
170304
|
|
|
170307
170305
|
// src/services/formatting/rulesMap.ts
|
|
@@ -171473,7 +171471,7 @@ var SmartIndenter;
|
|
|
171473
171471
|
}
|
|
171474
171472
|
const containerList = getListByPosition(position, precedingToken.parent, sourceFile);
|
|
171475
171473
|
if (containerList && !rangeContainsRange(containerList, precedingToken)) {
|
|
171476
|
-
const useTheSameBaseIndentation = [218 /* FunctionExpression */, 219 /* ArrowFunction */].
|
|
171474
|
+
const useTheSameBaseIndentation = [218 /* FunctionExpression */, 219 /* ArrowFunction */].includes(currentToken.parent.kind);
|
|
171477
171475
|
const indentSize = useTheSameBaseIndentation ? 0 : options.indentSize;
|
|
171478
171476
|
return getActualIndentationForListStartLine(containerList, sourceFile, options) + indentSize;
|
|
171479
171477
|
}
|
|
@@ -174074,7 +174072,6 @@ __export(ts_exports2, {
|
|
|
174074
174072
|
startsWithDirectory: () => startsWithDirectory,
|
|
174075
174073
|
startsWithUnderscore: () => startsWithUnderscore,
|
|
174076
174074
|
startsWithUseStrict: () => startsWithUseStrict,
|
|
174077
|
-
stringContains: () => stringContains,
|
|
174078
174075
|
stringContainsAt: () => stringContainsAt,
|
|
174079
174076
|
stringToToken: () => stringToToken,
|
|
174080
174077
|
stripQuotes: () => stripQuotes,
|
|
@@ -175482,7 +175479,7 @@ var TextStorage = class {
|
|
|
175482
175479
|
}
|
|
175483
175480
|
};
|
|
175484
175481
|
function isDynamicFileName(fileName) {
|
|
175485
|
-
return fileName[0] === "^" || (
|
|
175482
|
+
return fileName[0] === "^" || (fileName.includes("walkThroughSnippet:/") || fileName.includes("untitled:/")) && getBaseFileName(fileName)[0] === "^" || fileName.includes(":^") && !fileName.includes(directorySeparator);
|
|
175486
175483
|
}
|
|
175487
175484
|
var ScriptInfo = class {
|
|
175488
175485
|
constructor(host, fileName, scriptKind, hasMixedContent, path, initialVersion) {
|
|
@@ -176874,7 +176871,7 @@ var Project3 = class _Project {
|
|
|
176874
176871
|
}
|
|
176875
176872
|
removeExistingTypings(include) {
|
|
176876
176873
|
const existing = getAutomaticTypeDirectiveNames(this.getCompilerOptions(), this.directoryStructureHost);
|
|
176877
|
-
return include.filter((i) => existing.
|
|
176874
|
+
return include.filter((i) => !existing.includes(i));
|
|
176878
176875
|
}
|
|
176879
176876
|
updateGraphWorker() {
|
|
176880
176877
|
var _a, _b;
|
|
@@ -181067,7 +181064,7 @@ Dynamic files must always be opened with service's current directory or service
|
|
|
181067
181064
|
this.logger.info(`Excluding files based on rule ${name} matching file '${root}'`);
|
|
181068
181065
|
if (rule2.types) {
|
|
181069
181066
|
for (const type of rule2.types) {
|
|
181070
|
-
if (typeAcqInclude.
|
|
181067
|
+
if (!typeAcqInclude.includes(type)) {
|
|
181071
181068
|
typeAcqInclude.push(type);
|
|
181072
181069
|
}
|
|
181073
181070
|
}
|
|
@@ -181086,13 +181083,13 @@ Dynamic files must always be opened with service's current directory or service
|
|
|
181086
181083
|
return groupNumberOrString;
|
|
181087
181084
|
}).join("");
|
|
181088
181085
|
});
|
|
181089
|
-
if (excludeRules.
|
|
181086
|
+
if (!excludeRules.includes(processedRule)) {
|
|
181090
181087
|
excludeRules.push(processedRule);
|
|
181091
181088
|
}
|
|
181092
181089
|
}
|
|
181093
181090
|
} else {
|
|
181094
181091
|
const escaped = _ProjectService.escapeFilenameForRegex(root);
|
|
181095
|
-
if (excludeRules.
|
|
181092
|
+
if (!excludeRules.includes(escaped)) {
|
|
181096
181093
|
excludeRules.push(escaped);
|
|
181097
181094
|
}
|
|
181098
181095
|
}
|
|
@@ -181116,7 +181113,7 @@ Dynamic files must always be opened with service's current directory or service
|
|
|
181116
181113
|
this.logger.info(`Excluded '${normalizedNames[i]}' because it matched ${cleanedTypingName} from the legacy safelist`);
|
|
181117
181114
|
excludedFiles.push(normalizedNames[i]);
|
|
181118
181115
|
exclude = true;
|
|
181119
|
-
if (typeAcqInclude.
|
|
181116
|
+
if (!typeAcqInclude.includes(typeName)) {
|
|
181120
181117
|
typeAcqInclude.push(typeName);
|
|
181121
181118
|
}
|
|
181122
181119
|
}
|
|
@@ -184587,7 +184584,7 @@ ${e.message}`;
|
|
|
184587
184584
|
if (languageServiceDisabled) {
|
|
184588
184585
|
return;
|
|
184589
184586
|
}
|
|
184590
|
-
const fileNamesInProject = fileNames.filter((value) => !
|
|
184587
|
+
const fileNamesInProject = fileNames.filter((value) => !value.includes("lib.d.ts"));
|
|
184591
184588
|
if (fileNamesInProject.length === 0) {
|
|
184592
184589
|
return;
|
|
184593
184590
|
}
|
|
@@ -188637,7 +188634,6 @@ start(initializeNodeSystem(), require("os").platform());
|
|
|
188637
188634
|
startsWithDirectory,
|
|
188638
188635
|
startsWithUnderscore,
|
|
188639
188636
|
startsWithUseStrict,
|
|
188640
|
-
stringContains,
|
|
188641
188637
|
stringContainsAt,
|
|
188642
188638
|
stringToToken,
|
|
188643
188639
|
stripQuotes,
|