Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions src/CodingWithCalvin.LaunchyBar/Models/LaunchyBarConfiguration.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
9 changes: 9 additions & 0 deletions src/CodingWithCalvin.LaunchyBar/Services/DebugStateService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
13 changes: 7 additions & 6 deletions src/CodingWithCalvin.LaunchyBar/Services/LaunchService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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
{
Expand Down Expand Up @@ -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;
}

Expand All @@ -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);
}
}

Expand Down
Loading