@@ -56,31 +56,30 @@ public class EditorServicesHost
5656 {
5757 #region Private Fields
5858
59- private ILogger logger ;
60- private bool enableConsoleRepl ;
61- private HostDetails hostDetails ;
62- private ProfilePaths profilePaths ;
59+ private string [ ] additionalModules ;
6360 private string bundledModulesPath ;
6461 private DebugAdapter debugAdapter ;
65- private string [ ] additionalModules ;
6662 private EditorSession editorSession ;
63+ private bool enableConsoleRepl ;
6764 private HashSet < string > featureFlags ;
65+ private HostDetails hostDetails ;
6866 private LanguageServer languageServer ;
67+ private ILogger logger ;
68+ private ProfilePaths profilePaths ;
69+ private TaskCompletionSource < bool > serverCompletedTask ;
6970
7071 private IServerListener languageServiceListener ;
7172 private IServerListener debugServiceListener ;
7273
73- private TaskCompletionSource < bool > serverCompletedTask ;
74-
7574 #endregion
7675
7776 #region Properties
7877
79- public EditorServicesHostStatus Status { get ; private set ; }
78+ public int DebugServicePort { get ; private set ; }
8079
8180 public int LanguageServicePort { get ; private set ; }
8281
83- public int DebugServicePort { get ; private set ; }
82+ public EditorServicesHostStatus Status { get ; private set ; }
8483
8584 #endregion
8685
@@ -108,6 +107,7 @@ public EditorServicesHost(
108107 this . bundledModulesPath = bundledModulesPath ;
109108 this . additionalModules = additionalModules ?? new string [ 0 ] ;
110109 this . featureFlags = new HashSet < string > ( featureFlags ?? new string [ 0 ] ) ;
110+ this . serverCompletedTask = new TaskCompletionSource < bool > ( ) ;
111111
112112#if DEBUG
113113 if ( waitForDebugger )
@@ -226,6 +226,7 @@ private async void OnLanguageServiceClientConnect(
226226 this . editorSession ,
227227 messageDispatcher ,
228228 protocolEndpoint ,
229+ this . serverCompletedTask ,
229230 this . logger ) ;
230231
231232 await this . editorSession . PowerShellContext . ImportCommandsModule (
@@ -348,7 +349,6 @@ public void StopServices()
348349 public void WaitForCompletion ( )
349350 {
350351 // TODO: We need a way to know when to complete this task!
351- this . serverCompletedTask = new TaskCompletionSource < bool > ( ) ;
352352 this . serverCompletedTask . Task . Wait ( ) ;
353353 }
354354
@@ -479,4 +479,4 @@ private IServerListener CreateServiceListener(MessageProtocolType protocol, Edit
479479
480480 #endregion
481481 }
482- }
482+ }
0 commit comments