mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-05-30 01:04:49 -05:00
Stop looking for the default configured project at node_modules (#35011)
* Optionally stop looking for the default configured project at node_modules * Make stopping at node_modules non-optional * Generalize and simplify the change - node_modules files don't have default configured projects
This commit is contained in:
@@ -852,4 +852,8 @@ namespace ts {
|
||||
directory = parentPath;
|
||||
}
|
||||
}
|
||||
|
||||
export function isNodeModulesDirectory(dirPath: Path) {
|
||||
return endsWith(dirPath, "/node_modules");
|
||||
}
|
||||
}
|
||||
@@ -428,10 +428,6 @@ namespace ts {
|
||||
return cache && cache.get(moduleName);
|
||||
}
|
||||
|
||||
function isNodeModulesDirectory(dirPath: Path) {
|
||||
return endsWith(dirPath, "/node_modules");
|
||||
}
|
||||
|
||||
function isNodeModulesAtTypesDirectory(dirPath: Path) {
|
||||
return endsWith(dirPath, "/node_modules/@types");
|
||||
}
|
||||
|
||||
@@ -1664,6 +1664,13 @@ namespace ts.server {
|
||||
const jsconfigFileName = asNormalizedPath(combinePaths(searchPath, "jsconfig.json"));
|
||||
result = action(jsconfigFileName, combinePaths(canonicalSearchPath, "jsconfig.json"));
|
||||
if (result) return jsconfigFileName;
|
||||
|
||||
// If we started within node_modules, don't look outside node_modules.
|
||||
// Otherwise, we might pick up a very large project and pull in the world,
|
||||
// causing an editor delay.
|
||||
if (isNodeModulesDirectory(canonicalSearchPath)) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
const parentPath = asNormalizedPath(getDirectoryPath(searchPath));
|
||||
|
||||
Reference in New Issue
Block a user