diff --git a/src/VisualStudio/CSharp/Impl/SemanticSearch/SemanticSearchToolWindowImpl.cs b/src/VisualStudio/CSharp/Impl/SemanticSearch/SemanticSearchToolWindowImpl.cs index 23fc22863b3e9..2864e60accb02 100644 --- a/src/VisualStudio/CSharp/Impl/SemanticSearch/SemanticSearchToolWindowImpl.cs +++ b/src/VisualStudio/CSharp/Impl/SemanticSearch/SemanticSearchToolWindowImpl.cs @@ -64,7 +64,7 @@ internal sealed class SemanticSearchToolWindowImpl( IStreamingFindUsagesPresenter resultsPresenter, ITextUndoHistoryRegistry undoHistoryRegistry, ISemanticSearchCopilotService copilotService, - ISemanticSearchCopilotUIProvider copilotUIProvider, + Lazy copilotUIProvider, // lazy to avoid loading Microsoft.VisualStudio.LanguageServices.ExternalAccess.Copilot IVsService vsUIShellProvider) : ISemanticSearchWorkspaceHost, OptionsProvider { private const int ToolBarHeight = 26; @@ -193,7 +193,7 @@ public async Task InitializeAsync(CancellationToken cancellati private CopilotUI? CreateCopilotUI() { - if (!copilotUIProvider.IsAvailable || !copilotService.IsAvailable) + if (!copilotUIProvider.Value.IsAvailable || !copilotService.IsAvailable) { return null; } @@ -216,7 +216,7 @@ public async Task InitializeAsync(CancellationToken cancellati promptGrid.ColumnDefinitions.Add(new ColumnDefinition { MaxWidth = 600, Width = GridLength.Auto }); promptGrid.ColumnDefinitions.Add(new ColumnDefinition { Width = GridLength.Auto }); - var promptTextBox = copilotUIProvider.GetTextBox(); + var promptTextBox = copilotUIProvider.Value.GetTextBox(); var panel = new StackPanel() {