diff options
author | bors[bot] <bors[bot]@users.noreply.github.com> | 2018-10-09 07:16:36 +0100 |
---|---|---|
committer | bors[bot] <bors[bot]@users.noreply.github.com> | 2018-10-09 07:16:36 +0100 |
commit | c9798c0e6da53c132021f03ac7a50ccd8714b371 (patch) | |
tree | 0d6d49b2eb40ad161a72adbfbf9874b64540bf74 /editors/code/src/commands/join_lines.ts | |
parent | f4ad36e972989c3feed8671d6d6fca0aed37cd8f (diff) | |
parent | e26071d96e1ff56289213dbe78415f836de8a70e (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/join_lines.ts')
-rw-r--r-- | editors/code/src/commands/join_lines.ts | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/editors/code/src/commands/join_lines.ts b/editors/code/src/commands/join_lines.ts index 526b698cc..27d263b8a 100644 --- a/editors/code/src/commands/join_lines.ts +++ b/editors/code/src/commands/join_lines.ts | |||
@@ -2,7 +2,10 @@ import * as vscode from 'vscode'; | |||
2 | 2 | ||
3 | import { Range, TextDocumentIdentifier } from 'vscode-languageclient'; | 3 | import { Range, TextDocumentIdentifier } from 'vscode-languageclient'; |
4 | import { Server } from '../server'; | 4 | import { Server } from '../server'; |
5 | import { handle as applySourceChange, SourceChange } from './apply_source_change'; | 5 | import { |
6 | handle as applySourceChange, | ||
7 | SourceChange | ||
8 | } from './apply_source_change'; | ||
6 | 9 | ||
7 | interface JoinLinesParams { | 10 | interface JoinLinesParams { |
8 | textDocument: TextDocumentIdentifier; | 11 | textDocument: TextDocumentIdentifier; |
@@ -11,11 +14,16 @@ interface JoinLinesParams { | |||
11 | 14 | ||
12 | export async function handle() { | 15 | export async function handle() { |
13 | const editor = vscode.window.activeTextEditor; | 16 | const editor = vscode.window.activeTextEditor; |
14 | if (editor == null || editor.document.languageId !== 'rust') { return; } | 17 | if (editor == null || editor.document.languageId !== 'rust') { |
18 | return; | ||
19 | } | ||
15 | const request: JoinLinesParams = { | 20 | const request: JoinLinesParams = { |
16 | range: Server.client.code2ProtocolConverter.asRange(editor.selection), | 21 | range: Server.client.code2ProtocolConverter.asRange(editor.selection), |
17 | textDocument: { uri: editor.document.uri.toString() }, | 22 | textDocument: { uri: editor.document.uri.toString() } |
18 | }; | 23 | }; |
19 | const change = await Server.client.sendRequest<SourceChange>('m/joinLines', request); | 24 | const change = await Server.client.sendRequest<SourceChange>( |
25 | 'm/joinLines', | ||
26 | request | ||
27 | ); | ||
20 | await applySourceChange(change); | 28 | await applySourceChange(change); |
21 | } | 29 | } |