add knownEngines lldb-dap

This commit is contained in:
kouhe3 2024-10-08 00:22:58 +08:00
parent 2b750da1a1
commit 85caf88b54

View file

@ -105,9 +105,11 @@ async function getDebugConfiguration(
const commandCCpp: string = createCommandLink("ms-vscode.cpptools"); const commandCCpp: string = createCommandLink("ms-vscode.cpptools");
const commandCodeLLDB: string = createCommandLink("vadimcn.vscode-lldb"); const commandCodeLLDB: string = createCommandLink("vadimcn.vscode-lldb");
const commandNativeDebug: string = createCommandLink("webfreak.debug"); const commandNativeDebug: string = createCommandLink("webfreak.debug");
const commandLLDBDap: string = createCommandLink("llvm-vs-code-extensions.lldb-dap");
await vscode.window.showErrorMessage( await vscode.window.showErrorMessage(
`Install [CodeLLDB](command:${commandCodeLLDB} "Open CodeLLDB")` + `Install [CodeLLDB](command:${commandCodeLLDB} "Open CodeLLDB")` +
`, [lldb-dap](command:${commandLLDBDap} "Open lldb-dap")` +
`, [C/C++](command:${commandCCpp} "Open C/C++") ` + `, [C/C++](command:${commandCCpp} "Open C/C++") ` +
`or [Native Debug](command:${commandNativeDebug} "Open Native Debug") for debugging.`, `or [Native Debug](command:${commandNativeDebug} "Open Native Debug") for debugging.`,
); );
@ -220,10 +222,21 @@ type DebugConfigProvider<Type extends string, DebugConfig extends BaseDebugConfi
type KnownEnginesType = (typeof knownEngines)[keyof typeof knownEngines]; type KnownEnginesType = (typeof knownEngines)[keyof typeof knownEngines];
const knownEngines: { const knownEngines: {
"llvm-vs-code-extensions.lldb-dap": DebugConfigProvider<"lldb-dap", LldbDapDebugConfig>;
"vadimcn.vscode-lldb": DebugConfigProvider<"lldb", CodeLldbDebugConfig>; "vadimcn.vscode-lldb": DebugConfigProvider<"lldb", CodeLldbDebugConfig>;
"ms-vscode.cpptools": DebugConfigProvider<"cppvsdbg" | "cppdbg", CCppDebugConfig>; "ms-vscode.cpptools": DebugConfigProvider<"cppvsdbg" | "cppdbg", CCppDebugConfig>;
"webfreak.debug": DebugConfigProvider<"gdb", NativeDebugConfig>; "webfreak.debug": DebugConfigProvider<"gdb", NativeDebugConfig>;
} = { } = {
"llvm-vs-code-extensions.lldb-dap":{
type: "lldb-dap",
executableProperty: "program",
environmentProperty: (env) => ["env", env],
runnableArgsProperty: (runnableArgs: ra.CargoRunnableArgs) => [
"args",
runnableArgs.executableArgs,
],
},
"vadimcn.vscode-lldb": { "vadimcn.vscode-lldb": {
type: "lldb", type: "lldb",
executableProperty: "program", executableProperty: "program",
@ -336,6 +349,13 @@ type CCppDebugConfig = {
}; };
} & BaseDebugConfig<"cppvsdbg" | "cppdbg">; } & BaseDebugConfig<"cppvsdbg" | "cppdbg">;
type LldbDapDebugConfig = {
program: string;
args: string[];
env: Record<string, string>;
} & BaseDebugConfig<"lldb-dap">;
type CodeLldbDebugConfig = { type CodeLldbDebugConfig = {
program: string; program: string;
args: string[]; args: string[];