angular-cn/packages/compiler/test/render3
Keen Yee Liau 8b7acc4f8f refactor(compiler): Binding parser sets binding span as source span in Ivy (#39036)
Currently it is impossible to determine the source of a binding that
generates `BoundAttribute` because all bound attributes generated from a
microsyntax expression share the same source span.

For example, in
```html
<div *ngFor="let item of items; trackBy: trackByFn"></div>
     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
     source span for all `BoundAttribute`s generated from microsyntax
```
the `BoundAttribute` for both `ngForOf` and `ngForTrackBy`
share the same source span.

A lot of hacks were necessary in View Engine language service to work
around this limitation. It was done by inspecting the whole source span
then figuring out the relative position of the cursor.

With this change, we introduce a flag to set the binding span as the
source span of the `ParsedProperty` in Ivy AST.
This flag is needed so that we don't have to change VE ASTs.

Note that in the binding parser, we already set `bindingSpan` as the
source span for a `ParsedVariable`, and `keySpan` as the source span for
a literal attribute. This change makes the Ivy AST more consistent by
propagating the binding span to `ParsedProperty` as well.

PR Close #39036
2020-09-30 09:31:44 -04:00
..
util build: update license headers to reference Google LLC (#37205) 2020-05-26 14:26:58 -04:00
view refactor(compiler-cli): update type checker symbols to include more information (#38844) 2020-09-28 16:19:44 -04:00
BUILD.bazel build: derive ts_library dep from jasmine_node_test boostrap label if it ends in `_es5` (#34736) 2020-01-15 14:58:07 -05:00
README.md feat(compiler): implement "enableIvy" compiler option (#21427) 2018-01-18 18:22:44 -06:00
r3_ast_absolute_span_spec.ts build: update license headers to reference Google LLC (#37205) 2020-05-26 14:26:58 -04:00
r3_ast_spans_spec.ts refactor(compiler): Binding parser sets binding span as source span in Ivy (#39036) 2020-09-30 09:31:44 -04:00
r3_template_transform_spec.ts build: update license headers to reference Google LLC (#37205) 2020-05-26 14:26:58 -04:00
style_parser_spec.ts build: update license headers to reference Google LLC (#37205) 2020-05-26 14:26:58 -04:00

README.md

Tests in this directory are excluded from running in the browser and only run in node.