File tree Expand file tree Collapse file tree 1 file changed +8
-10
lines changed
src/ExtensionManager.Vsix.Shared Expand file tree Collapse file tree 1 file changed +8
-10
lines changed Original file line number Diff line number Diff line change 1919using Microsoft . VisualStudio ;
2020using Microsoft . VisualStudio . Shell ;
2121
22+ using ShellSolutionEvents = Microsoft . VisualStudio . Shell . Events . SolutionEvents ;
2223using Task = System . Threading . Tasks . Task ;
2324
2425#nullable enable
@@ -79,24 +80,21 @@ private static async Task<IVSServiceFactory> CreateVSServiceFactoryAsync()
7980 private async Task HandleSolutionExtensionsAsync ( IVSSolutions solutions , IFeatureExecutor executor )
8081 {
8182 if ( await solutions . IsOpenAsync ( ) )
82- {
83- JoinableTaskFactory
84- . RunAsync ( ( ) => InstallSolutionExtensionsOnIdleAsync ( executor ) )
85- . FileAndForget ( $ "{ nameof ( ExtensionManager ) } /{ nameof ( InstallSolutionExtensionsOnIdleAsync ) } ") ;
86- }
83+ InstallSolutionExtensionsOnIdle ( executor ) ;
8784
88- VS . Events . SolutionEvents . OnAfterOpenSolution += s =>
85+ ShellSolutionEvents . OnAfterOpenSolution += ( s , e ) =>
8986 {
9087 if ( _isFeatureExecuting )
9188 return ;
9289
93- _ = InstallSolutionExtensionsOnIdleAsync ( executor ) ;
90+ InstallSolutionExtensionsOnIdle ( executor ) ;
9491 } ;
9592
96- static async Task InstallSolutionExtensionsOnIdleAsync ( IFeatureExecutor executor )
93+ void InstallSolutionExtensionsOnIdle ( IFeatureExecutor executor )
9794 {
98- await ThreadHelper . JoinableTaskFactory . StartOnIdle (
99- executor . ExecuteAsync < InstallForSolutionFeature > ) ;
95+ JoinableTaskFactory
96+ . StartOnIdle ( executor . ExecuteAsync < InstallForSolutionFeature > )
97+ . FileAndForget ( $ "{ nameof ( ExtensionManager ) } /{ nameof ( InstallForSolutionFeature ) } ") ;
10098 }
10199 }
102100
You can’t perform that action at this time.
0 commit comments