refactor(language-service): create findRenameLocations stubs (#39919)

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

PR Close #39919
This commit is contained in:
Andrew Scott 2020-12-01 12:45:02 -08:00 committed by Misko Hevery
parent 5a3a154cd8
commit dd18cfd983
2 changed files with 16 additions and 0 deletions

View File

@ -61,6 +61,13 @@ export function create(info: ts.server.PluginCreateInfo): ts.LanguageService {
return ngLS.getReferencesAtPosition(fileName, position);
}
function findRenameLocations(
fileName: string, position: number, findInStrings: boolean, findInComments: boolean,
providePrefixAndSuffixTextForRename?: boolean): readonly ts.RenameLocation[]|undefined {
// TODO(atscott): implement
return undefined;
}
return {
...tsLS,
getSemanticDiagnostics,
@ -68,5 +75,6 @@ export function create(info: ts.server.PluginCreateInfo): ts.LanguageService {
getQuickInfoAtPosition,
getDefinitionAndBoundSpan,
getReferencesAtPosition,
findRenameLocations,
};
}

View File

@ -128,6 +128,13 @@ export function create(info: tss.server.PluginCreateInfo): tss.LanguageService {
return undefined;
}
function findRenameLocations(
fileName: string, position: number, findInStrings: boolean, findInComments: boolean,
providePrefixAndSuffixTextForRename?: boolean): readonly ts.RenameLocation[]|undefined {
// not implemented in VE Language Service
return undefined;
}
return {
// First clone the original TS language service
...tsLS,
@ -139,5 +146,6 @@ export function create(info: tss.server.PluginCreateInfo): tss.LanguageService {
getDefinitionAndBoundSpan,
getTypeDefinitionAtPosition,
getReferencesAtPosition,
findRenameLocations,
};
}