From d7159234f6858c8631fce41f7c6f3d7741256122 Mon Sep 17 00:00:00 2001 From: Dominique Louis Date: Mon, 18 Mar 2024 12:10:27 +0000 Subject: [PATCH] Slight refactor of where we check when to inlcude PCBs --- .../MeadowExecutionCommand.cs | 18 ++++++------------ .../MeadowExecutionHandler.cs | 2 +- .../MeadowSoftDebuggerSession.cs | 10 +++++++++- 3 files changed, 16 insertions(+), 14 deletions(-) diff --git a/VS4Mac_Meadow_Extension/MeadowExecutionCommand.cs b/VS4Mac_Meadow_Extension/MeadowExecutionCommand.cs index 76aa455..5ae2faf 100644 --- a/VS4Mac_Meadow_Extension/MeadowExecutionCommand.cs +++ b/VS4Mac_Meadow_Extension/MeadowExecutionCommand.cs @@ -17,11 +17,6 @@ namespace Meadow.Sdks.IdeExtensions.Vs4Mac { public class MeadowExecutionCommand : ProcessExecutionCommand { - public MeadowExecutionCommand() : base() - { - logger = new OutputLogger(); - } - // Adrian: Task because it's been assigned in a non-async method // i.e. it's a task to avoid awaiting the assignment (lazy but harmless) public Task> ReferencedAssemblies { get; set; } @@ -32,7 +27,12 @@ public MeadowExecutionCommand() : base() IMeadowConnection meadowConnection = null; DebuggingServer meadowDebugServer = null; - public async Task DeployApp(int debugPort, CancellationToken cancellationToken) + public MeadowExecutionCommand() : base() + { + logger = new OutputLogger(); + } + + public async Task DeployApp(int debugPort, bool includePdbs, CancellationToken cancellationToken) { DeploymentTargetsManager.StopPollingForDevices(); @@ -81,12 +81,6 @@ public async Task DeployApp(int debugPort, CancellationToken cancellationToken) Debug.WriteLine("OS download failed, make sure you have an active internet connection"); } - var configuration = IdeApp.Workspace.ActiveConfiguration; - - bool includePdbs = configuration is SolutionConfigurationSelector isScs - && isScs?.Id == "Debug" - && debugPort > 1000; - meadowConnection!.FileWriteProgress += MeadowConnection_DeploymentProgress; meadowConnection!.DeviceMessageReceived += MeadowConnection_DeviceMessageReceived; diff --git a/VS4Mac_Meadow_Extension/MeadowExecutionHandler.cs b/VS4Mac_Meadow_Extension/MeadowExecutionHandler.cs index ec6227f..4767dae 100644 --- a/VS4Mac_Meadow_Extension/MeadowExecutionHandler.cs +++ b/VS4Mac_Meadow_Extension/MeadowExecutionHandler.cs @@ -17,7 +17,7 @@ public ProcessAsyncOperation Execute(ExecutionCommand command, OperationConsole { try { - return new ProcessAsyncOperation(meadowCommand.DeployApp(-1, cts.Token), cts); + return new ProcessAsyncOperation(meadowCommand.DeployApp(-1, false, cts.Token), cts); } catch (Exception ex) { diff --git a/VS4Mac_Meadow_Extension/MeadowSoftDebuggerSession.cs b/VS4Mac_Meadow_Extension/MeadowSoftDebuggerSession.cs index 11967a9..8771a0f 100644 --- a/VS4Mac_Meadow_Extension/MeadowSoftDebuggerSession.cs +++ b/VS4Mac_Meadow_Extension/MeadowSoftDebuggerSession.cs @@ -3,6 +3,8 @@ using System.Threading; using Mono.Debugging.Client; using Mono.Debugging.Soft; +using MonoDevelop.Ide; +using MonoDevelop.Projects; namespace Meadow.Sdks.IdeExtensions.Vs4Mac { @@ -25,7 +27,13 @@ protected override async void OnRun(DebuggerStartInfo startInfo) var connectArgs = meadowStartInfo.StartArgs as SoftDebuggerConnectArgs; var port = connectArgs?.DebugPort ?? 0; - await meadowStartInfo.ExecutionCommand.DeployApp(port, debugCancelTokenSource.Token); + var configuration = IdeApp.Workspace.ActiveConfiguration; + + bool includePdbs = configuration is SolutionConfigurationSelector isScs + && isScs?.Id == "Debug" + && port > 1000; + + await meadowStartInfo.ExecutionCommand.DeployApp(port, includePdbs, debugCancelTokenSource.Token); base.OnRun(startInfo); }