Skip to content

Commit

Permalink
refactor(language-service): create findRenameLocations stubs (#39919)
Browse files Browse the repository at this point in the history
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
  • Loading branch information
atscott authored and mhevery committed Dec 3, 2020
1 parent 5a3a154 commit dd18cfd
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
8 changes: 8 additions & 0 deletions packages/language-service/ivy/ts_plugin.ts
Expand Up @@ -61,12 +61,20 @@ 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,
getTypeDefinitionAtPosition,
getQuickInfoAtPosition,
getDefinitionAndBoundSpan,
getReferencesAtPosition,
findRenameLocations,
};
}
8 changes: 8 additions & 0 deletions packages/language-service/src/ts_plugin.ts
Expand Up @@ -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,
Expand All @@ -139,5 +146,6 @@ export function create(info: tss.server.PluginCreateInfo): tss.LanguageService {
getDefinitionAndBoundSpan,
getTypeDefinitionAtPosition,
getReferencesAtPosition,
findRenameLocations,
};
}

0 comments on commit dd18cfd

Please sign in to comment.