feature: add build system info; runnables to rust-project.json

This commit is contained in:
Wilfred Hughes 2024-06-11 11:55:04 -04:00 committed by David Barsky
parent 14a1f4530c
commit 71a78a9cdc
17 changed files with 628 additions and 227 deletions

View file

@ -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.");