From b47591158218a5321da6f7c5ddf8ed553b077d89 Mon Sep 17 00:00:00 2001 From: Nikita Romanov Date: Wed, 8 Feb 2023 23:21:12 +0400 Subject: [PATCH] Add option for selecting a favorite device in the launch.json --- src/VSCode.Extension/tasks/debug.ts | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/VSCode.Extension/tasks/debug.ts b/src/VSCode.Extension/tasks/debug.ts index 7a9bddf6..5cba6243 100644 --- a/src/VSCode.Extension/tasks/debug.ts +++ b/src/VSCode.Extension/tasks/debug.ts @@ -1,5 +1,6 @@ import { WorkspaceFolder, DebugConfiguration } from 'vscode'; import { Configuration } from '../configuration'; +import { UIController } from '../controller'; import { Target } from '../models'; import * as res from '../resources'; import * as vscode from 'vscode'; @@ -10,8 +11,13 @@ export class DotNetDebuggerConfiguration implements vscode.DebugConfigurationPro config: DebugConfiguration, token?: vscode.CancellationToken): Promise { - if (!Configuration.validate()) return undefined; - if (config.noDebug === undefined) { + if (config.device !== undefined) + UIController.performSelectDevice(UIController.devices.find(d => d.name === config.device)); + + if (!Configuration.validate()) + return undefined; + + if (!config.noDebug) { if (Configuration.isWindows()) { vscode.window.showErrorMessage(res.messageDebugNotSupportedWin); return undefined;