Skip to content

Commit 87baa0e

Browse files
committed
add knownEngines lldb-dap
1 parent d5984c7 commit 87baa0e

File tree

1 file changed

+20
-0
lines changed
  • src/tools/rust-analyzer/editors/code/src

1 file changed

+20
-0
lines changed

src/tools/rust-analyzer/editors/code/src/debug.ts

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,9 +105,11 @@ async function getDebugConfiguration(
105105
const commandCCpp: string = createCommandLink("ms-vscode.cpptools");
106106
const commandCodeLLDB: string = createCommandLink("vadimcn.vscode-lldb");
107107
const commandNativeDebug: string = createCommandLink("webfreak.debug");
108+
const commandLLDBDap: string = createCommandLink("llvm-vs-code-extensions.lldb-dap");
108109

109110
await vscode.window.showErrorMessage(
110111
`Install [CodeLLDB](command:${commandCodeLLDB} "Open CodeLLDB")` +
112+
`, [lldb-dap](command:${commandLLDBDap} "Open lldb-dap")` +
111113
`, [C/C++](command:${commandCCpp} "Open C/C++") ` +
112114
`or [Native Debug](command:${commandNativeDebug} "Open Native Debug") for debugging.`,
113115
);
@@ -220,10 +222,21 @@ type DebugConfigProvider<Type extends string, DebugConfig extends BaseDebugConfi
220222

221223
type KnownEnginesType = (typeof knownEngines)[keyof typeof knownEngines];
222224
const knownEngines: {
225+
"llvm-vs-code-extensions.lldb-dap": DebugConfigProvider<"lldb-dap", LldbDapDebugConfig>;
223226
"vadimcn.vscode-lldb": DebugConfigProvider<"lldb", CodeLldbDebugConfig>;
224227
"ms-vscode.cpptools": DebugConfigProvider<"cppvsdbg" | "cppdbg", CCppDebugConfig>;
225228
"webfreak.debug": DebugConfigProvider<"gdb", NativeDebugConfig>;
226229
} = {
230+
"llvm-vs-code-extensions.lldb-dap":{
231+
type: "lldb-dap",
232+
executableProperty: "program",
233+
environmentProperty: (env) => ["env", env],
234+
runnableArgsProperty: (runnableArgs: ra.CargoRunnableArgs) => [
235+
"args",
236+
runnableArgs.executableArgs,
237+
],
238+
239+
},
227240
"vadimcn.vscode-lldb": {
228241
type: "lldb",
229242
executableProperty: "program",
@@ -336,6 +349,13 @@ type CCppDebugConfig = {
336349
};
337350
} & BaseDebugConfig<"cppvsdbg" | "cppdbg">;
338351

352+
type LldbDapDebugConfig = {
353+
program: string;
354+
args: string[];
355+
env: Record<string, string>;
356+
} & BaseDebugConfig<"lldb-dap">;
357+
358+
339359
type CodeLldbDebugConfig = {
340360
program: string;
341361
args: string[];

0 commit comments

Comments
 (0)