mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-05-18 17:27:54 -05:00
Update symlink cache from AutoImportProvider resolution even if host project already contains the file via its realpath (#46830)
This commit is contained in:
@@ -1944,15 +1944,15 @@ namespace ts.server {
|
||||
for (const resolution of resolutions) {
|
||||
if (!resolution.resolvedFileName) continue;
|
||||
const { resolvedFileName, originalPath } = resolution;
|
||||
if (originalPath) {
|
||||
symlinkCache.setSymlinkedDirectoryFromSymlinkedFile(originalPath, resolvedFileName);
|
||||
}
|
||||
if (!program.getSourceFile(resolvedFileName) && (!originalPath || !program.getSourceFile(originalPath))) {
|
||||
rootNames = append(rootNames, resolvedFileName);
|
||||
// Avoid creating a large project that would significantly slow down time to editor interactivity
|
||||
if (dependencySelection === PackageJsonAutoImportPreference.Auto && rootNames.length > this.maxDependencies) {
|
||||
return ts.emptyArray;
|
||||
}
|
||||
if (originalPath) {
|
||||
symlinkCache.setSymlinkedDirectoryFromSymlinkedFile(originalPath, resolvedFileName);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user