Skip to content

Commit 54112f8

Browse files
authored
Make debug adapter configurable
1 parent 731178e commit 54112f8

File tree

3 files changed

+15
-2
lines changed

3 files changed

+15
-2
lines changed

package.json

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -150,6 +150,12 @@
150150
],
151151
"description": "Arguments to pass to 'zig' for running tests. Supported variables: ${filter}, ${path}."
152152
},
153+
"zig.debugAdapter": {
154+
"scope": "resource",
155+
"type": "string",
156+
"default": "lldb",
157+
"description": "The debug adapter command to run when starting a debug session"
158+
},
153159
"zig.zls.debugLog": {
154160
"scope": "resource",
155161
"type": "boolean",

src/zigMainCodeLens.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,8 +79,11 @@ async function zigDebug() {
7979
}
8080
if (!binaryPath) return;
8181

82+
const config = vscode.workspace.getConfiguration("zig");
83+
const debugAdapter = config.get<string>("debugAdapter", "lldb");
84+
8285
const debugConfig: vscode.DebugConfiguration = {
83-
type: "lldb",
86+
type: debugAdapter,
8487
name: `Debug Zig`,
8588
request: "launch",
8689
program: binaryPath,

src/zigTestRunnerProvider.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -195,9 +195,13 @@ export default class ZigTestRunnerProvider {
195195
if (testItem.uri === undefined) {
196196
throw new Error("Unable to determine file location");
197197
}
198+
199+
const config = vscode.workspace.getConfiguration("zig");
200+
const debugAdapter = config.get<string>("debugAdapter", "lldb");
201+
198202
const testBinaryPath = await this.buildTestBinary(run, testItem.uri.fsPath, getTestDesc(testItem));
199203
const debugConfig: vscode.DebugConfiguration = {
200-
type: "lldb",
204+
type: debugAdapter,
201205
name: `Debug ${testItem.label}`,
202206
request: "launch",
203207
program: testBinaryPath,

0 commit comments

Comments
 (0)