diff options
author | bors[bot] <26634292+bors[bot]@users.noreply.github.com> | 2019-12-31 17:38:55 +0000 |
---|---|---|
committer | GitHub <[email protected]> | 2019-12-31 17:38:55 +0000 |
commit | 6d23140ba03c77b28d94e042c94155899baba9da (patch) | |
tree | 3efa5daf54fe08cd1b310fa42c2ef469503fcedd /editors/code/src/commands/join_lines.ts | |
parent | 1327aed7f6289043091aa9179282030c6f13ddbe (diff) | |
parent | 6368b40dd98b208da3758d4d1eed34cf276e3b09 (diff) |
Merge #2709
2709: Work around synchrnonisation issue r=matklad a=matklad
Co-authored-by: Aleksey Kladov <[email protected]>
Diffstat (limited to 'editors/code/src/commands/join_lines.ts')
-rw-r--r-- | editors/code/src/commands/join_lines.ts | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/editors/code/src/commands/join_lines.ts b/editors/code/src/commands/join_lines.ts index f4f902cf9..7b08c3255 100644 --- a/editors/code/src/commands/join_lines.ts +++ b/editors/code/src/commands/join_lines.ts | |||
@@ -6,13 +6,14 @@ import { applySourceChange, SourceChange } from '../source_change'; | |||
6 | export function joinLines(ctx: Ctx): Cmd { | 6 | export function joinLines(ctx: Ctx): Cmd { |
7 | return async () => { | 7 | return async () => { |
8 | const editor = ctx.activeRustEditor; | 8 | const editor = ctx.activeRustEditor; |
9 | if (!editor) return; | 9 | const client = ctx.client; |
10 | if (!editor || !client) return; | ||
10 | 11 | ||
11 | const request: JoinLinesParams = { | 12 | const request: JoinLinesParams = { |
12 | range: ctx.client.code2ProtocolConverter.asRange(editor.selection), | 13 | range: client.code2ProtocolConverter.asRange(editor.selection), |
13 | textDocument: { uri: editor.document.uri.toString() }, | 14 | textDocument: { uri: editor.document.uri.toString() }, |
14 | }; | 15 | }; |
15 | const change = await ctx.client.sendRequest<SourceChange>( | 16 | const change = await client.sendRequest<SourceChange>( |
16 | 'rust-analyzer/joinLines', | 17 | 'rust-analyzer/joinLines', |
17 | request, | 18 | request, |
18 | ); | 19 | ); |