mirror of
https://github.com/rust-lang/rust-analyzer
synced 2025-01-13 13:48:50 +00:00
Add additional debug options
This commit is contained in:
parent
c4ca6e29c2
commit
5426e2927e
3 changed files with 21 additions and 3 deletions
|
@ -418,6 +418,16 @@
|
||||||
"default": {
|
"default": {
|
||||||
"/rustc/<id>": "${env:USERPROFILE}/.rustup/toolchains/<toolchain-id>/lib/rustlib/src/rust"
|
"/rustc/<id>": "${env:USERPROFILE}/.rustup/toolchains/<toolchain-id>/lib/rustlib/src/rust"
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
"rust-analyzer.debug.openUpDebugPane": {
|
||||||
|
"description": "Whether to open up the Debug Pane on debugging start.",
|
||||||
|
"type": "boolean",
|
||||||
|
"default": false
|
||||||
|
},
|
||||||
|
"rust-analyzer.debug.engineSettings": {
|
||||||
|
"type": "object",
|
||||||
|
"default": {},
|
||||||
|
"description": "Optional settings passed to the debug engine."
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
|
@ -91,8 +91,6 @@ function getCppvsDebugConfig(config: ra.Runnable, executable: string, sourceFile
|
||||||
const debugOutput = vscode.window.createOutputChannel("Debug");
|
const debugOutput = vscode.window.createOutputChannel("Debug");
|
||||||
|
|
||||||
async function getDebugExecutable(config: ra.Runnable): Promise<string> {
|
async function getDebugExecutable(config: ra.Runnable): Promise<string> {
|
||||||
debugOutput.clear();
|
|
||||||
|
|
||||||
const cargo = new Cargo(config.cwd || '.', debugOutput);
|
const cargo = new Cargo(config.cwd || '.', debugOutput);
|
||||||
const executable = await cargo.executableFromArgs(config.args);
|
const executable = await cargo.executableFromArgs(config.args);
|
||||||
|
|
||||||
|
@ -130,8 +128,16 @@ export function debugSingle(ctx: Ctx): Cmd {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
debugOutput.clear();
|
||||||
|
if (ctx.config.debug.openUpDebugPane) {
|
||||||
|
debugOutput.show(true);
|
||||||
|
}
|
||||||
|
|
||||||
const executable = await getDebugExecutable(config);
|
const executable = await getDebugExecutable(config);
|
||||||
const debugConfig = knownEngines[debugEngine.id](config, executable, debugOptions.sourceFileMap);
|
let debugConfig = knownEngines[debugEngine.id](config, executable, debugOptions.sourceFileMap);
|
||||||
|
for (var key in debugOptions.engineSettings) {
|
||||||
|
debugConfig[key] = (debugOptions.engineSettings as any)[key];
|
||||||
|
}
|
||||||
|
|
||||||
debugOutput.appendLine("Launching debug configuration:");
|
debugOutput.appendLine("Launching debug configuration:");
|
||||||
debugOutput.appendLine(JSON.stringify(debugConfig, null, 2));
|
debugOutput.appendLine(JSON.stringify(debugConfig, null, 2));
|
||||||
|
|
|
@ -113,6 +113,8 @@ export class Config {
|
||||||
|
|
||||||
return {
|
return {
|
||||||
engine: this.get<string>("debug.engine"),
|
engine: this.get<string>("debug.engine"),
|
||||||
|
engineSettings: this.get<object>("debug.engineSettings"),
|
||||||
|
openUpDebugPane: this.get<boolean>("debug.openUpDebugPane"),
|
||||||
sourceFileMap: sourceFileMap,
|
sourceFileMap: sourceFileMap,
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue