@@ -35,27 +35,24 @@ IServiceProvider serviceProvider
3535 staticLogger = this ;
3636 }
3737
38- private void SetPane ( )
38+ private async Task SetPaneAsync ( )
3939 {
40- ThreadHelper . JoinableTaskFactory . Run ( async ( ) =>
41- {
42- await ThreadHelper . JoinableTaskFactory . SwitchToMainThreadAsync ( ) ;
43- _outputWindow = ( IVsOutputWindow ) _serviceProvider . GetService ( typeof ( SVsOutputWindow ) ) ;
44- Assumes . Present ( _outputWindow ) ;
45- dte = ( DTE2 ) _serviceProvider . GetService ( typeof ( EnvDTE . DTE ) ) ;
46- Assumes . Present ( dte ) ;
47-
48- // Create a new pane.
49- _outputWindow . CreatePane (
50- ref fccPaneGuid ,
51- "FCC" ,
52- Convert . ToInt32 ( true ) ,
53- Convert . ToInt32 ( false ) ) ; // do not clear with solution otherwise will not get initialize methods
54-
55- // Retrieve the new pane.
56- _outputWindow . GetPane ( ref fccPaneGuid , out IVsOutputWindowPane pane ) ;
57- _pane = pane ;
58- } ) ;
40+ await ThreadHelper . JoinableTaskFactory . SwitchToMainThreadAsync ( ) ;
41+ _outputWindow = ( IVsOutputWindow ) _serviceProvider . GetService ( typeof ( SVsOutputWindow ) ) ;
42+ Assumes . Present ( _outputWindow ) ;
43+ dte = ( DTE2 ) _serviceProvider . GetService ( typeof ( EnvDTE . DTE ) ) ;
44+ Assumes . Present ( dte ) ;
45+
46+ // Create a new pane.
47+ _outputWindow . CreatePane (
48+ ref fccPaneGuid ,
49+ "FCC" ,
50+ Convert . ToInt32 ( true ) ,
51+ Convert . ToInt32 ( false ) ) ; // do not clear with solution otherwise will not get initialize methods
52+
53+ // Retrieve the new pane.
54+ _outputWindow . GetPane ( ref fccPaneGuid , out IVsOutputWindowPane pane ) ;
55+ _pane = pane ;
5956 }
6057
6158 [ SuppressMessage ( "Usage" , "VSTHRD102:Implement internal logic asynchronously" ) ]
@@ -76,7 +73,7 @@ private void LogImpl(object[] message, bool withTitle)
7673
7774 if ( _pane == null )
7875 {
79- SetPane ( ) ;
76+ await SetPaneAsync ( ) ;
8077 }
8178
8279 if ( _pane == null )
@@ -154,7 +151,7 @@ public async Task ShowAsync()
154151
155152 if ( _pane == null )
156153 {
157- SetPane ( ) ;
154+ await SetPaneAsync ( ) ;
158155 }
159156
160157 if ( _pane != null )
0 commit comments