diff options
Diffstat (limited to 'editors/code/src/commands/parent_module.ts')
-rw-r--r-- | editors/code/src/commands/parent_module.ts | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/editors/code/src/commands/parent_module.ts b/editors/code/src/commands/parent_module.ts index d66fb3026..4bb92eb96 100644 --- a/editors/code/src/commands/parent_module.ts +++ b/editors/code/src/commands/parent_module.ts | |||
@@ -5,13 +5,20 @@ import { Server } from '../server'; | |||
5 | 5 | ||
6 | export async function handle() { | 6 | export async function handle() { |
7 | const editor = vscode.window.activeTextEditor; | 7 | const editor = vscode.window.activeTextEditor; |
8 | if (editor == null || editor.document.languageId !== 'rust') { return; } | 8 | if (editor == null || editor.document.languageId !== 'rust') { |
9 | return; | ||
10 | } | ||
9 | const request: TextDocumentIdentifier = { | 11 | const request: TextDocumentIdentifier = { |
10 | uri: editor.document.uri.toString(), | 12 | uri: editor.document.uri.toString() |
11 | }; | 13 | }; |
12 | const response = await Server.client.sendRequest<Location[]>('m/parentModule', request); | 14 | const response = await Server.client.sendRequest<Location[]>( |
15 | 'm/parentModule', | ||
16 | request | ||
17 | ); | ||
13 | const loc = response[0]; | 18 | const loc = response[0]; |
14 | if (loc == null) { return; } | 19 | if (loc == null) { |
20 | return; | ||
21 | } | ||
15 | const uri = Server.client.protocol2CodeConverter.asUri(loc.uri); | 22 | const uri = Server.client.protocol2CodeConverter.asUri(loc.uri); |
16 | const range = Server.client.protocol2CodeConverter.asRange(loc.range); | 23 | const range = Server.client.protocol2CodeConverter.asRange(loc.range); |
17 | 24 | ||