diff options
Diffstat (limited to 'editors/code/src/commands/extend_selection.ts')
-rw-r--r-- | editors/code/src/commands/extend_selection.ts | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/editors/code/src/commands/extend_selection.ts b/editors/code/src/commands/extend_selection.ts index b90828ba9..b722ac172 100644 --- a/editors/code/src/commands/extend_selection.ts +++ b/editors/code/src/commands/extend_selection.ts | |||
@@ -1,6 +1,6 @@ | |||
1 | import * as vscode from 'vscode'; | 1 | import * as vscode from 'vscode'; |
2 | 2 | ||
3 | import { TextDocumentIdentifier, Range } from "vscode-languageclient"; | 3 | import { Range, TextDocumentIdentifier } from 'vscode-languageclient'; |
4 | import { Server } from '../server'; | 4 | import { Server } from '../server'; |
5 | 5 | ||
6 | interface ExtendSelectionParams { | 6 | interface ExtendSelectionParams { |
@@ -13,17 +13,17 @@ interface ExtendSelectionResult { | |||
13 | } | 13 | } |
14 | 14 | ||
15 | export async function handle() { | 15 | export async function handle() { |
16 | let editor = vscode.window.activeTextEditor | 16 | const editor = vscode.window.activeTextEditor; |
17 | if (editor == null || editor.document.languageId != "rust") return | 17 | if (editor == null || editor.document.languageId != 'rust') { return; } |
18 | let request: ExtendSelectionParams = { | 18 | const request: ExtendSelectionParams = { |
19 | textDocument: { uri: editor.document.uri.toString() }, | ||
20 | selections: editor.selections.map((s) => { | 19 | selections: editor.selections.map((s) => { |
21 | return Server.client.code2ProtocolConverter.asRange(s) | 20 | return Server.client.code2ProtocolConverter.asRange(s); |
22 | }) | 21 | }), |
23 | } | 22 | textDocument: { uri: editor.document.uri.toString() }, |
24 | let response = await Server.client.sendRequest<ExtendSelectionResult>("m/extendSelection", request) | 23 | }; |
24 | const response = await Server.client.sendRequest<ExtendSelectionResult>('m/extendSelection', request); | ||
25 | editor.selections = response.selections.map((range: Range) => { | 25 | editor.selections = response.selections.map((range: Range) => { |
26 | let r = Server.client.protocol2CodeConverter.asRange(range) | 26 | const r = Server.client.protocol2CodeConverter.asRange(range); |
27 | return new vscode.Selection(r.start, r.end) | 27 | return new vscode.Selection(r.start, r.end); |
28 | }) | 28 | }); |
29 | } | 29 | } |