angular-docs-cn/packages/language-service/src
ayazhafiz ee46b9b44f fix(language-service): correctly parse expressions in an attribute (#34517)
Currently, the language service provides completions in a template node
attribute by first checking if the attribute contains template bindings
to provide completions for, and then providing completions for the
expression in the attribute.

In the latter case, the expression AST was being constructed
"synthetically" inside the language service, in particular declaring the
expression to be a `PropertyRead` with an implicit receiver.
Unfortunately, this AST can be incorrect if the expression is actually a
property read on a component property receiver (e.g. when reading
`key` in the expression `obj.key`, `obj` is the receiver).

The fix is pretty simple - rather than a synthetic construction of the
AST, ask the expression parser to parse the expression in the attribute.

Fixes https://github.com/angular/vscode-ng-language-service/issues/523

PR Close #34517
2020-01-06 11:37:21 -08:00
..
common.ts fix(language-service): Do not produce diagnostics if metadata for NgModule not found (#34113) 2019-12-02 11:13:41 -08:00
completions.ts fix(language-service): correctly parse expressions in an attribute (#34517) 2020-01-06 11:37:21 -08:00
definitions.ts feat(language-service): add definitions for styleUrls (#32464) 2019-09-09 16:04:14 -04:00
diagnostics.ts fix(language-service): Make missing module suggestion instead of error (#34115) 2019-12-02 11:19:40 -08:00
expression_diagnostics.ts fix(language-service): HTML path should include last node before cursor (#34440) 2019-12-16 14:12:36 -08:00
expression_type.ts feat(language-service): Show documentation on hover (#34506) 2020-01-06 11:36:57 -08:00
expressions.ts refactor(compiler-cli): Move diagnostics files to language service (#33809) 2019-11-14 09:29:07 -08:00
global_symbols.ts feat(language-service): Show documentation on hover (#34506) 2020-01-06 11:36:57 -08:00
hover.ts feat(language-service): Show documentation on hover (#34506) 2020-01-06 11:36:57 -08:00
html_info.ts refactor(language-service): use strict comparisons (#33114) 2019-10-17 21:19:02 -04:00
language_service.ts fix(language-service): Do not produce diagnostics if metadata for NgModule not found (#34113) 2019-12-02 11:13:41 -08:00
locate_symbol.ts feat(language-service): Show documentation on hover (#34506) 2020-01-06 11:36:57 -08:00
reflector_host.ts fix(language-service): Use tsLSHost.fileExists() to resolve modules (#32642) 2019-09-12 17:18:06 -07:00
symbols.ts feat(language-service): Show documentation on hover (#34506) 2020-01-06 11:36:57 -08:00
template.ts fix(language-service): Do not produce diagnostics if metadata for NgModule not found (#34113) 2019-12-02 11:13:41 -08:00
ts_plugin.ts fix(language-service): Remove getExternalFiles() (#34260) 2019-12-05 13:13:20 -08:00
types.ts fix(language-service): Remove getExternalFiles() (#34260) 2019-12-05 13:13:20 -08:00
typescript_host.ts fix(language-service): Simplify resolution logic in banner (#34262) 2019-12-06 10:27:30 -08:00
typescript_symbols.ts feat(language-service): Show documentation on hover (#34506) 2020-01-06 11:36:57 -08:00
utils.ts fix(language-service): Proper completions for properties and events (#34445) 2019-12-18 09:13:31 -08:00
version.ts style: remove empty comments (#23404) 2018-05-10 15:48:13 -07:00