From 6bbcfca7aec6408cf27415ae6f965adc472d6f18 Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Mon, 5 Nov 2018 14:10:20 +0300 Subject: Fully add inline modules to module tree --- editors/code/src/commands/on_enter.ts | 6 +----- editors/code/src/commands/parent_module.ts | 11 +++++++---- 2 files changed, 8 insertions(+), 9 deletions(-) (limited to 'editors/code') diff --git a/editors/code/src/commands/on_enter.ts b/editors/code/src/commands/on_enter.ts index fe6aca63d..64401b684 100644 --- a/editors/code/src/commands/on_enter.ts +++ b/editors/code/src/commands/on_enter.ts @@ -6,10 +6,6 @@ import { SourceChange } from './apply_source_change'; -interface OnEnterParams { - textDocument: lc.TextDocumentIdentifier; - position: lc.Position; -} export async function handle(event: { text: string }): Promise { const editor = vscode.window.activeTextEditor; @@ -20,7 +16,7 @@ export async function handle(event: { text: string }): Promise { ) { return false; } - const request: OnEnterParams = { + const request: lc.TextDocumentPositionParams = { textDocument: { uri: editor.document.uri.toString() }, position: Server.client.code2ProtocolConverter.asPosition( editor.selection.active diff --git a/editors/code/src/commands/parent_module.ts b/editors/code/src/commands/parent_module.ts index 4bb92eb96..806c3d34c 100644 --- a/editors/code/src/commands/parent_module.ts +++ b/editors/code/src/commands/parent_module.ts @@ -1,6 +1,6 @@ import * as vscode from 'vscode'; -import { Location, TextDocumentIdentifier } from 'vscode-languageclient'; +import * as lc from 'vscode-languageclient'; import { Server } from '../server'; export async function handle() { @@ -8,10 +8,13 @@ export async function handle() { if (editor == null || editor.document.languageId !== 'rust') { return; } - const request: TextDocumentIdentifier = { - uri: editor.document.uri.toString() + const request: lc.TextDocumentPositionParams = { + textDocument: { uri: editor.document.uri.toString() }, + position: Server.client.code2ProtocolConverter.asPosition( + editor.selection.active + ) }; - const response = await Server.client.sendRequest( + const response = await Server.client.sendRequest( 'm/parentModule', request ); -- cgit v1.2.3