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:
Ayaz Hafiz
2020-06-04 06:35:30 -07:00
committed by atscott
parent e97a2d4123
commit bf2cb6fa48
8 changed files with 102 additions and 5 deletions

View File

@ -71,7 +71,7 @@ describe('definitions', () => {
const fileContent = mockHost.readFile(def.fileName);
expect(fileContent!.substring(def.textSpan.start, def.textSpan.start + def.textSpan.length))
.toEqual(`title = 'Some title';`);
.toEqual(`title = 'Tour of Heroes';`);
});
it('should be able to find a method from a call', () => {