Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions editors/code/src/commands.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import {
selectRunnable,
createTaskFromRunnable,
createCargoArgs,
selectRunnableAtCursor,
} from "./run";
import {
isRustDocument,
Expand Down Expand Up @@ -1212,6 +1213,13 @@ export function debugSingle(ctx: CtxInit): Cmd {
};
}

export function fetchRunnableAtCursor(ctx: CtxInit): Cmd {
return async () => {
const editor = ctx.activeRustEditor ?? ctx.activeCargoTomlEditor;
return await selectRunnableAtCursor(ctx, editor, undefined);
};
}

export function newDebugConfig(ctx: CtxInit): Cmd {
return async () => {
const item = await selectRunnable(ctx, undefined, true, false);
Expand Down
1 change: 1 addition & 0 deletions editors/code/src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,7 @@ function createCommands(): Record<string, CommandFactory> {
copyRunCommandLine: { enabled: commands.copyRunCommandLine },
debug: { enabled: commands.debug },
newDebugConfig: { enabled: commands.newDebugConfig },
fetchRunnableAtCursor : { enabled: commands.fetchRunnableAtCursor },
openDocs: { enabled: commands.openDocs },
openExternalDocs: { enabled: commands.openExternalDocs },
openCargoToml: { enabled: commands.openCargoToml },
Expand Down
2 changes: 1 addition & 1 deletion editors/code/src/run.ts
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ export async function selectRunnable(
);
}

async function selectRunnableAtCursor(
export async function selectRunnableAtCursor(
ctx: CtxInit,
editor: RustEditor,
prevRunnable?: RunnableQuickPick,
Expand Down
Loading