angular-docs-cn/packages/compiler-cli
Andrew Scott 0847a0353b fix(language-service): Always attempt HTML AST to template AST conversion for LS (#41068)
The current logic in the compiler is to bail when there are errors when
parsing a template into an HTML AST or when there are errors in the i18n
metadata. As a result, a template with these types of parse errors
_will not have any information for the language service_. This is because we
never attempt to conver the HTML AST to a template AST in these
scenarios, so there are no template AST nodes for the language service
to look at for information. In addition, this also means that the errors
are never displayed in the template to the user because there are no
nodes to map the error to.

This commit adds an option to the template parser to temporarily ignore
the html parse and i18n meta errors and always perform the template AST
conversion. At the end, the i18n and HTML parse errors are appended to
the returned errors list. While this seems risky, it at least provides
us with more information than we had before (which was 0) and it's only
done in the context of the language service, when the compiler is
configured to use poisoned data (HTML parse and i18n meta errors can be
interpreted as a "poisoned" template).

fixes angular/vscode-ng-language-service#1140

PR Close #41068
2021-03-03 21:13:58 +00:00
..
integrationtest feat(core): drop support for zone.js 0.10.x (#40823) 2021-02-24 07:58:29 -08:00
linker refactor(compiler-cli): implement `ɵɵngDeclarePipe()` (#40803) 2021-02-12 09:00:16 -08:00
ngcc fix(compiler-cli): ensure ngcc can handle wildcard base-paths (#41033) 2021-03-01 15:25:44 -08:00
src fix(language-service): Always attempt HTML AST to template AST conversion for LS (#41068) 2021-03-03 21:13:58 +00:00
test refactor(compiler): retrieve variables from context inside nested template listener (#40833) 2021-02-17 11:45:46 -08:00
BUILD.bazel fix(compiler-cli): report non-template diagnostics (#40331) 2021-01-13 10:55:04 -08:00
index.ts build: update license headers to reference Google LLC (#37205) 2020-05-26 14:26:58 -04:00
package.json build: support building with TypeScript 4.1 (#39571) 2020-11-25 11:10:01 -08:00
tsconfig-build.json build: reference zone.js from source directly instead of npm. (#33046) 2019-11-06 00:48:34 +00:00
tsconfig.json perf(ivy): ngcc - only find dependencies when targeting a single entry-point (#30525) 2019-07-09 09:40:46 -07:00