Skip to content

Commit

Permalink
Add option for selecting a favorite device in the launch.json
Browse files Browse the repository at this point in the history
  • Loading branch information
Nikita Romanov committed Feb 8, 2023
1 parent 7c589bd commit b475911
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions src/VSCode.Extension/tasks/debug.ts
Original file line number Diff line number Diff line change
@@ -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';
Expand All @@ -10,8 +11,13 @@ export class DotNetDebuggerConfiguration implements vscode.DebugConfigurationPro
config: DebugConfiguration,
token?: vscode.CancellationToken): Promise<DebugConfiguration | undefined> {

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;
Expand Down

0 comments on commit b475911

Please sign in to comment.