diff options
Diffstat (limited to 'editors/code')
-rw-r--r-- | editors/code/package.json | 10 | ||||
-rw-r--r-- | editors/code/src/commands/runnables.ts | 12 | ||||
-rw-r--r-- | editors/code/src/config.ts | 2 |
3 files changed, 21 insertions, 3 deletions
diff --git a/editors/code/package.json b/editors/code/package.json index eeb3d3513..84aea8249 100644 --- a/editors/code/package.json +++ b/editors/code/package.json | |||
@@ -418,6 +418,16 @@ | |||
418 | "default": { | 418 | "default": { |
419 | "/rustc/<id>": "${env:USERPROFILE}/.rustup/toolchains/<toolchain-id>/lib/rustlib/src/rust" | 419 | "/rustc/<id>": "${env:USERPROFILE}/.rustup/toolchains/<toolchain-id>/lib/rustlib/src/rust" |
420 | } | 420 | } |
421 | }, | ||
422 | "rust-analyzer.debug.openUpDebugPane": { | ||
423 | "description": "Whether to open up the Debug Pane on debugging start.", | ||
424 | "type": "boolean", | ||
425 | "default": false | ||
426 | }, | ||
427 | "rust-analyzer.debug.engineSettings": { | ||
428 | "type": "object", | ||
429 | "default": {}, | ||
430 | "description": "Optional settings passed to the debug engine." | ||
421 | } | 431 | } |
422 | } | 432 | } |
423 | }, | 433 | }, |
diff --git a/editors/code/src/commands/runnables.ts b/editors/code/src/commands/runnables.ts index 7bb8727e7..782a7ba89 100644 --- a/editors/code/src/commands/runnables.ts +++ b/editors/code/src/commands/runnables.ts | |||
@@ -91,8 +91,6 @@ function getCppvsDebugConfig(config: ra.Runnable, executable: string, sourceFile | |||
91 | const debugOutput = vscode.window.createOutputChannel("Debug"); | 91 | const debugOutput = vscode.window.createOutputChannel("Debug"); |
92 | 92 | ||
93 | async function getDebugExecutable(config: ra.Runnable): Promise<string> { | 93 | async function getDebugExecutable(config: ra.Runnable): Promise<string> { |
94 | debugOutput.clear(); | ||
95 | |||
96 | const cargo = new Cargo(config.cwd || '.', debugOutput); | 94 | const cargo = new Cargo(config.cwd || '.', debugOutput); |
97 | const executable = await cargo.executableFromArgs(config.args); | 95 | const executable = await cargo.executableFromArgs(config.args); |
98 | 96 | ||
@@ -130,8 +128,16 @@ export function debugSingle(ctx: Ctx): Cmd { | |||
130 | return; | 128 | return; |
131 | } | 129 | } |
132 | 130 | ||
131 | debugOutput.clear(); | ||
132 | if (ctx.config.debug.openUpDebugPane) { | ||
133 | debugOutput.show(true); | ||
134 | } | ||
135 | |||
133 | const executable = await getDebugExecutable(config); | 136 | const executable = await getDebugExecutable(config); |
134 | const debugConfig = knownEngines[debugEngine.id](config, executable, debugOptions.sourceFileMap); | 137 | let debugConfig = knownEngines[debugEngine.id](config, executable, debugOptions.sourceFileMap); |
138 | for (var key in debugOptions.engineSettings) { | ||
139 | debugConfig[key] = (debugOptions.engineSettings as any)[key]; | ||
140 | } | ||
135 | 141 | ||
136 | debugOutput.appendLine("Launching debug configuration:"); | 142 | debugOutput.appendLine("Launching debug configuration:"); |
137 | debugOutput.appendLine(JSON.stringify(debugConfig, null, 2)); | 143 | debugOutput.appendLine(JSON.stringify(debugConfig, null, 2)); |
diff --git a/editors/code/src/config.ts b/editors/code/src/config.ts index 8bceaaf72..533be1913 100644 --- a/editors/code/src/config.ts +++ b/editors/code/src/config.ts | |||
@@ -113,6 +113,8 @@ export class Config { | |||
113 | 113 | ||
114 | return { | 114 | return { |
115 | engine: this.get<string>("debug.engine"), | 115 | engine: this.get<string>("debug.engine"), |
116 | engineSettings: this.get<object>("debug.engineSettings"), | ||
117 | openUpDebugPane: this.get<boolean>("debug.openUpDebugPane"), | ||
116 | sourceFileMap: sourceFileMap, | 118 | sourceFileMap: sourceFileMap, |
117 | }; | 119 | }; |
118 | } | 120 | } |