Vscode-ng-language-service: Paths with "#" not resolved correctly

Created on 19 Aug 2020  路  2Comments  路  Source: angular/vscode-ng-language-service

If there is a # in the path of a project, the extension will not work
for example:
F:\Source\C#\My Project\client

But if we remove #, the Angular language service will work properly

bug lib

Most helpful comment

This is a bug in Angular's URL resolver:

https://github.com/angular/angular/blob/0aa53cdd6081177ddf384eed511e10e7db458c33/packages/compiler/src/url_resolver.ts#L55-L71

As a simple reproduction, resolve('a/b/c#/d.ts', './d.html') will give back a/b/d.ts but should give back a/b/c#/d.html.

This manifests itself in the language service because when initializing a project, TypeScript calls the Angular language service plugin for external files. We return external files as the set of external templates in the project, which we compute using the url resolver:

https://github.com/angular/angular/blob/0aa53cdd6081177ddf384eed511e10e7db458c33/packages/language-service/src/typescript_host.ts#L194-L206

All 2 comments

This is a bug in Angular's URL resolver:

https://github.com/angular/angular/blob/0aa53cdd6081177ddf384eed511e10e7db458c33/packages/compiler/src/url_resolver.ts#L55-L71

As a simple reproduction, resolve('a/b/c#/d.ts', './d.html') will give back a/b/d.ts but should give back a/b/c#/d.html.

This manifests itself in the language service because when initializing a project, TypeScript calls the Angular language service plugin for external files. We return external files as the set of external templates in the project, which we compute using the url resolver:

https://github.com/angular/angular/blob/0aa53cdd6081177ddf384eed511e10e7db458c33/packages/language-service/src/typescript_host.ts#L194-L206

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

_This action has been performed automatically by a bot._

Was this page helpful?
0 / 5 - 0 ratings

Related issues

Liero picture Liero  路  3Comments

frederikschubert picture frederikschubert  路  3Comments

kondi picture kondi  路  4Comments

pfeigl picture pfeigl  路  6Comments

fxck picture fxck  路  6Comments