From c3439491055c079baa7964acfdce057cf57259c0 Mon Sep 17 00:00:00 2001 From: "Calvin A. Allen" Date: Wed, 8 Apr 2026 16:39:41 -0400 Subject: [PATCH] feat(debug): add start without debugging button Add a separate button for Debug.StartWithoutDebugging alongside the existing debug button. Both buttons toggle to a stop icon when a session is active. --- .../Models/LaunchyBarConfiguration.cs | 10 ++++++++++ .../Services/DebugStateService.cs | 9 +++++++++ .../Services/LaunchService.cs | 13 +++++++------ 3 files changed, 26 insertions(+), 6 deletions(-) diff --git a/src/CodingWithCalvin.LaunchyBar/Models/LaunchyBarConfiguration.cs b/src/CodingWithCalvin.LaunchyBar/Models/LaunchyBarConfiguration.cs index 658fda8..b8935b2 100644 --- a/src/CodingWithCalvin.LaunchyBar/Models/LaunchyBarConfiguration.cs +++ b/src/CodingWithCalvin.LaunchyBar/Models/LaunchyBarConfiguration.cs @@ -72,6 +72,16 @@ public static LaunchyBarConfiguration CreateDefault() Order = 3 }, new() + { + Id = "start-without-debugging", + Name = "Start Without Debugging", + IconPath = "KnownMonikers.RunOutline", + Type = LaunchItemType.VsCommand, + Target = "Debug.StartWithoutDebugging", + Position = LaunchItemPosition.Top, + Order = 4 + }, + new() { Id = "terminal", Name = "Terminal", diff --git a/src/CodingWithCalvin.LaunchyBar/Services/DebugStateService.cs b/src/CodingWithCalvin.LaunchyBar/Services/DebugStateService.cs index 792525a..1444dc9 100644 --- a/src/CodingWithCalvin.LaunchyBar/Services/DebugStateService.cs +++ b/src/CodingWithCalvin.LaunchyBar/Services/DebugStateService.cs @@ -61,6 +61,15 @@ private void UpdateDebugIcon(bool isDebugging) debugItem.IconPath = isDebugging ? "KnownMonikers.Stop" : "KnownMonikers.Run"; debugItem.Name = isDebugging ? "Stop Debugging" : "Start Debugging"; } + + var startWithoutDebuggingItem = _configurationService.Configuration.Items + .FirstOrDefault(i => i.Id == "start-without-debugging" || i.Target == "Debug.StartWithoutDebugging"); + + if (startWithoutDebuggingItem != null) + { + startWithoutDebuggingItem.IconPath = isDebugging ? "KnownMonikers.Stop" : "KnownMonikers.RunOutline"; + startWithoutDebuggingItem.Name = isDebugging ? "Stop Debugging" : "Start Without Debugging"; + } } public void Dispose() diff --git a/src/CodingWithCalvin.LaunchyBar/Services/LaunchService.cs b/src/CodingWithCalvin.LaunchyBar/Services/LaunchService.cs index 5373ec9..ff1193e 100644 --- a/src/CodingWithCalvin.LaunchyBar/Services/LaunchService.cs +++ b/src/CodingWithCalvin.LaunchyBar/Services/LaunchService.cs @@ -71,9 +71,10 @@ public async Task ExecuteAsync(LaunchItem item) case LaunchItemType.VsCommand: // Special handling for debug commands - if (item.Target.Equals("Debug.Start", StringComparison.OrdinalIgnoreCase)) + if (item.Target.Equals("Debug.Start", StringComparison.OrdinalIgnoreCase) || + item.Target.Equals("Debug.StartWithoutDebugging", StringComparison.OrdinalIgnoreCase)) { - await ToggleDebugAsync(); + await ToggleDebugAsync(item.Target); } else { @@ -201,14 +202,14 @@ private async Task HideOtherToolWindowsAsync(LaunchItem currentItem) } } - private async Task ToggleDebugAsync() + private async Task ToggleDebugAsync(string startCommand) { await ThreadHelper.JoinableTaskFactory.SwitchToMainThreadAsync(); var dte = await _package.GetServiceAsync(typeof(DTE)) as DTE2; if (dte == null) { - await VS.Commands.ExecuteAsync("Debug.Start"); + await VS.Commands.ExecuteAsync(startCommand); return; } @@ -221,8 +222,8 @@ private async Task ToggleDebugAsync() } else { - // Not debugging - start - await VS.Commands.ExecuteAsync("Debug.Start"); + // Not debugging - start with the specified command + await VS.Commands.ExecuteAsync(startCommand); } }