Unnamed repository; edit this file 'description' to name the repository.
Diffstat (limited to 'editors/code/src/commands.ts')
| -rw-r--r-- | editors/code/src/commands.ts | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/editors/code/src/commands.ts b/editors/code/src/commands.ts index 623e33c7ef..c9385361f8 100644 --- a/editors/code/src/commands.ts +++ b/editors/code/src/commands.ts @@ -189,12 +189,14 @@ export function parentModule(ctx: Ctx): Cmd { const client = ctx.client; if (!editor || !client) return; if (!(isRustDocument(editor.document) || isCargoTomlDocument(editor.document))) return; + const locations = await client.sendRequest(ra.parentModule, { textDocument: ctx.client.code2ProtocolConverter.asTextDocumentIdentifier(editor.document), position: client.code2ProtocolConverter.asPosition( editor.selection.active, ), }); + if (!locations) return; if (locations.length === 1) { const loc = locations[0]; |