angular-cn/packages/language-service/test/project/app
ayazhafiz 3b700985f0 fix(language-service): do not treat file URIs as general URLs (#39917)
In the past, the legacy (VE-based) language service would use a
`UrlResolver` instance to resolve file paths, primarily for compiler
resources like external templates. The problem with this is that the
UrlResolver is designed to resolve URLs in general, and so for a path
like `/a/b/#c`, `#c` is treated as hash/fragment rather than as part
of the path, which can lead to unexpected path resolution (f.x.,
`resolve('a/b/#c/d.ts', './d.html')` would produce `'a/b/d.html'` rather
than the expected `'a/b/#c/d.html'`).

This commit resolves the issue by using Node's `path` module to resolve
file paths directly, which aligns more with how resources are resolved
in the Ivy compiler.

The testing story here is not great, and the API for validating a file
path could be a little bit prettier/robust. However, since the VE-based
language service is going into more of a "maintenance mode" now that
there is a clear path for the Ivy-based LS moving forward, I think it is
okay not to spend too much time here.

Closes https://github.com/angular/vscode-ng-language-service/issues/892
Closes https://github.com/angular/vscode-ng-language-service/issues/1001

PR Close #39917
2020-12-03 13:45:30 -08:00
..
#inner fix(language-service): do not treat file URIs as general URLs (#39917) 2020-12-03 13:45:30 -08:00
app.component.ts feat(language-service): Add getTypeDefinitionAtPosition (go to type definition) (#39145) 2020-10-09 10:57:37 -07:00
main.ts fix(language-service): do not treat file URIs as general URLs (#39917) 2020-12-03 13:45:30 -08:00
parsing-cases.ts refactor(language-service): Return directive defs when input name is part of selector (#39243) 2020-10-15 14:17:24 -07:00
test.css test(language-service): Create proper test project (#32653) 2019-09-18 13:07:01 -07:00
test.ng test(language-service): Remove all markers from test project (#37475) 2020-06-08 10:25:42 -07:00