Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 4e1d780

Browse files
ivanwondermatsko
authored andcommitted
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
1 parent 44f9fa6 commit 4e1d780

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

‎packages/language-service/src/reflector_host.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,13 +19,18 @@ class ReflectorModuleModuleResolutionHost implements ts.ModuleResolutionHost, Me
1919
});
2020

2121
readonly directoryExists?: (directoryName: string) => boolean;
22+
// Resolve a symbolic link.
23+
realpath?: (path: string) => string;
2224

2325
constructor(
2426
private readonly tsLSHost: ts.LanguageServiceHost,
2527
private readonly getProgram: () => ts.Program) {
2628
if (tsLSHost.directoryExists) {
2729
this.directoryExists = directoryName => tsLSHost.directoryExists !(directoryName);
2830
}
31+
if (tsLSHost.realpath) {
32+
this.realpath = path => tsLSHost.realpath !(path);
33+
}
2934
}
3035

3136
fileExists(fileName: string): boolean {

0 commit comments

Comments
 (0)