From d6a96a90f417d48e6391d2233abf752988c04f1a Mon Sep 17 00:00:00 2001 From: Veetaha Date: Tue, 25 Feb 2020 00:56:19 +0200 Subject: vscode: migrate parent_module to rust-analyzer-api.ts --- editors/code/src/commands/parent_module.ts | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) (limited to 'editors/code/src/commands') diff --git a/editors/code/src/commands/parent_module.ts b/editors/code/src/commands/parent_module.ts index bf40b4021..8f78ddd71 100644 --- a/editors/code/src/commands/parent_module.ts +++ b/editors/code/src/commands/parent_module.ts @@ -1,5 +1,5 @@ import * as vscode from 'vscode'; -import * as lc from 'vscode-languageclient'; +import * as ra from '../rust-analyzer-api'; import { Ctx, Cmd } from '../ctx'; @@ -9,16 +9,12 @@ export function parentModule(ctx: Ctx): Cmd { const client = ctx.client; if (!editor || !client) return; - const request: lc.TextDocumentPositionParams = { + const response = await client.sendRequest(ra.parentModule, { textDocument: { uri: editor.document.uri.toString() }, position: client.code2ProtocolConverter.asPosition( editor.selection.active, ), - }; - const response = await client.sendRequest( - 'rust-analyzer/parentModule', - request, - ); + }); const loc = response[0]; if (loc == null) return; -- cgit v1.2.3