Skip to content

Commit

Permalink
Don't initialize the StackTraceExplorer tool window until it is invok…
Browse files Browse the repository at this point in the history
…ed (#60973)

Fixes AB#1524181

Tested locally and command invocation works as expected. The initialization was causing package loads while the Roslyn package was initializing. We can wait until needed, and likely those packages are loaded by then anyways.
  • Loading branch information
ryzngard authored Apr 27, 2022
1 parent 469e979 commit fb2d206
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 5 deletions.
4 changes: 2 additions & 2 deletions src/VisualStudio/Core/Def/RoslynPackage.cs
Original file line number Diff line number Diff line change
Expand Up @@ -256,7 +256,7 @@ private async Task LoadComponentsBackgroundAsync(CancellationToken cancellationT
await TaskScheduler.Default;

await LoadInteractiveMenusAsync(cancellationToken).ConfigureAwait(true);
await LoadCallstackExplorerMenusAsync(cancellationToken).ConfigureAwait(true);
await LoadStackTraceExplorerMenusAsync(cancellationToken).ConfigureAwait(true);

// Initialize keybinding reset detector
await ComponentModel.DefaultExportProvider.GetExportedValue<KeybindingReset.KeybindingResetDetector>().InitializeAsync().ConfigureAwait(true);
Expand Down Expand Up @@ -284,7 +284,7 @@ private async Task LoadInteractiveMenusAsync(CancellationToken cancellationToken
.ConfigureAwait(true);
}

private async Task LoadCallstackExplorerMenusAsync(CancellationToken cancellationToken)
private async Task LoadStackTraceExplorerMenusAsync(CancellationToken cancellationToken)
{
// Obtain services and QueryInterface from the main thread
await JoinableTaskFactory.SwitchToMainThreadAsync(cancellationToken);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -164,9 +164,6 @@ internal static void Initialize(OleMenuCommandService menuCommandService, Roslyn

_instance = new(package);

// Initialize the window on startup
_instance.GetOrInitializeWindow();

var menuCommandId = new CommandID(Guids.StackTraceExplorerCommandId, 0x0100);
var menuItem = new MenuCommand(_instance.Execute, menuCommandId);
menuCommandService.AddCommand(menuItem);
Expand Down

0 comments on commit fb2d206

Please sign in to comment.