Skip to content

Commit 598bf16

Browse files
address Patrick's feedback
1 parent c369003 commit 598bf16

File tree

4 files changed

+10
-11
lines changed

4 files changed

+10
-11
lines changed

module/PowerShellEditorServices/PowerShellEditorServices.psm1

+2-2
Original file line numberDiff line numberDiff line change
@@ -150,12 +150,12 @@ function Start-EditorServicesHost {
150150
}
151151

152152
if ($DebugServiceOnly.IsPresent) {
153-
$editorServicesHost.StartDebugService($debugServiceConfig, $profilePaths, $false);
153+
$editorServicesHost.StartDebugService($debugServiceConfig, $profilePaths, $true);
154154
} elseif($Stdio.IsPresent) {
155155
$editorServicesHost.StartLanguageService($languageServiceConfig, $profilePaths);
156156
} else {
157157
$editorServicesHost.StartLanguageService($languageServiceConfig, $profilePaths);
158-
$editorServicesHost.StartDebugService($debugServiceConfig, $profilePaths, $true);
158+
$editorServicesHost.StartDebugService($debugServiceConfig, $profilePaths, $false);
159159
}
160160

161161
return $editorServicesHost

src/PowerShellEditorServices/Hosting/EditorServicesHost.cs

+2-2
Original file line numberDiff line numberDiff line change
@@ -396,13 +396,13 @@ public void WaitForCompletion()
396396
// we want the whole process to shutdown.
397397
if (_languageServer != null)
398398
{
399-
_languageServer.WaitForShutdown().Wait();
399+
_languageServer.WaitForShutdown().GetAwaiter().GetResult();
400400
return;
401401
}
402402

403403
// If there is no LanguageServer, then we must be running with the DebugServiceOnly switch
404404
// (used in Temporary console debugging) and we need to wait for the DebugServer to shutdown.
405-
_debugServer.WaitForShutdown().Wait();
405+
_debugServer.WaitForShutdown().GetAwaiter().GetResult();
406406
}
407407

408408
#endregion

src/PowerShellEditorServices/Server/PsesDebugServer.cs

+4-4
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ public class PsesDebugServer : IDisposable
2626

2727
private PowerShellContextService _powerShellContextService;
2828

29-
private readonly TaskCompletionSource<bool> _serverRunning;
29+
private readonly TaskCompletionSource<bool> _serverStopped;
3030

3131
public PsesDebugServer(
3232
ILoggerFactory factory,
@@ -36,7 +36,7 @@ public PsesDebugServer(
3636
_loggerFactory = factory;
3737
_inputStream = inputStream;
3838
_outputStream = outputStream;
39-
_serverRunning = new TaskCompletionSource<bool>();
39+
_serverStopped = new TaskCompletionSource<bool>();
4040
}
4141

4242
public async Task StartAsync(IServiceProvider languageServerServiceProvider, bool useTempSession)
@@ -97,12 +97,12 @@ public void Dispose()
9797
{
9898
_powerShellContextService.IsDebugServerActive = false;
9999
_jsonRpcServer.Dispose();
100-
_serverRunning.SetResult(true);
100+
_serverStopped.SetResult(true);
101101
}
102102

103103
public async Task WaitForShutdown()
104104
{
105-
await _serverRunning.Task;
105+
await _serverStopped.Task;
106106
}
107107

108108
#region Events

src/PowerShellEditorServices/Server/PsesServiceCollectionExtensions.cs

+2-3
Original file line numberDiff line numberDiff line change
@@ -63,12 +63,11 @@ public static IServiceCollection AddPsesLanguageServices (
6363
});
6464
}
6565

66-
public static IServiceCollection AddPsesDebugServices (
66+
public static IServiceCollection AddPsesDebugServices(
6767
this IServiceCollection collection,
6868
IServiceProvider languageServiceProvider,
6969
PsesDebugServer psesDebugServer,
70-
bool useTempSession
71-
)
70+
bool useTempSession)
7271
{
7372
return collection.AddSingleton(languageServiceProvider.GetService<PowerShellContextService>())
7473
.AddSingleton(languageServiceProvider.GetService<WorkspaceService>())

0 commit comments

Comments
 (0)