aboutsummaryrefslogtreecommitdiff
path: root/editors/code/src/commands/extend_selection.ts
diff options
context:
space:
mode:
authorbors[bot] <bors[bot]@users.noreply.github.com>2018-10-09 07:16:36 +0100
committerbors[bot] <bors[bot]@users.noreply.github.com>2018-10-09 07:16:36 +0100
commitc9798c0e6da53c132021f03ac7a50ccd8714b371 (patch)
tree0d6d49b2eb40ad161a72adbfbf9874b64540bf74 /editors/code/src/commands/extend_selection.ts
parentf4ad36e972989c3feed8671d6d6fca0aed37cd8f (diff)
parente26071d96e1ff56289213dbe78415f836de8a70e (diff)
Merge #104
104: Add vscode extension to CI r=aochagavia a=DJMcNab Note that this testing is only done on travis - we are only running formatting and linting, so feature parity on appveyor is not required. CC @aochagavia. Fixes? #100 Co-authored-by: Daniel McNab <[email protected]>
Diffstat (limited to 'editors/code/src/commands/extend_selection.ts')
-rw-r--r--editors/code/src/commands/extend_selection.ts13
1 files changed, 9 insertions, 4 deletions
diff --git a/editors/code/src/commands/extend_selection.ts b/editors/code/src/commands/extend_selection.ts
index cdc3d10fb..0ee6bd11d 100644
--- a/editors/code/src/commands/extend_selection.ts
+++ b/editors/code/src/commands/extend_selection.ts
@@ -14,14 +14,19 @@ interface ExtendSelectionResult {
14 14
15export async function handle() { 15export async function handle() {
16 const 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') {
18 return;
19 }
18 const request: ExtendSelectionParams = { 20 const request: ExtendSelectionParams = {
19 selections: editor.selections.map((s) => { 21 selections: editor.selections.map(s => {
20 return Server.client.code2ProtocolConverter.asRange(s); 22 return Server.client.code2ProtocolConverter.asRange(s);
21 }), 23 }),
22 textDocument: { uri: editor.document.uri.toString() }, 24 textDocument: { uri: editor.document.uri.toString() }
23 }; 25 };
24 const response = await Server.client.sendRequest<ExtendSelectionResult>('m/extendSelection', request); 26 const response = await Server.client.sendRequest<ExtendSelectionResult>(
27 'm/extendSelection',
28 request
29 );
25 editor.selections = response.selections.map((range: Range) => { 30 editor.selections = response.selections.map((range: Range) => {
26 const r = Server.client.protocol2CodeConverter.asRange(range); 31 const r = Server.client.protocol2CodeConverter.asRange(range);
27 return new vscode.Selection(r.start, r.end); 32 return new vscode.Selection(r.start, r.end);