fix(language-service): implement realpath to resolve symlinks (#40593)
The `LanguageServiceAdapter` must implement `realpath` in order to resolve symlinks in `node_modules`. Local libraries are often symlinked in `node_modules` by adding a local dependency in `package.json`. Fix https://github.com/angular/vscode-ng-language-service/issues/1083 PR Close #40593
This commit is contained in:
parent
27a818a0e7
commit
e43cba5c82
@ -51,6 +51,14 @@ export class LanguageServiceAdapter implements NgCompilerAdapter {
|
|||||||
return this.project.projectService.toCanonicalFileName(fileName);
|
return this.project.projectService.toCanonicalFileName(fileName);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Return the real path of a symlink. This method is required in order to
|
||||||
|
* resolve symlinks in node_modules.
|
||||||
|
*/
|
||||||
|
realpath(path: string): string {
|
||||||
|
return this.project.realpath?.(path) ?? path;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* readResource() is an Angular-specific method for reading files that are not
|
* readResource() is an Angular-specific method for reading files that are not
|
||||||
* managed by the TS compiler host, namely templates and stylesheets.
|
* managed by the TS compiler host, namely templates and stylesheets.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user