mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-05-23 07:07:09 -05:00
Include type reference directives in symlink cache, wait until program is present to create it (#44259)
* Fix discovery of more pnpm symlinks * Add some tests * Never show pnpm paths in auto imports, even if there’s no other path * Import statement completions can return none * Fix tests * Add failing test showing poor symlink cache reuse * Fix test, fails for right reasons now * Preserve cache built up during program creation, then fill in with program resolutions * Remove obsolete comment * Remove obsolete type assertion * Revert fully filtering out ignored paths
This commit is contained in:
@@ -294,11 +294,8 @@ namespace ts.moduleSpecifiers {
|
||||
const result = forEach(targets, p => !(shouldFilterIgnoredPaths && containsIgnoredPath(p)) && cb(p, referenceRedirect === p));
|
||||
if (result) return result;
|
||||
}
|
||||
const links = host.getSymlinkCache
|
||||
? host.getSymlinkCache()
|
||||
: discoverProbableSymlinks(host.getSourceFiles(), getCanonicalFileName, cwd);
|
||||
|
||||
const symlinkedDirectories = links.getSymlinkedDirectoriesByRealpath();
|
||||
const symlinkedDirectories = host.getSymlinkCache?.().getSymlinkedDirectoriesByRealpath();
|
||||
const fullImportedFileName = getNormalizedAbsolutePath(importedFileName, cwd);
|
||||
const result = symlinkedDirectories && forEachAncestorDirectory(getDirectoryPath(fullImportedFileName), realPathDirectory => {
|
||||
const symlinkDirectories = symlinkedDirectories.get(ensureTrailingDirectorySeparator(toPath(realPathDirectory, cwd, getCanonicalFileName)));
|
||||
|
||||
Reference in New Issue
Block a user