This repository was archived by the owner on Jun 21, 2023. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +5
-6
lines changed
src/GitHub.VisualStudio/UI Expand file tree Collapse file tree 1 file changed +5
-6
lines changed Original file line number Diff line number Diff line change @@ -83,21 +83,20 @@ protected override void Initialize()
8383 // Using JoinableTaskFactory from parent AsyncPackage. That way if VS shuts down before this
8484 // work is done, we won't risk crashing due to arbitrary work going on in background threads.
8585 var asyncPackage = ( AsyncPackage ) Package ;
86- viewModelTask = asyncPackage . JoinableTaskFactory . RunAsync ( InitializeAsync ) ;
86+ viewModelTask = asyncPackage . JoinableTaskFactory . RunAsync ( ( ) => InitializeAsync ( asyncPackage ) ) ;
8787 }
8888
8989 public Task < IGitHubPaneViewModel > GetViewModelAsync ( ) => viewModelTask . JoinAsync ( ) ;
9090
91- async Task < IGitHubPaneViewModel > InitializeAsync ( )
91+ async Task < IGitHubPaneViewModel > InitializeAsync ( AsyncPackage asyncPackage )
9292 {
9393 try
9494 {
95- // Allow MEF to initialize its cache asynchronously
9695 ShowInitializing ( ) ;
97- var asyncServiceProvider = ( IAsyncServiceProvider ) GetService ( typeof ( SAsyncServiceProvider ) ) ;
98- await asyncServiceProvider . GetServiceAsync ( typeof ( SComponentModel ) ) ;
9996
100- var provider = VisualStudio . Services . GitHubServiceProvider ;
97+ // Allow MEF to initialize its cache asynchronously
98+ var provider = ( IGitHubServiceProvider ) await asyncPackage . GetServiceAsync ( typeof ( IGitHubServiceProvider ) ) ;
99+
101100 var teServiceHolder = provider . GetService < ITeamExplorerServiceHolder > ( ) ;
102101 teServiceHolder . ServiceProvider = this ;
103102
You can’t perform that action at this time.
0 commit comments