mirror of
https://github.com/microsoft/TypeScript.git
synced 2025-11-18 17:21:48 +00:00
Fix issue with trailing directory separator not present if symlink wasnt detected by program (#55865)
This commit is contained in:
@@ -8802,9 +8802,15 @@ export function hasZeroOrOneAsteriskCharacter(str: string): boolean {
|
||||
|
||||
/** @internal */
|
||||
export interface SymlinkedDirectory {
|
||||
/** Matches the casing returned by `realpath`. Used to compute the `realpath` of children. */
|
||||
/**
|
||||
* Matches the casing returned by `realpath`. Used to compute the `realpath` of children.
|
||||
* Always has trailing directory separator
|
||||
*/
|
||||
real: string;
|
||||
/** toPath(real). Stored to avoid repeated recomputation. */
|
||||
/**
|
||||
* toPath(real). Stored to avoid repeated recomputation.
|
||||
* Always has trailing directory separator
|
||||
*/
|
||||
realPath: Path;
|
||||
}
|
||||
|
||||
@@ -8859,7 +8865,7 @@ export function createSymlinkCache(cwd: string, getCanonicalFileName: GetCanonic
|
||||
if (!containsIgnoredPath(symlinkPath)) {
|
||||
symlinkPath = ensureTrailingDirectorySeparator(symlinkPath);
|
||||
if (real !== false && !symlinkedDirectories?.has(symlinkPath)) {
|
||||
(symlinkedDirectoriesByRealpath ||= createMultiMap()).add(ensureTrailingDirectorySeparator(real.realPath), symlink);
|
||||
(symlinkedDirectoriesByRealpath ||= createMultiMap()).add(real.realPath, symlink);
|
||||
}
|
||||
(symlinkedDirectories || (symlinkedDirectories = new Map())).set(symlinkPath, real);
|
||||
}
|
||||
@@ -8882,7 +8888,10 @@ export function createSymlinkCache(cwd: string, getCanonicalFileName: GetCanonic
|
||||
if (commonResolved && commonOriginal) {
|
||||
cache.setSymlinkedDirectory(
|
||||
commonOriginal,
|
||||
{ real: commonResolved, realPath: toPath(commonResolved, cwd, getCanonicalFileName) },
|
||||
{
|
||||
real: ensureTrailingDirectorySeparator(commonResolved),
|
||||
realPath: ensureTrailingDirectorySeparator(toPath(commonResolved, cwd, getCanonicalFileName)),
|
||||
},
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user