feat(compiler): Propagate source span and value span to Variable AST (#36047)
This commit propagates the `sourceSpan` and `valueSpan` of a `VariableBinding` in a microsyntax expression to `ParsedVariable`, and subsequently to View Engine Variable AST and Ivy Variable AST. Note that this commit does not propagate the `keySpan`, because it involves significant changes to the template AST. PR Close #36047
This commit is contained in:

committed by
Andrew Kushnir

parent
e179c5827f
commit
31bec8ce61
@ -292,7 +292,7 @@ describe('diagnostics', () => {
|
||||
it('should suggest refining a template context missing a property', () => {
|
||||
mockHost.override(
|
||||
TEST_TEMPLATE,
|
||||
`<button type="button" ~{start-emb}*counter="let hero of heroes"~{end-emb}></button>`);
|
||||
`<button type="button" *counter="~{start-emb}let hero ~{end-emb}of heroes"></button>`);
|
||||
const diags = ngLS.getSemanticDiagnostics(TEST_TEMPLATE);
|
||||
expect(diags.length).toBe(1);
|
||||
const {messageText, start, length, category} = diags[0];
|
||||
@ -310,7 +310,7 @@ describe('diagnostics', () => {
|
||||
it('should report an unknown context reference', () => {
|
||||
mockHost.override(
|
||||
TEST_TEMPLATE,
|
||||
`<div ~{start-emb}*ngFor="let hero of heroes; let e = even_1"~{end-emb}></div>`);
|
||||
`<div *ngFor="let hero of heroes; ~{start-emb}let e = even_1~{end-emb}"></div>`);
|
||||
const diags = ngLS.getSemanticDiagnostics(TEST_TEMPLATE);
|
||||
expect(diags.length).toBe(1);
|
||||
const {messageText, start, length, category} = diags[0];
|
||||
|
Reference in New Issue
Block a user