angular-cn/packages/compiler/test
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
..
aot test(compiler-cli): improve test performance using shared source file cache (#38909) 2020-09-25 14:28:49 -04:00
css_parser build: update license headers to reference Google LLC (#37205) 2020-05-26 14:26:58 -04:00
expression_parser feat(compiler): support unary operators for more accurate type checking (#37918) 2020-08-21 12:25:53 -07:00
i18n fix(compiler-cli): compute source-mappings for localized strings (#38645) 2020-09-08 13:17:21 -07:00
ml_parser feat(compiler): Parse and recover on incomplete opening HTML tags (#38681) 2020-09-21 12:27:01 -07:00
output refactor(compiler): replace Comment nodes with leadingComments property (#38811) 2020-09-18 08:01:25 -07:00
render3 refactor(compiler): Binding parser sets binding span as source span in Ivy (#39036) 2020-09-30 09:31:44 -04:00
schema build: update license headers to reference Google LLC (#37205) 2020-05-26 14:26:58 -04:00
selector build: update license headers to reference Google LLC (#37205) 2020-05-26 14:26:58 -04:00
template_parser refactor(compiler): `element.sourceSpan` should span the `outerHTML` (#38581) 2020-09-02 14:47:31 -07:00
BUILD.bazel test(compiler-cli): improve test performance using shared source file cache (#38909) 2020-09-25 14:28:49 -04:00
compiler_facade_interface_spec.ts build: update license headers to reference Google LLC (#37205) 2020-05-26 14:26:58 -04:00
config_spec.ts build: update license headers to reference Google LLC (#37205) 2020-05-26 14:26:58 -04:00
core_spec.ts build: update license headers to reference Google LLC (#37205) 2020-05-26 14:26:58 -04:00
directive_lifecycle_spec.ts build: update license headers to reference Google LLC (#37205) 2020-05-26 14:26:58 -04:00
directive_normalizer_spec.ts build: update license headers to reference Google LLC (#37205) 2020-05-26 14:26:58 -04:00
directive_resolver_mock_spec.ts build: update license headers to reference Google LLC (#37205) 2020-05-26 14:26:58 -04:00
directive_resolver_spec.ts build: update license headers to reference Google LLC (#37205) 2020-05-26 14:26:58 -04:00
integration_spec.ts feat(core): update reference and doc to change `async` to `waitAsync`. (#37583) 2020-08-03 12:54:13 -07:00
metadata_resolver_fixture.ts build: update license headers to reference Google LLC (#37205) 2020-05-26 14:26:58 -04:00
metadata_resolver_spec.ts feat(core): update reference and doc to change `async` to `waitAsync`. (#37583) 2020-08-03 12:54:13 -07:00
ng_module_resolver_mock_spec.ts build: update license headers to reference Google LLC (#37205) 2020-05-26 14:26:58 -04:00
ng_module_resolver_spec.ts build: update license headers to reference Google LLC (#37205) 2020-05-26 14:26:58 -04:00
parse_util_spec.ts build: update license headers to reference Google LLC (#37205) 2020-05-26 14:26:58 -04:00
pipe_resolver_mock_spec.ts build: update license headers to reference Google LLC (#37205) 2020-05-26 14:26:58 -04:00
pipe_resolver_spec.ts build: update license headers to reference Google LLC (#37205) 2020-05-26 14:26:58 -04:00
resource_loader_mock_spec.ts build: update license headers to reference Google LLC (#37205) 2020-05-26 14:26:58 -04:00
runtime_compiler_spec.ts feat(core): update reference and doc to change `async` to `waitAsync`. (#37583) 2020-08-03 12:54:13 -07:00
shadow_css_spec.ts build: update license headers to reference Google LLC (#37205) 2020-05-26 14:26:58 -04:00
spies.ts build: update license headers to reference Google LLC (#37205) 2020-05-26 14:26:58 -04:00
style_url_resolver_spec.ts build: update license headers to reference Google LLC (#37205) 2020-05-26 14:26:58 -04:00
test_bindings.ts build: update license headers to reference Google LLC (#37205) 2020-05-26 14:26:58 -04:00
url_resolver_spec.ts build: update license headers to reference Google LLC (#37205) 2020-05-26 14:26:58 -04:00
util_spec.ts build: update license headers to reference Google LLC (#37205) 2020-05-26 14:26:58 -04:00