about summary refs log tree commit diff
path: root/editors/code/src
diff options
context:
space:
mode:
authorAleksey Kladov <aleksey.kladov@gmail.com>2018-11-05 14:10:20 +0300
committerAleksey Kladov <aleksey.kladov@gmail.com>2018-11-05 14:10:20 +0300
commit6bbcfca7aec6408cf27415ae6f965adc472d6f18 (patch)
tree7b332c6db6e662ca31aafded143476d81a60453f /editors/code/src
parent44d891938493cc32efd2e44d81bc76cc3bc391c0 (diff)
downloadrust-6bbcfca7aec6408cf27415ae6f965adc472d6f18.tar.gz
rust-6bbcfca7aec6408cf27415ae6f965adc472d6f18.zip
Fully add inline modules to module tree
Diffstat (limited to 'editors/code/src')
-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 fe6aca63d97..64401b68401 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<boolean> {
     const editor = vscode.window.activeTextEditor;
@@ -20,7 +16,7 @@ export async function handle(event: { text: string }): Promise<boolean> {
     ) {
         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 4bb92eb96a7..806c3d34c12 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<Location[]>(
+    const response = await Server.client.sendRequest<lc.Location[]>(
         'm/parentModule',
         request
     );