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 | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/editors/code/src/commands.ts b/editors/code/src/commands.ts index 9f4930c94a..5cec2c61a5 100644 --- a/editors/code/src/commands.ts +++ b/editors/code/src/commands.ts @@ -9,10 +9,11 @@ import { applySnippetTextEdits, type SnippetTextDocumentEdit, } from "./snippets"; -import { type RunnableQuickPick, selectRunnable, createTask, createArgs } from "./run"; +import { type RunnableQuickPick, selectRunnable, createTask, createCargoArgs } from "./run"; import { AstInspector } from "./ast_inspector"; import { isRustDocument, + isCargoRunnableArgs, isCargoTomlDocument, sleep, isRustEditor, @@ -1154,8 +1155,8 @@ export function copyRunCommandLine(ctx: CtxInit) { let prevRunnable: RunnableQuickPick | undefined; return async () => { const item = await selectRunnable(ctx, prevRunnable); - if (!item) return; - const args = createArgs(item.runnable); + if (!item || !isCargoRunnableArgs(item.runnable.args)) return; + const args = createCargoArgs(item.runnable.args); const commandLine = ["cargo", ...args].join(" "); await vscode.env.clipboard.writeText(commandLine); await vscode.window.showInformationMessage("Cargo invocation copied to the clipboard."); |