feat(language-service): Add getTypeDefinitionAtPosition (go to type definition) (#39145)

This commit adds the implementation for providing "go to type definition"
functionality in the Ivy Language Service.

PR Close #39145
This commit is contained in:
Andrew Scott
2020-10-02 13:54:18 -07:00
committed by atscott
parent bf717b1a31
commit a84976fdfc
13 changed files with 579 additions and 102 deletions

View File

@ -60,6 +60,14 @@ export class LanguageService {
return new DefinitionBuilder(this.tsLS, compiler).getDefinitionAndBoundSpan(fileName, position);
}
getTypeDefinitionAtPosition(fileName: string, position: number):
readonly ts.DefinitionInfo[]|undefined {
const program = this.strategy.getProgram();
const compiler = this.createCompiler(program, fileName);
return new DefinitionBuilder(this.tsLS, compiler)
.getTypeDefinitionsAtPosition(fileName, position);
}
getQuickInfoAtPosition(fileName: string, position: number): ts.QuickInfo|undefined {
const program = this.strategy.getProgram();
const compiler = this.createCompiler(program, fileName);