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 | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/editors/code/src/commands.ts b/editors/code/src/commands.ts index 0e08b60a93..623e33c7ef 100644 --- a/editors/code/src/commands.ts +++ b/editors/code/src/commands.ts @@ -8,7 +8,7 @@ import { applySnippetWorkspaceEdit, applySnippetTextEdits } from './snippets'; import { spawnSync } from 'child_process'; import { RunnableQuickPick, selectRunnable, createTask, createArgs } from './run'; import { AstInspector } from './ast_inspector'; -import { isRustDocument, sleep, isRustEditor } from './util'; +import { isRustDocument, isCargoTomlDocument, sleep, isRustEditor } from './util'; import { startDebugSession, makeDebugConfig } from './debug'; import { LanguageClient } from 'vscode-languageclient/node'; @@ -185,10 +185,10 @@ export function onEnter(ctx: Ctx): Cmd { export function parentModule(ctx: Ctx): Cmd { return async () => { - const editor = ctx.activeRustEditor; + const editor = vscode.window.activeTextEditor; 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( |