From 38d7945ec7d3522e09a105a92156d1aaf8651f46 Mon Sep 17 00:00:00 2001 From: Veetaha Date: Tue, 25 Feb 2020 00:54:50 +0200 Subject: vscode: migrate join_lines to rust-analyzer-api.ts --- editors/code/src/commands/join_lines.ts | 17 ++++------------- 1 file changed, 4 insertions(+), 13 deletions(-) (limited to 'editors/code/src/commands/join_lines.ts') diff --git a/editors/code/src/commands/join_lines.ts b/editors/code/src/commands/join_lines.ts index 7b08c3255..de0614653 100644 --- a/editors/code/src/commands/join_lines.ts +++ b/editors/code/src/commands/join_lines.ts @@ -1,7 +1,7 @@ -import * as lc from 'vscode-languageclient'; +import * as ra from '../rust-analyzer-api'; import { Ctx, Cmd } from '../ctx'; -import { applySourceChange, SourceChange } from '../source_change'; +import { applySourceChange } from '../source_change'; export function joinLines(ctx: Ctx): Cmd { return async () => { @@ -9,19 +9,10 @@ export function joinLines(ctx: Ctx): Cmd { const client = ctx.client; if (!editor || !client) return; - const request: JoinLinesParams = { + const change = await client.sendRequest(ra.joinLines, { range: client.code2ProtocolConverter.asRange(editor.selection), textDocument: { uri: editor.document.uri.toString() }, - }; - const change = await client.sendRequest( - 'rust-analyzer/joinLines', - request, - ); + }); await applySourceChange(ctx, change); }; } - -interface JoinLinesParams { - textDocument: lc.TextDocumentIdentifier; - range: lc.Range; -} -- cgit v1.2.3