feat(language-service): TS references from template items (#37437)
Keen and I were talking about what it would take to support getting references at a position in the current language service, since it's unclear when more investment in the Ivy LS will be available. Getting TS references from a template is trivial -- we simply need to get the definition of a symbol, which is already handled by the language service, and ask the TS language service to give us the references for that definition. This doesn't handle references in templates, but that could be done in a subsequent pass. Part of https://github.com/angular/vscode-ng-language-service/issues/29 PR Close #37437
This commit is contained in:
@ -24,4 +24,7 @@ export class AppComponent {
|
||||
title = 'Tour of Heroes';
|
||||
hero: Hero = {id: 1, name: 'Windstorm'};
|
||||
private internal: string = 'internal';
|
||||
setTitle(newTitle: string) {
|
||||
this.title = newTitle;
|
||||
}
|
||||
}
|
||||
|
@ -102,7 +102,7 @@ export class TemplateReference {
|
||||
/**
|
||||
* This is the title of the `TemplateReference` Component.
|
||||
*/
|
||||
title = 'Some title';
|
||||
title = 'Tour of Heroes';
|
||||
hero: Hero = {id: 1, name: 'Windstorm'};
|
||||
heroP = Promise.resolve(this.hero);
|
||||
heroes: Hero[] = [this.hero];
|
||||
@ -121,4 +121,7 @@ export class TemplateReference {
|
||||
constNames = [{name: 'name'}] as const;
|
||||
private myField = 'My Field';
|
||||
strOrNumber: string|number = '';
|
||||
setTitle(newTitle: string) {
|
||||
this.title = newTitle;
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user