refactor(language-service): create getReferencesAtPosition stubs (#39829)

Create stubs for getTypeDefinitionAtPosition for both VE and Ivy Language Service
implementations. This will prevent failed requests when it is implemented on the vscode plugin side.

PR Close #39829
This commit is contained in:
Andrew Scott 2020-11-24 11:57:34 -08:00 committed by Andrew Kushnir
parent 3a6e7b5d2a
commit 8758006acc
2 changed files with 12 additions and 0 deletions

View File

@ -56,11 +56,17 @@ export function create(info: ts.server.PluginCreateInfo): ts.LanguageService {
}
}
function getReferencesAtPosition(fileName: string, position: number) {
// TODO(atscott): implement references
return undefined;
}
return {
...tsLS,
getSemanticDiagnostics,
getTypeDefinitionAtPosition,
getQuickInfoAtPosition,
getDefinitionAndBoundSpan,
getReferencesAtPosition,
};
}

View File

@ -115,6 +115,11 @@ export function create(info: tss.server.PluginCreateInfo): tss.LanguageService {
return undefined;
}
function getReferencesAtPosition(fileName: string, position: number) {
// Not implemented in VE Language Service
return undefined;
}
return {
// First clone the original TS language service
...tsLS,
@ -125,5 +130,6 @@ export function create(info: tss.server.PluginCreateInfo): tss.LanguageService {
getDefinitionAtPosition,
getDefinitionAndBoundSpan,
getTypeDefinitionAtPosition,
getReferencesAtPosition,
};
}