fix(language-service): resolve the real path for symlink (#35895)
when AOT resolves the module name, it will preserve the path of the symlink, but the ts-server will return the real path for symlink. PR Close #35895
This commit is contained in:
parent
44f9fa6ce5
commit
4e1d780554
|
@ -19,6 +19,8 @@ class ReflectorModuleModuleResolutionHost implements ts.ModuleResolutionHost, Me
|
|||
});
|
||||
|
||||
readonly directoryExists?: (directoryName: string) => boolean;
|
||||
// Resolve a symbolic link.
|
||||
realpath?: (path: string) => string;
|
||||
|
||||
constructor(
|
||||
private readonly tsLSHost: ts.LanguageServiceHost,
|
||||
|
@ -26,6 +28,9 @@ class ReflectorModuleModuleResolutionHost implements ts.ModuleResolutionHost, Me
|
|||
if (tsLSHost.directoryExists) {
|
||||
this.directoryExists = directoryName => tsLSHost.directoryExists !(directoryName);
|
||||
}
|
||||
if (tsLSHost.realpath) {
|
||||
this.realpath = path => tsLSHost.realpath !(path);
|
||||
}
|
||||
}
|
||||
|
||||
fileExists(fileName: string): boolean {
|
||||
|
|
Loading…
Reference in New Issue