summaryrefslogtreecommitdiff
path: root/cli/tsc
diff options
context:
space:
mode:
authorJean Pierre <jeanp413@hotmail.com>2021-03-23 18:33:25 -0500
committerGitHub <noreply@github.com>2021-03-24 10:33:25 +1100
commit77cfadf5321df90ea5fd625e2eb9d51b3920b437 (patch)
tree3bb56c344fd7cf5edc1516b78673ae1f35209d1e /cli/tsc
parentb233985feacb6a869e491e28474faa936dc07538 (diff)
feat(lsp): implement textDocument/selectionRange (#9845)
Ref: #8643
Diffstat (limited to 'cli/tsc')
-rw-r--r--cli/tsc/99_main_compiler.js9
-rw-r--r--cli/tsc/compiler.d.ts7
2 files changed, 16 insertions, 0 deletions
diff --git a/cli/tsc/99_main_compiler.js b/cli/tsc/99_main_compiler.js
index c84c2365c..8aba3dca9 100644
--- a/cli/tsc/99_main_compiler.js
+++ b/cli/tsc/99_main_compiler.js
@@ -703,6 +703,15 @@ delete Object.prototype.__proto__;
),
);
}
+ case "getSmartSelectionRange": {
+ return respond(
+ id,
+ languageService.getSmartSelectionRange(
+ request.specifier,
+ request.position,
+ ),
+ );
+ }
case "getSupportedCodeFixes": {
return respond(
id,
diff --git a/cli/tsc/compiler.d.ts b/cli/tsc/compiler.d.ts
index a3200469c..bdbc89a87 100644
--- a/cli/tsc/compiler.d.ts
+++ b/cli/tsc/compiler.d.ts
@@ -61,6 +61,7 @@ declare global {
| GetQuickInfoRequest
| GetReferencesRequest
| GetSignatureHelpItemsRequest
+ | GetSmartSelectionRange
| GetSupportedCodeFixes;
interface BaseLanguageServerRequest {
@@ -169,6 +170,12 @@ declare global {
options: ts.SignatureHelpItemsOptions;
}
+ interface GetSmartSelectionRange extends BaseLanguageServerRequest {
+ method: "getSmartSelectionRange";
+ specifier: string;
+ position: number;
+ }
+
interface GetSupportedCodeFixes extends BaseLanguageServerRequest {
method: "getSupportedCodeFixes";
}