diff options
author | bors[bot] <bors[bot]@users.noreply.github.com> | 2018-11-05 11:12:04 +0000 |
---|---|---|
committer | bors[bot] <bors[bot]@users.noreply.github.com> | 2018-11-05 11:12:04 +0000 |
commit | de9bb9cfefb6d19958363f7d064aef6adbca9107 (patch) | |
tree | 7b332c6db6e662ca31aafded143476d81a60453f /editors/code | |
parent | 6502bd2c966d57bdb8fbba7f43da9ddd004d87d3 (diff) | |
parent | 6bbcfca7aec6408cf27415ae6f965adc472d6f18 (diff) |
Merge #193
193: Inline modules r=matklad a=matklad
Co-authored-by: Aleksey Kladov <[email protected]>
Diffstat (limited to 'editors/code')
-rw-r--r-- | editors/code/src/commands/on_enter.ts | 6 | ||||
-rw-r--r-- | editors/code/src/commands/parent_module.ts | 11 |
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 | ||
9 | interface OnEnterParams { | ||
10 | textDocument: lc.TextDocumentIdentifier; | ||
11 | position: lc.Position; | ||
12 | } | ||
13 | 9 | ||
14 | export async function handle(event: { text: string }): Promise<boolean> { | 10 | export 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 @@ | |||
1 | import * as vscode from 'vscode'; | 1 | import * as vscode from 'vscode'; |
2 | 2 | ||
3 | import { Location, TextDocumentIdentifier } from 'vscode-languageclient'; | 3 | import * as lc from 'vscode-languageclient'; |
4 | import { Server } from '../server'; | 4 | import { Server } from '../server'; |
5 | 5 | ||
6 | export async function handle() { | 6 | export 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 | ); |