diff options
author | hrsh7th <hrsh7th@gmail.com> | 2020-12-30 09:58:20 +0900 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-12-30 11:58:20 +1100 |
commit | 57b0562957f0887611526bf7e878ac34fdcd6393 (patch) | |
tree | cf419c9892b2d0275a7d9ffa79a4e79728fd5b97 /cli/tsc | |
parent | d5f3a749eb9b86ed24378a3ee39ee443c374da53 (diff) |
feat(lsp): Implement textDocument/rename (#8910)
Diffstat (limited to 'cli/tsc')
-rw-r--r-- | cli/tsc/99_main_compiler.js | 12 | ||||
-rw-r--r-- | cli/tsc/compiler.d.ts | 12 |
2 files changed, 23 insertions, 1 deletions
diff --git a/cli/tsc/99_main_compiler.js b/cli/tsc/99_main_compiler.js index de9e74d2e..ddbb8fcac 100644 --- a/cli/tsc/99_main_compiler.js +++ b/cli/tsc/99_main_compiler.js @@ -562,6 +562,18 @@ delete Object.prototype.__proto__; ), ); } + case "findRenameLocations": { + return respond( + id, + languageService.findRenameLocations( + request.specifier, + request.position, + request.findInStrings, + request.findInComments, + request.providePrefixAndSuffixTextForRename, + ), + ); + } default: throw new TypeError( // @ts-ignore exhausted case statement sets type to never diff --git a/cli/tsc/compiler.d.ts b/cli/tsc/compiler.d.ts index 39afbe884..7ba92a96f 100644 --- a/cli/tsc/compiler.d.ts +++ b/cli/tsc/compiler.d.ts @@ -50,7 +50,8 @@ declare global { | GetDocumentHighlightsRequest | GetReferencesRequest | GetDefinitionRequest - | GetCompletionsRequest; + | GetCompletionsRequest + | FindRenameLocationsRequest; interface BaseLanguageServerRequest { id: number; @@ -114,4 +115,13 @@ declare global { position: number; preferences: ts.UserPreferences; } + + interface FindRenameLocationsRequest extends BaseLanguageServerRequest { + method: "findRenameLocations"; + specifier: string; + position: number; + findInStrings: boolean; + findInComments: boolean; + providePrefixAndSuffixTextForRename: boolean; + } } |