diff options
author | vsrs <[email protected]> | 2020-04-29 12:13:57 +0100 |
---|---|---|
committer | vsrs <[email protected]> | 2020-04-29 12:13:57 +0100 |
commit | 9153e96e88236e2f867dee8f0f291af5cfaf90f4 (patch) | |
tree | 7e43f5a89926d78a2c763546672fe8c2bc099fe0 | |
parent | 042917e6e3bc3cb05e08e487ee8a7d0d4ae3af6b (diff) |
better configuration enum items
-rw-r--r-- | editors/code/package.json | 25 | ||||
-rw-r--r-- | editors/code/src/commands/runnables.ts | 2 | ||||
-rw-r--r-- | editors/code/src/config.ts | 2 |
3 files changed, 16 insertions, 13 deletions
diff --git a/editors/code/package.json b/editors/code/package.json index aa8065171..4f2df89ef 100644 --- a/editors/code/package.json +++ b/editors/code/package.json | |||
@@ -390,22 +390,25 @@ | |||
390 | "default": false | 390 | "default": false |
391 | }, | 391 | }, |
392 | "rust-analyzer.debug.engine": { | 392 | "rust-analyzer.debug.engine": { |
393 | "type": [ | 393 | "type": "string", |
394 | "null", | ||
395 | "string" | ||
396 | ], | ||
397 | "enum": [ | 394 | "enum": [ |
398 | "ms-vscode.cpptools", | 395 | "auto", |
399 | "vadimcn.vscode-lldb" | 396 | "vadimcn.vscode-lldb", |
397 | "ms-vscode.cpptools" | ||
400 | ], | 398 | ], |
401 | "default": null, | 399 | "default": "auto", |
402 | "description": "Preffered debug engine." | 400 | "description": "Preffered debug engine.", |
401 | "markdownEnumDescriptions": [ | ||
402 | "First try to use [CodeLLDB](https://marketplace.visualstudio.com/items?itemName=vadimcn.vscode-lldb), if it's not installed use [MS C++ tools](https://marketplace.visualstudio.com/items?itemName=ms-vscode.cpptools).", | ||
403 | "Use [CodeLLDB](https://marketplace.visualstudio.com/items?itemName=vadimcn.vscode-lldb)", | ||
404 | "Use [MS C++ tools](https://marketplace.visualstudio.com/items?itemName=ms-vscode.cpptools)" | ||
405 | ] | ||
403 | }, | 406 | }, |
404 | "rust-analyzer.debug.sourceFileMap" : { | 407 | "rust-analyzer.debug.sourceFileMap": { |
405 | "type":"object", | 408 | "type": "object", |
406 | "description": "Optional source file mappings passed to the debug engine.", | 409 | "description": "Optional source file mappings passed to the debug engine.", |
407 | "default": { | 410 | "default": { |
408 | "<source-path>": "<target-path>" | 411 | "/rustc/<id>": "${env:USERPROFILE}/.rustup/toolchains/<toolchain-id>/lib/rustlib/src/rust" |
409 | } | 412 | } |
410 | } | 413 | } |
411 | } | 414 | } |
diff --git a/editors/code/src/commands/runnables.ts b/editors/code/src/commands/runnables.ts index befb8b366..2238a5a73 100644 --- a/editors/code/src/commands/runnables.ts +++ b/editors/code/src/commands/runnables.ts | |||
@@ -102,7 +102,7 @@ export function debugSingle(ctx: Ctx): Cmd { | |||
102 | 102 | ||
103 | let debugEngineId = ctx.config.debug.engine; | 103 | let debugEngineId = ctx.config.debug.engine; |
104 | let debugEngine = null; | 104 | let debugEngine = null; |
105 | if (!debugEngineId) { | 105 | if ( debugEngineId === "auto" ) { |
106 | debugEngine = vscode.extensions.getExtension(lldbId); | 106 | debugEngine = vscode.extensions.getExtension(lldbId); |
107 | if (!debugEngine) { | 107 | if (!debugEngine) { |
108 | debugEngine = vscode.extensions.getExtension(cpptoolsId); | 108 | debugEngine = vscode.extensions.getExtension(cpptoolsId); |
diff --git a/editors/code/src/config.ts b/editors/code/src/config.ts index 7764a2179..110e54180 100644 --- a/editors/code/src/config.ts +++ b/editors/code/src/config.ts | |||
@@ -109,7 +109,7 @@ export class Config { | |||
109 | 109 | ||
110 | get debug() { | 110 | get debug() { |
111 | return { | 111 | return { |
112 | engine: this.get<null | string>("debug.engine"), | 112 | engine: this.get<string>("debug.engine"), |
113 | sourceFileMap: this.get<Record<string, string>>("debug.sourceFileMap"), | 113 | sourceFileMap: this.get<Record<string, string>>("debug.sourceFileMap"), |
114 | }; | 114 | }; |
115 | } | 115 | } |