refactor(language-service): Consistent naming between ts and ng LanguageService (#34888)

This commit makes the Angular Language Service interface a strict subset
of TypeScript's Language Service by renaming all methods to be
consistent with TypeScript's.

The custom Angular `LanguageService` interface was needed before the
inception of TypeScript tsserver plugin, but is now obsolete since
Angular LS is a proper tsserver plugin.

This allows us to easily adapt to upstream TS changes in the future, and
also allows us to reuse all data types defined in TypeScript.

PR Close #34888
This commit is contained in:
Keen Yee Liau
2020-01-21 14:51:43 -08:00
committed by Matias Niemelä
parent 84d24c08e1
commit f723a27a71
8 changed files with 189 additions and 221 deletions

View File

@ -24,16 +24,17 @@ describe('service without angular', () => {
beforeEach(() => { mockHost.reset(); });
it('should not crash a get diagnostics',
() => { expect(() => ngService.getDiagnostics(fileName)).not.toThrow(); });
() => { expect(() => ngService.getSemanticDiagnostics(fileName)).not.toThrow(); });
it('should not crash a completion',
() => { expect(() => ngService.getCompletionsAt(fileName, position)).not.toThrow(); });
() => { expect(() => ngService.getCompletionsAtPosition(fileName, position)).not.toThrow(); });
it('should not crash a get definition',
() => { expect(() => ngService.getDefinitionAt(fileName, position)).not.toThrow(); });
it('should not crash a get definition', () => {
expect(() => ngService.getDefinitionAndBoundSpan(fileName, position)).not.toThrow();
});
it('should not crash a hover',
() => { expect(() => ngService.getHoverAt(fileName, position)).not.toThrow(); });
() => { expect(() => ngService.getQuickInfoAtPosition(fileName, position)).not.toThrow(); });
it('should not crash with an incomplete class', () => {
mockHost.addCode('\nexport class');