typescript 5.3.0-dev.20230825 → 5.3.0-dev.20230826
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 +44 -47
- package/lib/tsserver.js +65 -71
- package/lib/typescript.js +65 -70
- package/lib/typingsInstaller.js +19 -22
- package/package.json +2 -2
package/lib/typescript.js
CHANGED
|
@@ -35,7 +35,7 @@ var ts = (() => {
|
|
|
35
35
|
"src/compiler/corePublic.ts"() {
|
|
36
36
|
"use strict";
|
|
37
37
|
versionMajorMinor = "5.3";
|
|
38
|
-
version = `${versionMajorMinor}.0-dev.
|
|
38
|
+
version = `${versionMajorMinor}.0-dev.20230826`;
|
|
39
39
|
Comparison = /* @__PURE__ */ ((Comparison3) => {
|
|
40
40
|
Comparison3[Comparison3["LessThan"] = -1] = "LessThan";
|
|
41
41
|
Comparison3[Comparison3["EqualTo"] = 0] = "EqualTo";
|
|
@@ -1398,9 +1398,6 @@ var ts = (() => {
|
|
|
1398
1398
|
function tryRemoveSuffix(str, suffix) {
|
|
1399
1399
|
return endsWith(str, suffix) ? str.slice(0, str.length - suffix.length) : void 0;
|
|
1400
1400
|
}
|
|
1401
|
-
function stringContains(str, substring) {
|
|
1402
|
-
return str.indexOf(substring) !== -1;
|
|
1403
|
-
}
|
|
1404
1401
|
function removeMinAndVersionNumbers(fileName) {
|
|
1405
1402
|
let end = fileName.length;
|
|
1406
1403
|
for (let pos = end - 1; pos > 0; pos--) {
|
|
@@ -5765,11 +5762,11 @@ ${lanes.join("\n")}
|
|
|
5765
5762
|
return some(ignoredPaths, (searchPath) => isInPath(path, searchPath)) || isIgnoredByWatchOptions(path, options, useCaseSensitiveFileNames2, getCurrentDirectory);
|
|
5766
5763
|
}
|
|
5767
5764
|
function isInPath(path, searchPath) {
|
|
5768
|
-
if (
|
|
5765
|
+
if (path.includes(searchPath))
|
|
5769
5766
|
return true;
|
|
5770
5767
|
if (useCaseSensitiveFileNames2)
|
|
5771
5768
|
return false;
|
|
5772
|
-
return
|
|
5769
|
+
return toCanonicalFilePath(path).includes(searchPath);
|
|
5773
5770
|
}
|
|
5774
5771
|
}
|
|
5775
5772
|
function createFileWatcherCallback(callback) {
|
|
@@ -6638,7 +6635,7 @@ ${lanes.join("\n")}
|
|
|
6638
6635
|
return !pathIsAbsolute(path) && !pathIsRelative(path);
|
|
6639
6636
|
}
|
|
6640
6637
|
function hasExtension(fileName) {
|
|
6641
|
-
return
|
|
6638
|
+
return getBaseFileName(fileName).includes(".");
|
|
6642
6639
|
}
|
|
6643
6640
|
function fileExtensionIs(path, extension) {
|
|
6644
6641
|
return path.length > extension.length && endsWith(path, extension);
|
|
@@ -6783,7 +6780,7 @@ ${lanes.join("\n")}
|
|
|
6783
6780
|
return root + pathComponents2.slice(1, length2).join(directorySeparator);
|
|
6784
6781
|
}
|
|
6785
6782
|
function normalizeSlashes(path) {
|
|
6786
|
-
return path.
|
|
6783
|
+
return path.includes("\\") ? path.replace(backslashRegExp, directorySeparator) : path;
|
|
6787
6784
|
}
|
|
6788
6785
|
function reducePathComponents(components) {
|
|
6789
6786
|
if (!some(components))
|
|
@@ -13032,7 +13029,7 @@ ${lanes.join("\n")}
|
|
|
13032
13029
|
void 0,
|
|
13033
13030
|
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,
|
|
13034
13031
|
node10Result,
|
|
13035
|
-
node10Result.
|
|
13032
|
+
node10Result.includes(nodeModulesPathPart + "@types/") ? `@types/${mangleScopedPackageName(packageName)}` : packageName
|
|
13036
13033
|
) : host.typesPackageExists(packageName) ? chainDiagnosticMessages(
|
|
13037
13034
|
/*details*/
|
|
13038
13035
|
void 0,
|
|
@@ -16053,7 +16050,7 @@ ${lanes.join("\n")}
|
|
|
16053
16050
|
}
|
|
16054
16051
|
function isIntrinsicJsxName(name) {
|
|
16055
16052
|
const ch = name.charCodeAt(0);
|
|
16056
|
-
return ch >= 97 /* a */ && ch <= 122 /* z */ ||
|
|
16053
|
+
return ch >= 97 /* a */ && ch <= 122 /* z */ || name.includes("-");
|
|
16057
16054
|
}
|
|
16058
16055
|
function getIndentString(level) {
|
|
16059
16056
|
const singleLevel = indentStrings[1];
|
|
@@ -16066,7 +16063,7 @@ ${lanes.join("\n")}
|
|
|
16066
16063
|
return indentStrings[1].length;
|
|
16067
16064
|
}
|
|
16068
16065
|
function isNightly() {
|
|
16069
|
-
return
|
|
16066
|
+
return version.includes("-dev") || version.includes("-insiders");
|
|
16070
16067
|
}
|
|
16071
16068
|
function createTextWriter(newLine) {
|
|
16072
16069
|
var output;
|
|
@@ -16256,7 +16253,7 @@ ${lanes.join("\n")}
|
|
|
16256
16253
|
return void 0;
|
|
16257
16254
|
}
|
|
16258
16255
|
const specifier = getExternalModuleName(declaration);
|
|
16259
|
-
if (specifier && isStringLiteralLike(specifier) && !pathIsRelative(specifier.text) && getCanonicalAbsolutePath(host, file.path).
|
|
16256
|
+
if (specifier && isStringLiteralLike(specifier) && !pathIsRelative(specifier.text) && !getCanonicalAbsolutePath(host, file.path).includes(getCanonicalAbsolutePath(host, ensureTrailingDirectorySeparator(host.getCommonSourceDirectory())))) {
|
|
16260
16257
|
return void 0;
|
|
16261
16258
|
}
|
|
16262
16259
|
return getResolvedExternalModuleName(host, file);
|
|
@@ -18196,7 +18193,7 @@ ${lanes.join("\n")}
|
|
|
18196
18193
|
const flatBuiltins = flatten(builtins);
|
|
18197
18194
|
const extensions = [
|
|
18198
18195
|
...builtins,
|
|
18199
|
-
...mapDefined(extraFileExtensions, (x) => x.scriptKind === 7 /* Deferred */ || needJsExtensions && isJSLike(x.scriptKind) && flatBuiltins.
|
|
18196
|
+
...mapDefined(extraFileExtensions, (x) => x.scriptKind === 7 /* Deferred */ || needJsExtensions && isJSLike(x.scriptKind) && !flatBuiltins.includes(x.extension) ? [x.extension] : void 0)
|
|
18200
18197
|
];
|
|
18201
18198
|
return extensions;
|
|
18202
18199
|
}
|
|
@@ -18646,7 +18643,7 @@ ${lanes.join("\n")}
|
|
|
18646
18643
|
}
|
|
18647
18644
|
}
|
|
18648
18645
|
function containsIgnoredPath(path) {
|
|
18649
|
-
return some(ignoredPaths, (p) =>
|
|
18646
|
+
return some(ignoredPaths, (p) => path.includes(p));
|
|
18650
18647
|
}
|
|
18651
18648
|
function getContainingNodeArray(node) {
|
|
18652
18649
|
if (!node.parent)
|
|
@@ -28199,7 +28196,7 @@ ${lanes.join("\n")}
|
|
|
28199
28196
|
return Parser.JSDocParser.parseJSDocTypeExpressionForTests(content, start, length2);
|
|
28200
28197
|
}
|
|
28201
28198
|
function isDeclarationFileName(fileName) {
|
|
28202
|
-
return fileExtensionIsOneOf(fileName, supportedDeclarationExtensions) || fileExtensionIs(fileName, ".ts" /* Ts */) &&
|
|
28199
|
+
return fileExtensionIsOneOf(fileName, supportedDeclarationExtensions) || fileExtensionIs(fileName, ".ts" /* Ts */) && getBaseFileName(fileName).includes(".d.");
|
|
28203
28200
|
}
|
|
28204
28201
|
function parseResolutionMode(mode, pos, end, reportDiagnostic) {
|
|
28205
28202
|
if (!mode) {
|
|
@@ -35987,7 +35984,7 @@ ${lanes.join("\n")}
|
|
|
35987
35984
|
if (startsWith(value, "-")) {
|
|
35988
35985
|
return void 0;
|
|
35989
35986
|
}
|
|
35990
|
-
if (opt.type === "listOrElement" && !
|
|
35987
|
+
if (opt.type === "listOrElement" && !value.includes(",")) {
|
|
35991
35988
|
return validateJsonOptionValue(opt, value, errors);
|
|
35992
35989
|
}
|
|
35993
35990
|
if (value === "") {
|
|
@@ -36966,7 +36963,7 @@ ${lanes.join("\n")}
|
|
|
36966
36963
|
var _a;
|
|
36967
36964
|
basePath = normalizeSlashes(basePath);
|
|
36968
36965
|
const resolvedPath = getNormalizedAbsolutePath(configFileName || "", basePath);
|
|
36969
|
-
if (resolutionStack.
|
|
36966
|
+
if (resolutionStack.includes(resolvedPath)) {
|
|
36970
36967
|
errors.push(createCompilerDiagnostic(Diagnostics.Circularity_detected_while_resolving_configuration_Colon_0, [...resolutionStack, resolvedPath].join(" -> ")));
|
|
36971
36968
|
return { raw: json || convertToObject(sourceFile, errors) };
|
|
36972
36969
|
}
|
|
@@ -40321,7 +40318,7 @@ ${lanes.join("\n")}
|
|
|
40321
40318
|
result = tryResolve(extensions, state);
|
|
40322
40319
|
}
|
|
40323
40320
|
let legacyResult;
|
|
40324
|
-
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.
|
|
40321
|
+
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")) {
|
|
40325
40322
|
traceIfEnabled(state, Diagnostics.Resolution_of_non_relative_name_failed_trying_with_modern_Node_resolution_features_disabled_to_see_if_npm_library_needs_configuration_update);
|
|
40326
40323
|
const diagnosticState = {
|
|
40327
40324
|
...state,
|
|
@@ -40365,7 +40362,7 @@ ${lanes.join("\n")}
|
|
|
40365
40362
|
resolved2 = loadModuleFromSelfNameReference(extensions2, moduleName, containingDirectory, state2, cache, redirectedReference);
|
|
40366
40363
|
}
|
|
40367
40364
|
if (!resolved2) {
|
|
40368
|
-
if (moduleName.
|
|
40365
|
+
if (moduleName.includes(":")) {
|
|
40369
40366
|
if (traceEnabled) {
|
|
40370
40367
|
trace(host, Diagnostics.Skipping_module_0_that_looks_like_an_absolute_URI_target_file_types_Colon_1, moduleName, formatExtensions(extensions2));
|
|
40371
40368
|
}
|
|
@@ -40454,7 +40451,7 @@ ${lanes.join("\n")}
|
|
|
40454
40451
|
return void 0;
|
|
40455
40452
|
}
|
|
40456
40453
|
function pathContainsNodeModules(path) {
|
|
40457
|
-
return
|
|
40454
|
+
return path.includes(nodeModulesPathPart);
|
|
40458
40455
|
}
|
|
40459
40456
|
function parseNodeModuleFromPath(resolved, isFolder) {
|
|
40460
40457
|
const path = normalizePath(resolved);
|
|
@@ -40490,7 +40487,7 @@ ${lanes.join("\n")}
|
|
|
40490
40487
|
}
|
|
40491
40488
|
function loadModuleFromFileNoImplicitExtensions(extensions, candidate, onlyRecordFailures, state) {
|
|
40492
40489
|
const filename = getBaseFileName(candidate);
|
|
40493
|
-
if (filename.
|
|
40490
|
+
if (!filename.includes(".")) {
|
|
40494
40491
|
return void 0;
|
|
40495
40492
|
}
|
|
40496
40493
|
let extensionless = removeFileExtension(candidate);
|
|
@@ -40647,7 +40644,7 @@ ${lanes.join("\n")}
|
|
|
40647
40644
|
function loadEntrypointsFromTargetExports(target) {
|
|
40648
40645
|
var _a, _b;
|
|
40649
40646
|
if (typeof target === "string" && startsWith(target, "./")) {
|
|
40650
|
-
if (target.
|
|
40647
|
+
if (target.includes("*") && state.host.readDirectory) {
|
|
40651
40648
|
if (target.indexOf("*") !== target.lastIndexOf("*")) {
|
|
40652
40649
|
return false;
|
|
40653
40650
|
}
|
|
@@ -40666,7 +40663,7 @@ ${lanes.join("\n")}
|
|
|
40666
40663
|
});
|
|
40667
40664
|
} else {
|
|
40668
40665
|
const partsAfterFirst = getPathComponents(target).slice(2);
|
|
40669
|
-
if (partsAfterFirst.
|
|
40666
|
+
if (partsAfterFirst.includes("..") || partsAfterFirst.includes(".") || partsAfterFirst.includes("node_modules")) {
|
|
40670
40667
|
return false;
|
|
40671
40668
|
}
|
|
40672
40669
|
const resolvedTarget = combinePaths(scope.packageDirectory, target);
|
|
@@ -41034,7 +41031,7 @@ ${lanes.join("\n")}
|
|
|
41034
41031
|
}
|
|
41035
41032
|
function loadModuleFromImportsOrExports(extensions, state, cache, redirectedReference, moduleName, lookupTable, scope, isImports) {
|
|
41036
41033
|
const loadModuleFromTargetImportOrExport = getLoadModuleFromTargetImportOrExport(extensions, state, cache, redirectedReference, moduleName, scope, isImports);
|
|
41037
|
-
if (!endsWith(moduleName, directorySeparator) && moduleName.
|
|
41034
|
+
if (!endsWith(moduleName, directorySeparator) && !moduleName.includes("*") && hasProperty(lookupTable, moduleName)) {
|
|
41038
41035
|
const target = lookupTable[moduleName];
|
|
41039
41036
|
return loadModuleFromTargetImportOrExport(
|
|
41040
41037
|
target,
|
|
@@ -41045,7 +41042,7 @@ ${lanes.join("\n")}
|
|
|
41045
41042
|
moduleName
|
|
41046
41043
|
);
|
|
41047
41044
|
}
|
|
41048
|
-
const expandingKeys = sort(filter(getOwnKeys(lookupTable), (k) => k.
|
|
41045
|
+
const expandingKeys = sort(filter(getOwnKeys(lookupTable), (k) => k.includes("*") || endsWith(k, "/")), comparePatternKeys);
|
|
41049
41046
|
for (const potentialTarget of expandingKeys) {
|
|
41050
41047
|
if (state.features & 16 /* ExportsPatternTrailers */ && matchesPatternWithTrailer(potentialTarget, moduleName)) {
|
|
41051
41048
|
const target = lookupTable[potentialTarget];
|
|
@@ -41139,7 +41136,7 @@ ${lanes.join("\n")}
|
|
|
41139
41136
|
}
|
|
41140
41137
|
const parts = pathIsRelative(target) ? getPathComponents(target).slice(1) : getPathComponents(target);
|
|
41141
41138
|
const partsAfterFirst = parts.slice(1);
|
|
41142
|
-
if (partsAfterFirst.
|
|
41139
|
+
if (partsAfterFirst.includes("..") || partsAfterFirst.includes(".") || partsAfterFirst.includes("node_modules")) {
|
|
41143
41140
|
if (state.traceEnabled) {
|
|
41144
41141
|
trace(state.host, Diagnostics.package_json_scope_0_has_invalid_type_for_target_of_specifier_1, scope.packageDirectory, moduleName);
|
|
41145
41142
|
}
|
|
@@ -41150,7 +41147,7 @@ ${lanes.join("\n")}
|
|
|
41150
41147
|
}
|
|
41151
41148
|
const resolvedTarget = combinePaths(scope.packageDirectory, target);
|
|
41152
41149
|
const subpathParts = getPathComponents(subpath);
|
|
41153
|
-
if (subpathParts.
|
|
41150
|
+
if (subpathParts.includes("..") || subpathParts.includes(".") || subpathParts.includes("node_modules")) {
|
|
41154
41151
|
if (state.traceEnabled) {
|
|
41155
41152
|
trace(state.host, Diagnostics.package_json_scope_0_has_invalid_type_for_target_of_specifier_1, scope.packageDirectory, moduleName);
|
|
41156
41153
|
}
|
|
@@ -41177,7 +41174,7 @@ ${lanes.join("\n")}
|
|
|
41177
41174
|
if (!Array.isArray(target)) {
|
|
41178
41175
|
traceIfEnabled(state, Diagnostics.Entering_conditional_exports);
|
|
41179
41176
|
for (const condition of getOwnKeys(target)) {
|
|
41180
|
-
if (condition === "default" || state.conditions.
|
|
41177
|
+
if (condition === "default" || state.conditions.includes(condition) || isApplicableVersionedTypesKey(state.conditions, condition)) {
|
|
41181
41178
|
traceIfEnabled(state, Diagnostics.Matched_0_condition_1, isImports ? "imports" : "exports", condition);
|
|
41182
41179
|
const subTarget = target[condition];
|
|
41183
41180
|
const result = loadModuleFromTargetImportOrExport(subTarget, subpath, pattern, key);
|
|
@@ -41238,7 +41235,7 @@ ${lanes.join("\n")}
|
|
|
41238
41235
|
}
|
|
41239
41236
|
function tryLoadInputFileForPath(finalPath, entry, packagePath, isImports2) {
|
|
41240
41237
|
var _a, _b, _c, _d;
|
|
41241
|
-
if (!state.isConfigLookup && (state.compilerOptions.declarationDir || state.compilerOptions.outDir) && finalPath.
|
|
41238
|
+
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)) {
|
|
41242
41239
|
const getCanonicalFileName = hostGetCanonicalFileName({ useCaseSensitiveFileNames: () => useCaseSensitiveFileNames(state) });
|
|
41243
41240
|
const commonSourceDirGuesses = [];
|
|
41244
41241
|
if (state.compilerOptions.rootDir || state.compilerOptions.composite && state.compilerOptions.configFilePath) {
|
|
@@ -41312,7 +41309,7 @@ ${lanes.join("\n")}
|
|
|
41312
41309
|
}
|
|
41313
41310
|
}
|
|
41314
41311
|
function isApplicableVersionedTypesKey(conditions, key) {
|
|
41315
|
-
if (conditions.
|
|
41312
|
+
if (!conditions.includes("types"))
|
|
41316
41313
|
return false;
|
|
41317
41314
|
if (!startsWith(key, "types@"))
|
|
41318
41315
|
return false;
|
|
@@ -41516,7 +41513,7 @@ ${lanes.join("\n")}
|
|
|
41516
41513
|
return mangledName;
|
|
41517
41514
|
}
|
|
41518
41515
|
function unmangleScopedPackageName(typesPackageName) {
|
|
41519
|
-
return
|
|
41516
|
+
return typesPackageName.includes(mangledScopedPackageSeparator) ? "@" + typesPackageName.replace(mangledScopedPackageSeparator, directorySeparator) : typesPackageName;
|
|
41520
41517
|
}
|
|
41521
41518
|
function tryFindNonRelativeModuleNameInCache(cache, moduleName, mode, containingDirectory, redirectedReference, state) {
|
|
41522
41519
|
const result = cache && cache.getFromNonRelativeNameCache(moduleName, mode, containingDirectory, redirectedReference);
|
|
@@ -45231,12 +45228,12 @@ ${lanes.join("\n")}
|
|
|
45231
45228
|
/*currentDirectory*/
|
|
45232
45229
|
void 0
|
|
45233
45230
|
);
|
|
45234
|
-
const mode2 = endsWith(k, "/") ? 1 /* Directory */ :
|
|
45231
|
+
const mode2 = endsWith(k, "/") ? 1 /* Directory */ : k.includes("*") ? 2 /* Pattern */ : 0 /* Exact */;
|
|
45235
45232
|
return tryGetModuleNameFromExports(options, targetFilePath, packageDirectory, subPackageName, exports[k], conditions, mode2);
|
|
45236
45233
|
});
|
|
45237
45234
|
} else {
|
|
45238
45235
|
for (const key of getOwnKeys(exports)) {
|
|
45239
|
-
if (key === "default" || conditions.
|
|
45236
|
+
if (key === "default" || conditions.includes(key) || isApplicableVersionedTypesKey(conditions, key)) {
|
|
45240
45237
|
const subTarget = exports[key];
|
|
45241
45238
|
const result = tryGetModuleNameFromExports(options, targetFilePath, packageDirectory, packageName, subTarget, conditions, mode);
|
|
45242
45239
|
if (result) {
|
|
@@ -45402,7 +45399,7 @@ ${lanes.join("\n")}
|
|
|
45402
45399
|
return fileName;
|
|
45403
45400
|
} else if (fileExtensionIsOneOf(fileName, [".d.mts" /* Dmts */, ".mts" /* Mts */, ".d.cts" /* Dcts */, ".cts" /* Cts */])) {
|
|
45404
45401
|
return noExtension + getJSExtensionForFile(fileName, options);
|
|
45405
|
-
} else if (!fileExtensionIsOneOf(fileName, [".d.ts" /* Dts */]) && fileExtensionIsOneOf(fileName, [".ts" /* Ts */]) &&
|
|
45402
|
+
} else if (!fileExtensionIsOneOf(fileName, [".d.ts" /* Dts */]) && fileExtensionIsOneOf(fileName, [".ts" /* Ts */]) && fileName.includes(".d.")) {
|
|
45406
45403
|
return tryGetRealFileNameForNonJsDeclarationFileName(fileName);
|
|
45407
45404
|
}
|
|
45408
45405
|
switch (allowedEndings[0]) {
|
|
@@ -45428,7 +45425,7 @@ ${lanes.join("\n")}
|
|
|
45428
45425
|
}
|
|
45429
45426
|
function tryGetRealFileNameForNonJsDeclarationFileName(fileName) {
|
|
45430
45427
|
const baseName = getBaseFileName(fileName);
|
|
45431
|
-
if (!endsWith(fileName, ".ts" /* Ts */) || !
|
|
45428
|
+
if (!endsWith(fileName, ".ts" /* Ts */) || !baseName.includes(".d.") || fileExtensionIsOneOf(baseName, [".d.ts" /* Dts */]))
|
|
45432
45429
|
return void 0;
|
|
45433
45430
|
const noExtension = removeExtension(fileName, ".ts" /* Ts */);
|
|
45434
45431
|
const ext = noExtension.substring(noExtension.lastIndexOf("."));
|
|
@@ -51390,12 +51387,12 @@ ${lanes.join("\n")}
|
|
|
51390
51387
|
if (!specifier) {
|
|
51391
51388
|
specifier = getSpecifierForModuleSymbol(chain[0], context);
|
|
51392
51389
|
}
|
|
51393
|
-
if (!(context.flags & 67108864 /* AllowNodeModulesRelativePaths */) && getEmitModuleResolutionKind(compilerOptions) !== 1 /* Classic */ && specifier.
|
|
51390
|
+
if (!(context.flags & 67108864 /* AllowNodeModulesRelativePaths */) && getEmitModuleResolutionKind(compilerOptions) !== 1 /* Classic */ && specifier.includes("/node_modules/")) {
|
|
51394
51391
|
const oldSpecifier = specifier;
|
|
51395
51392
|
if (getEmitModuleResolutionKind(compilerOptions) === 3 /* Node16 */ || getEmitModuleResolutionKind(compilerOptions) === 99 /* NodeNext */) {
|
|
51396
51393
|
const swappedMode = (contextFile == null ? void 0 : contextFile.impliedNodeFormat) === 99 /* ESNext */ ? 1 /* CommonJS */ : 99 /* ESNext */;
|
|
51397
51394
|
specifier = getSpecifierForModuleSymbol(chain[0], context, swappedMode);
|
|
51398
|
-
if (specifier.
|
|
51395
|
+
if (specifier.includes("/node_modules/")) {
|
|
51399
51396
|
specifier = oldSpecifier;
|
|
51400
51397
|
} else {
|
|
51401
51398
|
assertion = factory.createImportTypeAssertionContainer(factory.createAssertClause(factory.createNodeArray([
|
|
@@ -52101,7 +52098,7 @@ ${lanes.join("\n")}
|
|
|
52101
52098
|
for (const group2 of groups) {
|
|
52102
52099
|
if (group2.length > 1) {
|
|
52103
52100
|
statements = [
|
|
52104
|
-
...filter(statements, (s) => group2.
|
|
52101
|
+
...filter(statements, (s) => !group2.includes(s)),
|
|
52105
52102
|
factory.createExportDeclaration(
|
|
52106
52103
|
/*modifiers*/
|
|
52107
52104
|
void 0,
|
|
@@ -65478,7 +65475,7 @@ ${lanes.join("\n")}
|
|
|
65478
65475
|
const param = declaration;
|
|
65479
65476
|
if (isIdentifier(param.name)) {
|
|
65480
65477
|
const originalKeywordKind = identifierToKeywordKind(param.name);
|
|
65481
|
-
if ((isCallSignatureDeclaration(param.parent) || isMethodSignature(param.parent) || isFunctionTypeNode(param.parent)) && param.parent.parameters.
|
|
65478
|
+
if ((isCallSignatureDeclaration(param.parent) || isMethodSignature(param.parent) || isFunctionTypeNode(param.parent)) && param.parent.parameters.includes(param) && (resolveName(
|
|
65482
65479
|
param,
|
|
65483
65480
|
param.name.escapedText,
|
|
65484
65481
|
788968 /* Type */,
|
|
@@ -70866,7 +70863,7 @@ ${lanes.join("\n")}
|
|
|
70866
70863
|
return getJsxElementTypeAt(node) || anyType;
|
|
70867
70864
|
}
|
|
70868
70865
|
function isHyphenatedJsxName(name) {
|
|
70869
|
-
return
|
|
70866
|
+
return name.includes("-");
|
|
70870
70867
|
}
|
|
70871
70868
|
function isJsxIntrinsicTagName(tagName) {
|
|
70872
70869
|
return isIdentifier(tagName) && isIntrinsicJsxName(tagName.escapedText) || isJsxNamespacedName(tagName);
|
|
@@ -86029,7 +86026,7 @@ ${lanes.join("\n")}
|
|
|
86029
86026
|
return false;
|
|
86030
86027
|
}
|
|
86031
86028
|
function checkGrammarNumericLiteral(node) {
|
|
86032
|
-
const isFractional = getTextOfNode(node).
|
|
86029
|
+
const isFractional = getTextOfNode(node).includes(".");
|
|
86033
86030
|
const isScientific = node.numericLiteralFlags & 16 /* Scientific */;
|
|
86034
86031
|
if (isFractional || isScientific) {
|
|
86035
86032
|
return;
|
|
@@ -109486,7 +109483,7 @@ ${lanes.join("\n")}
|
|
|
109486
109483
|
}
|
|
109487
109484
|
function hasInternalAnnotation(range, currentSourceFile) {
|
|
109488
109485
|
const comment = currentSourceFile.text.substring(range.pos, range.end);
|
|
109489
|
-
return
|
|
109486
|
+
return comment.includes("@internal");
|
|
109490
109487
|
}
|
|
109491
109488
|
function isInternalDeclaration(node, currentSourceFile) {
|
|
109492
109489
|
const parseTreeNode = getParseTreeNode(node);
|
|
@@ -113943,7 +113940,7 @@ ${lanes.join("\n")}
|
|
|
113943
113940
|
/*jsxAttributeEscape*/
|
|
113944
113941
|
false
|
|
113945
113942
|
);
|
|
113946
|
-
return !(expression.numericLiteralFlags & 448 /* WithSpecifier */) && !
|
|
113943
|
+
return !(expression.numericLiteralFlags & 448 /* WithSpecifier */) && !text.includes(tokenToString(25 /* DotToken */)) && !text.includes(String.fromCharCode(69 /* E */)) && !text.includes(String.fromCharCode(101 /* e */));
|
|
113947
113944
|
} else if (isAccessExpression(expression)) {
|
|
113948
113945
|
const constantValue = getConstantValue(expression);
|
|
113949
113946
|
return typeof constantValue === "number" && isFinite(constantValue) && constantValue >= 0 && Math.floor(constantValue) === constantValue;
|
|
@@ -118771,7 +118768,7 @@ ${lanes.join("\n")}
|
|
|
118771
118768
|
const resultFromDts = getRedirectReferenceForResolutionFromSourceOfProject(file.path);
|
|
118772
118769
|
if (resultFromDts)
|
|
118773
118770
|
return resultFromDts;
|
|
118774
|
-
if (!host.realpath || !options.preserveSymlinks || !
|
|
118771
|
+
if (!host.realpath || !options.preserveSymlinks || !file.originalFileName.includes(nodeModulesPathPart))
|
|
118775
118772
|
return void 0;
|
|
118776
118773
|
const realDeclarationPath = toPath3(host.realpath(file.originalFileName));
|
|
118777
118774
|
return realDeclarationPath === file.path ? void 0 : getRedirectReferenceForResolutionFromSourceOfProject(realDeclarationPath);
|
|
@@ -120029,7 +120026,7 @@ ${lanes.join("\n")}
|
|
|
120029
120026
|
const path = toPath3(fileName);
|
|
120030
120027
|
if (useSourceOfProjectReferenceRedirect) {
|
|
120031
120028
|
let source = getSourceOfProjectReferenceRedirect(path);
|
|
120032
|
-
if (!source && host.realpath && options.preserveSymlinks && isDeclarationFileName(fileName) &&
|
|
120029
|
+
if (!source && host.realpath && options.preserveSymlinks && isDeclarationFileName(fileName) && fileName.includes(nodeModulesPathPart)) {
|
|
120033
120030
|
const realPath2 = toPath3(host.realpath(fileName));
|
|
120034
120031
|
if (realPath2 !== path)
|
|
120035
120032
|
source = getSourceOfProjectReferenceRedirect(realPath2);
|
|
@@ -121389,7 +121386,7 @@ ${lanes.join("\n")}
|
|
|
121389
121386
|
var _a;
|
|
121390
121387
|
if (!host.getResolvedProjectReferences() || containsIgnoredPath(directory))
|
|
121391
121388
|
return;
|
|
121392
|
-
if (!originalRealpath || !
|
|
121389
|
+
if (!originalRealpath || !directory.includes(nodeModulesPathPart))
|
|
121393
121390
|
return;
|
|
121394
121391
|
const symlinkCache = host.getSymlinkCache();
|
|
121395
121392
|
const directoryPath = ensureTrailingDirectorySeparator(host.toPath(directory));
|
|
@@ -121417,7 +121414,7 @@ ${lanes.join("\n")}
|
|
|
121417
121414
|
if (!symlinkedDirectories)
|
|
121418
121415
|
return false;
|
|
121419
121416
|
const fileOrDirectoryPath = host.toPath(fileOrDirectory);
|
|
121420
|
-
if (!
|
|
121417
|
+
if (!fileOrDirectoryPath.includes(nodeModulesPathPart))
|
|
121421
121418
|
return false;
|
|
121422
121419
|
if (isFile && ((_a = symlinkCache.getSymlinkedFiles()) == null ? void 0 : _a.has(fileOrDirectoryPath)))
|
|
121423
121420
|
return true;
|
|
@@ -123465,7 +123462,7 @@ ${lanes.join("\n")}
|
|
|
123465
123462
|
if (endsWith(path, "/node_modules/.staging")) {
|
|
123466
123463
|
return removeSuffix(path, "/.staging");
|
|
123467
123464
|
}
|
|
123468
|
-
return some(ignoredPaths, (searchPath) =>
|
|
123465
|
+
return some(ignoredPaths, (searchPath) => path.includes(searchPath)) ? void 0 : path;
|
|
123469
123466
|
}
|
|
123470
123467
|
function perceivedOsRootLengthForWatching(pathComponents2, length2) {
|
|
123471
123468
|
if (length2 <= 1)
|
|
@@ -128314,7 +128311,7 @@ ${lanes.join("\n")}
|
|
|
128314
128311
|
|
|
128315
128312
|
// src/jsTyping/shared.ts
|
|
128316
128313
|
function hasArgument(argumentName) {
|
|
128317
|
-
return sys.args.
|
|
128314
|
+
return sys.args.includes(argumentName);
|
|
128318
128315
|
}
|
|
128319
128316
|
function findArgument(argumentName) {
|
|
128320
128317
|
const index = sys.args.indexOf(argumentName);
|
|
@@ -131142,7 +131139,7 @@ ${lanes.join("\n")}
|
|
|
131142
131139
|
return false;
|
|
131143
131140
|
}
|
|
131144
131141
|
function getNodeModulesPackageNameFromFileName(importedFileName, moduleSpecifierResolutionHost) {
|
|
131145
|
-
if (!
|
|
131142
|
+
if (!importedFileName.includes("node_modules")) {
|
|
131146
131143
|
return void 0;
|
|
131147
131144
|
}
|
|
131148
131145
|
const specifier = ts_moduleSpecifiers_exports.getNodeModulesPackageName(
|
|
@@ -131759,7 +131756,7 @@ ${lanes.join("\n")}
|
|
|
131759
131756
|
var _a;
|
|
131760
131757
|
const isExcluded = excludePatterns && ((fileName) => excludePatterns.some((p) => p.test(fileName)));
|
|
131761
131758
|
for (const ambient of checker.getAmbientModules()) {
|
|
131762
|
-
if (!
|
|
131759
|
+
if (!ambient.name.includes("*") && !(excludePatterns && ((_a = ambient.declarations) == null ? void 0 : _a.every((d) => isExcluded(d.getSourceFile().fileName))))) {
|
|
131763
131760
|
cb(
|
|
131764
131761
|
ambient,
|
|
131765
131762
|
/*sourceFile*/
|
|
@@ -140793,7 +140790,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
|
|
|
140793
140790
|
return symbolId;
|
|
140794
140791
|
}
|
|
140795
140792
|
function checkForUsedDeclarations(node) {
|
|
140796
|
-
if (node === targetRange.range || isReadonlyArray(targetRange.range) && targetRange.range.
|
|
140793
|
+
if (node === targetRange.range || isReadonlyArray(targetRange.range) && targetRange.range.includes(node)) {
|
|
140797
140794
|
return;
|
|
140798
140795
|
}
|
|
140799
140796
|
const sym = isIdentifier(node) ? getSymbolReferencedByIdentifier(node) : checker.getSymbolAtLocation(node);
|
|
@@ -142659,7 +142656,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
|
|
|
142659
142656
|
return char >= 97 /* a */ && char <= 122 /* z */ || char >= 65 /* A */ && char <= 90 /* Z */ || char >= 48 /* _0 */ && char <= 57 /* _9 */;
|
|
142660
142657
|
}
|
|
142661
142658
|
function isNodeModulesFile(path) {
|
|
142662
|
-
return
|
|
142659
|
+
return path.includes("/node_modules/");
|
|
142663
142660
|
}
|
|
142664
142661
|
}
|
|
142665
142662
|
function getRenameInfo2(fileName, position, preferences) {
|
|
@@ -152500,7 +152497,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
|
|
|
152500
152497
|
}
|
|
152501
152498
|
}
|
|
152502
152499
|
function isCallbackLike(checker, sourceFile, name) {
|
|
152503
|
-
return !!ts_FindAllReferences_exports.Core.eachSymbolReferenceInFile(name, checker, sourceFile, (reference) => isIdentifier(reference) && isCallExpression(reference.parent) && reference.parent.arguments.
|
|
152500
|
+
return !!ts_FindAllReferences_exports.Core.eachSymbolReferenceInFile(name, checker, sourceFile, (reference) => isIdentifier(reference) && isCallExpression(reference.parent) && reference.parent.arguments.includes(reference));
|
|
152504
152501
|
}
|
|
152505
152502
|
function isLastParameter(func, parameter, isFixAll) {
|
|
152506
152503
|
const parameters = func.parameters;
|
|
@@ -160352,7 +160349,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
|
|
|
160352
160349
|
function addReplacementSpans(text, textStart, names) {
|
|
160353
160350
|
const span = getDirectoryFragmentTextSpan(text, textStart);
|
|
160354
160351
|
const wholeSpan = text.length === 0 ? void 0 : createTextSpan(textStart, text.length);
|
|
160355
|
-
return names.map(({ name, kind, extension }) =>
|
|
160352
|
+
return names.map(({ name, kind, extension }) => name.includes(directorySeparator) || name.includes(altDirectorySeparator) ? { name, kind, extension, span: wholeSpan } : { name, kind, extension, span });
|
|
160356
160353
|
}
|
|
160357
160354
|
function getStringLiteralCompletionsFromModuleNames(sourceFile, node, compilerOptions, host, typeChecker, preferences) {
|
|
160358
160355
|
return addReplacementSpans(node.text, node.getStart(sourceFile) + 1, getStringLiteralCompletionsFromModuleNamesWorker(sourceFile, node, compilerOptions, host, typeChecker, preferences));
|
|
@@ -160678,7 +160675,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
|
|
|
160678
160675
|
}
|
|
160679
160676
|
if (target && typeof target === "object" && !isArray(target)) {
|
|
160680
160677
|
for (const condition in target) {
|
|
160681
|
-
if (condition === "default" || conditions.
|
|
160678
|
+
if (condition === "default" || conditions.includes(condition) || isApplicableVersionedTypesKey(conditions, condition)) {
|
|
160682
160679
|
const pattern = target[condition];
|
|
160683
160680
|
return getPatternFromFirstMatchingCondition(pattern, conditions);
|
|
160684
160681
|
}
|
|
@@ -160690,7 +160687,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
|
|
|
160690
160687
|
}
|
|
160691
160688
|
function getCompletionsForPathMapping(path, patterns, fragment, packageDirectory, extensionOptions, host) {
|
|
160692
160689
|
if (!endsWith(path, "*")) {
|
|
160693
|
-
return !
|
|
160690
|
+
return !path.includes("*") ? justPathMappingName(path, "script" /* scriptElement */) : emptyArray;
|
|
160694
160691
|
}
|
|
160695
160692
|
const pathPrefix = path.slice(0, path.length - 1);
|
|
160696
160693
|
const remainingFragment = tryRemovePrefix(fragment, pathPrefix);
|
|
@@ -160760,7 +160757,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
|
|
|
160760
160757
|
}
|
|
160761
160758
|
function getAmbientModuleCompletions(fragment, fragmentDirectory, checker) {
|
|
160762
160759
|
const ambientModules = checker.getAmbientModules().map((sym) => stripQuotes(sym.name));
|
|
160763
|
-
const nonRelativeModuleNames = ambientModules.filter((moduleName) => startsWith(moduleName, fragment) && moduleName.
|
|
160760
|
+
const nonRelativeModuleNames = ambientModules.filter((moduleName) => startsWith(moduleName, fragment) && !moduleName.includes("*"));
|
|
160764
160761
|
if (fragmentDirectory !== void 0) {
|
|
160765
160762
|
const moduleNameWithSeparator = ensureTrailingDirectorySeparator(fragmentDirectory);
|
|
160766
160763
|
return nonRelativeModuleNames.map((nonRelativeModuleName) => removePrefix(nonRelativeModuleName, moduleNameWithSeparator));
|
|
@@ -160874,7 +160871,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
|
|
|
160874
160871
|
return false;
|
|
160875
160872
|
}
|
|
160876
160873
|
function containsSlash(fragment) {
|
|
160877
|
-
return
|
|
160874
|
+
return fragment.includes(directorySeparator);
|
|
160878
160875
|
}
|
|
160879
160876
|
function isRequireCallArgument(node) {
|
|
160880
160877
|
return isCallExpression(node.parent) && firstOrUndefined(node.parent.arguments) === node && isIdentifier(node.parent.expression) && node.parent.expression.escapedText === "require";
|
|
@@ -169767,7 +169764,7 @@ ${options.prefix}` : "\n" : options.prefix
|
|
|
169767
169764
|
return positionIsASICandidate(context.currentTokenSpan.end, context.currentTokenParent, context.sourceFile);
|
|
169768
169765
|
}
|
|
169769
169766
|
function isNotPropertyAccessOnIntegerLiteral(context) {
|
|
169770
|
-
return !isPropertyAccessExpression(context.contextNode) || !isNumericLiteral(context.contextNode.expression) || context.contextNode.expression.getText().
|
|
169767
|
+
return !isPropertyAccessExpression(context.contextNode) || !isNumericLiteral(context.contextNode.expression) || context.contextNode.expression.getText().includes(".");
|
|
169771
169768
|
}
|
|
169772
169769
|
var init_rules = __esm({
|
|
169773
169770
|
"src/services/formatting/rules.ts"() {
|
|
@@ -170963,7 +170960,7 @@ ${options.prefix}` : "\n" : options.prefix
|
|
|
170963
170960
|
}
|
|
170964
170961
|
const containerList = getListByPosition(position, precedingToken.parent, sourceFile);
|
|
170965
170962
|
if (containerList && !rangeContainsRange(containerList, precedingToken)) {
|
|
170966
|
-
const useTheSameBaseIndentation = [218 /* FunctionExpression */, 219 /* ArrowFunction */].
|
|
170963
|
+
const useTheSameBaseIndentation = [218 /* FunctionExpression */, 219 /* ArrowFunction */].includes(currentToken.parent.kind);
|
|
170967
170964
|
const indentSize = useTheSameBaseIndentation ? 0 : options.indentSize;
|
|
170968
170965
|
return getActualIndentationForListStartLine(containerList, sourceFile, options) + indentSize;
|
|
170969
170966
|
}
|
|
@@ -172554,7 +172551,7 @@ ${options.prefix}` : "\n" : options.prefix
|
|
|
172554
172551
|
|
|
172555
172552
|
// src/server/scriptInfo.ts
|
|
172556
172553
|
function isDynamicFileName(fileName) {
|
|
172557
|
-
return fileName[0] === "^" || (
|
|
172554
|
+
return fileName[0] === "^" || (fileName.includes("walkThroughSnippet:/") || fileName.includes("untitled:/")) && getBaseFileName(fileName)[0] === "^" || fileName.includes(":^") && !fileName.includes(directorySeparator);
|
|
172558
172555
|
}
|
|
172559
172556
|
function ensurePrimaryProjectKind(project) {
|
|
172560
172557
|
if (!project || project.projectKind === 3 /* AutoImportProvider */ || project.projectKind === 4 /* Auxiliary */) {
|
|
@@ -174204,7 +174201,7 @@ ${options.prefix}` : "\n" : options.prefix
|
|
|
174204
174201
|
}
|
|
174205
174202
|
removeExistingTypings(include) {
|
|
174206
174203
|
const existing = getAutomaticTypeDirectiveNames(this.getCompilerOptions(), this.directoryStructureHost);
|
|
174207
|
-
return include.filter((i) => existing.
|
|
174204
|
+
return include.filter((i) => !existing.includes(i));
|
|
174208
174205
|
}
|
|
174209
174206
|
updateGraphWorker() {
|
|
174210
174207
|
var _a, _b;
|
|
@@ -178401,7 +178398,7 @@ Dynamic files must always be opened with service's current directory or service
|
|
|
178401
178398
|
this.logger.info(`Excluding files based on rule ${name} matching file '${root}'`);
|
|
178402
178399
|
if (rule2.types) {
|
|
178403
178400
|
for (const type of rule2.types) {
|
|
178404
|
-
if (typeAcqInclude.
|
|
178401
|
+
if (!typeAcqInclude.includes(type)) {
|
|
178405
178402
|
typeAcqInclude.push(type);
|
|
178406
178403
|
}
|
|
178407
178404
|
}
|
|
@@ -178420,13 +178417,13 @@ Dynamic files must always be opened with service's current directory or service
|
|
|
178420
178417
|
return groupNumberOrString;
|
|
178421
178418
|
}).join("");
|
|
178422
178419
|
});
|
|
178423
|
-
if (excludeRules.
|
|
178420
|
+
if (!excludeRules.includes(processedRule)) {
|
|
178424
178421
|
excludeRules.push(processedRule);
|
|
178425
178422
|
}
|
|
178426
178423
|
}
|
|
178427
178424
|
} else {
|
|
178428
178425
|
const escaped = _ProjectService.escapeFilenameForRegex(root);
|
|
178429
|
-
if (excludeRules.
|
|
178426
|
+
if (!excludeRules.includes(escaped)) {
|
|
178430
178427
|
excludeRules.push(escaped);
|
|
178431
178428
|
}
|
|
178432
178429
|
}
|
|
@@ -178450,7 +178447,7 @@ Dynamic files must always be opened with service's current directory or service
|
|
|
178450
178447
|
this.logger.info(`Excluded '${normalizedNames[i]}' because it matched ${cleanedTypingName} from the legacy safelist`);
|
|
178451
178448
|
excludedFiles.push(normalizedNames[i]);
|
|
178452
178449
|
exclude = true;
|
|
178453
|
-
if (typeAcqInclude.
|
|
178450
|
+
if (!typeAcqInclude.includes(typeName)) {
|
|
178454
178451
|
typeAcqInclude.push(typeName);
|
|
178455
178452
|
}
|
|
178456
178453
|
}
|
|
@@ -181990,7 +181987,7 @@ ${e.message}`;
|
|
|
181990
181987
|
if (languageServiceDisabled) {
|
|
181991
181988
|
return;
|
|
181992
181989
|
}
|
|
181993
|
-
const fileNamesInProject = fileNames.filter((value) => !
|
|
181990
|
+
const fileNamesInProject = fileNames.filter((value) => !value.includes("lib.d.ts"));
|
|
181994
181991
|
if (fileNamesInProject.length === 0) {
|
|
181995
181992
|
return;
|
|
181996
181993
|
}
|
|
@@ -185252,7 +185249,6 @@ ${e.message}`;
|
|
|
185252
185249
|
startsWithDirectory: () => startsWithDirectory,
|
|
185253
185250
|
startsWithUnderscore: () => startsWithUnderscore,
|
|
185254
185251
|
startsWithUseStrict: () => startsWithUseStrict,
|
|
185255
|
-
stringContains: () => stringContains,
|
|
185256
185252
|
stringContainsAt: () => stringContainsAt,
|
|
185257
185253
|
stringToToken: () => stringToToken,
|
|
185258
185254
|
stripQuotes: () => stripQuotes,
|
|
@@ -187661,7 +187657,6 @@ ${e.message}`;
|
|
|
187661
187657
|
startsWithDirectory: () => startsWithDirectory,
|
|
187662
187658
|
startsWithUnderscore: () => startsWithUnderscore,
|
|
187663
187659
|
startsWithUseStrict: () => startsWithUseStrict,
|
|
187664
|
-
stringContains: () => stringContains,
|
|
187665
187660
|
stringContainsAt: () => stringContainsAt,
|
|
187666
187661
|
stringToToken: () => stringToToken,
|
|
187667
187662
|
stripQuotes: () => stripQuotes,
|