private async Task RunTempDebugSessionAsync(HostStartupInfo hostDetails) { _logger.Log(PsesLogLevel.Diagnostic, "Running temp debug session"); PsesDebugServer debugServer = await CreateDebugServerForTempSessionAsync(hostDetails).ConfigureAwait(false); _logger.Log(PsesLogLevel.Verbose, "Debug server created"); await debugServer.StartAsync().ConfigureAwait(false); _logger.Log(PsesLogLevel.Verbose, "Debug server started"); await debugServer.WaitForShutdown().ConfigureAwait(false); }
/// <summary> /// Waits for either the language or debug service to shut down. /// </summary> public void WaitForCompletion() { // If _languageServer is not null, then we are either using: // Stdio - that only uses a LanguageServer so we return when that has shutdown. // NamedPipes - that uses both LanguageServer and DebugServer, but LanguageServer // is the core of PowerShell Editor Services and if that shuts down, // we want the whole process to shutdown. if (_languageServer != null) { _languageServer.WaitForShutdown().GetAwaiter().GetResult(); return; } // If there is no LanguageServer, then we must be running with the DebugServiceOnly switch // (used in Temporary console debugging) and we need to wait for the DebugServer to shutdown. _debugServer.WaitForShutdown().GetAwaiter().GetResult(); }