diff options
Diffstat (limited to 'editors/code/src/commands')
-rw-r--r-- | editors/code/src/commands/runnables.ts | 22 |
1 files changed, 21 insertions, 1 deletions
diff --git a/editors/code/src/commands/runnables.ts b/editors/code/src/commands/runnables.ts index 06b513466..357155163 100644 --- a/editors/code/src/commands/runnables.ts +++ b/editors/code/src/commands/runnables.ts | |||
@@ -62,6 +62,26 @@ export function runSingle(ctx: Ctx): Cmd { | |||
62 | }; | 62 | }; |
63 | } | 63 | } |
64 | 64 | ||
65 | export function debugSingle(ctx: Ctx): Cmd { | ||
66 | return async (config: ra.Runnable) => { | ||
67 | const editor = ctx.activeRustEditor; | ||
68 | if (!editor) return; | ||
69 | |||
70 | const debugConfig = { | ||
71 | type: "lldb", | ||
72 | request: "launch", | ||
73 | name: config.label, | ||
74 | cargo: { | ||
75 | args: config.args, | ||
76 | }, | ||
77 | args: config.extraArgs, | ||
78 | cwd: config.cwd | ||
79 | }; | ||
80 | |||
81 | return vscode.debug.startDebugging(undefined, debugConfig); | ||
82 | }; | ||
83 | } | ||
84 | |||
65 | class RunnableQuickPick implements vscode.QuickPickItem { | 85 | class RunnableQuickPick implements vscode.QuickPickItem { |
66 | public label: string; | 86 | public label: string; |
67 | public description?: string | undefined; | 87 | public description?: string | undefined; |
@@ -87,7 +107,7 @@ function createTask(spec: ra.Runnable): vscode.Task { | |||
87 | type: 'cargo', | 107 | type: 'cargo', |
88 | label: spec.label, | 108 | label: spec.label, |
89 | command: spec.bin, | 109 | command: spec.bin, |
90 | args: spec.args, | 110 | args: spec.extraArgs ? [...spec.args, '--', ...spec.extraArgs] : spec.args, |
91 | env: spec.env, | 111 | env: spec.env, |
92 | }; | 112 | }; |
93 | 113 | ||