aboutsummaryrefslogtreecommitdiff
path: root/editors
diff options
context:
space:
mode:
authorAleksey Kladov <[email protected]>2018-11-05 11:10:20 +0000
committerAleksey Kladov <[email protected]>2018-11-05 11:10:20 +0000
commit6bbcfca7aec6408cf27415ae6f965adc472d6f18 (patch)
tree7b332c6db6e662ca31aafded143476d81a60453f /editors
parent44d891938493cc32efd2e44d81bc76cc3bc391c0 (diff)
Fully add inline modules to module tree
Diffstat (limited to 'editors')
-rw-r--r--editors/code/src/commands/on_enter.ts6
-rw-r--r--editors/code/src/commands/parent_module.ts11
2 files changed, 8 insertions, 9 deletions
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 {
6 SourceChange 6 SourceChange
7} from './apply_source_change'; 7} from './apply_source_change';
8 8
9interface OnEnterParams {
10 textDocument: lc.TextDocumentIdentifier;
11 position: lc.Position;
12}
13 9
14export async function handle(event: { text: string }): Promise<boolean> { 10export async function handle(event: { text: string }): Promise<boolean> {
15 const editor = vscode.window.activeTextEditor; 11 const editor = vscode.window.activeTextEditor;
@@ -20,7 +16,7 @@ export async function handle(event: { text: string }): Promise<boolean> {
20 ) { 16 ) {
21 return false; 17 return false;
22 } 18 }
23 const request: OnEnterParams = { 19 const request: lc.TextDocumentPositionParams = {
24 textDocument: { uri: editor.document.uri.toString() }, 20 textDocument: { uri: editor.document.uri.toString() },
25 position: Server.client.code2ProtocolConverter.asPosition( 21 position: Server.client.code2ProtocolConverter.asPosition(
26 editor.selection.active 22 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 @@
1import * as vscode from 'vscode'; 1import * as vscode from 'vscode';
2 2
3import { Location, TextDocumentIdentifier } from 'vscode-languageclient'; 3import * as lc from 'vscode-languageclient';
4import { Server } from '../server'; 4import { Server } from '../server';
5 5
6export async function handle() { 6export async function handle() {
@@ -8,10 +8,13 @@ export async function handle() {
8 if (editor == null || editor.document.languageId !== 'rust') { 8 if (editor == null || editor.document.languageId !== 'rust') {
9 return; 9 return;
10 } 10 }
11 const request: TextDocumentIdentifier = { 11 const request: lc.TextDocumentPositionParams = {
12 uri: editor.document.uri.toString() 12 textDocument: { uri: editor.document.uri.toString() },
13 position: Server.client.code2ProtocolConverter.asPosition(
14 editor.selection.active
15 )
13 }; 16 };
14 const response = await Server.client.sendRequest<Location[]>( 17 const response = await Server.client.sendRequest<lc.Location[]>(
15 'm/parentModule', 18 'm/parentModule',
16 request 19 request
17 ); 20 );