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;
|
readonly directoryExists?: (directoryName: string) => boolean;
|
||||||
|
// Resolve a symbolic link.
|
||||||
|
realpath?: (path: string) => string;
|
||||||
|
|
||||||
constructor(
|
constructor(
|
||||||
private readonly tsLSHost: ts.LanguageServiceHost,
|
private readonly tsLSHost: ts.LanguageServiceHost,
|
||||||
@ -26,6 +28,9 @@ class ReflectorModuleModuleResolutionHost implements ts.ModuleResolutionHost, Me
|
|||||||
if (tsLSHost.directoryExists) {
|
if (tsLSHost.directoryExists) {
|
||||||
this.directoryExists = directoryName => tsLSHost.directoryExists !(directoryName);
|
this.directoryExists = directoryName => tsLSHost.directoryExists !(directoryName);
|
||||||
}
|
}
|
||||||
|
if (tsLSHost.realpath) {
|
||||||
|
this.realpath = path => tsLSHost.realpath !(path);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fileExists(fileName: string): boolean {
|
fileExists(fileName: string): boolean {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user