In order to more accurately map from a node in the TCB to a template position, we need to provide more span information in the TCB. These changes are necessary for the Language Service to map from a TCB node back to a specific locations in the template for actions like "find references" and "refactor/rename". After the TS "find references" returns results, including those in the TCB, we need to map specifically to the matching key/value spans in the template rather than the entire source span. This also has the benefit of producing diagnostics which align more closely with what TypeScript produces. The following example shows TS code and the diagnostic produced by an invalid assignment to a property: ``` let a: {age: number} = {} as any; a.age = 'laksjdf'; ^^^^^ <-- Type 'string' is not assignable to type 'number'. ``` A corollary to this in a template file would be [age]="'someString'". The diagnostic we currently produce for this is: ``` Type 'number' is not assignable to type 'string'. 1 <app-hello [greeting]="1"></app-hello> ~~~~~~~~~~~~~~ ``` Notice that the underlined text includes the entire span. If we included the keySpan for the assignment to the property, this diagnostic underline would be more similar to the one produced by TypeScript; that is, it would only underline “greeting”. [design/discussion doc] (https://docs.google.com/document/d/1FtaHdVL805wKe4E6FxVTnVHl38lICoHIjS2nThtRJ6I/edit?usp=sharing) PR Close #39665
Angular
The sources for this package are in the main Angular repo. Please file issues and pull requests against that repo.
Usage information and reference details can be found in Angular documentation.
License: MIT