From 9153e96e88236e2f867dee8f0f291af5cfaf90f4 Mon Sep 17 00:00:00 2001 From: vsrs Date: Wed, 29 Apr 2020 14:13:57 +0300 Subject: better configuration enum items --- editors/code/package.json | 25 ++++++++++++++----------- editors/code/src/commands/runnables.ts | 2 +- editors/code/src/config.ts | 2 +- 3 files changed, 16 insertions(+), 13 deletions(-) (limited to 'editors') 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 @@ "default": false }, "rust-analyzer.debug.engine": { - "type": [ - "null", - "string" - ], + "type": "string", "enum": [ - "ms-vscode.cpptools", - "vadimcn.vscode-lldb" + "auto", + "vadimcn.vscode-lldb", + "ms-vscode.cpptools" ], - "default": null, - "description": "Preffered debug engine." + "default": "auto", + "description": "Preffered debug engine.", + "markdownEnumDescriptions": [ + "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).", + "Use [CodeLLDB](https://marketplace.visualstudio.com/items?itemName=vadimcn.vscode-lldb)", + "Use [MS C++ tools](https://marketplace.visualstudio.com/items?itemName=ms-vscode.cpptools)" + ] }, - "rust-analyzer.debug.sourceFileMap" : { - "type":"object", + "rust-analyzer.debug.sourceFileMap": { + "type": "object", "description": "Optional source file mappings passed to the debug engine.", "default": { - "": "" + "/rustc/": "${env:USERPROFILE}/.rustup/toolchains//lib/rustlib/src/rust" } } } 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 { let debugEngineId = ctx.config.debug.engine; let debugEngine = null; - if (!debugEngineId) { + if ( debugEngineId === "auto" ) { debugEngine = vscode.extensions.getExtension(lldbId); if (!debugEngine) { 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 { get debug() { return { - engine: this.get("debug.engine"), + engine: this.get("debug.engine"), sourceFileMap: this.get>("debug.sourceFileMap"), }; } -- cgit v1.2.3