diff options
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 | ); |