diff --git a/src/Features/LanguageServer/Microsoft.CodeAnalysis.LanguageServer/LanguageServer/LanguageServerHost.cs b/src/Features/LanguageServer/Microsoft.CodeAnalysis.LanguageServer/LanguageServer/LanguageServerHost.cs index 03803c10aad83..b3681184fb566 100644 --- a/src/Features/LanguageServer/Microsoft.CodeAnalysis.LanguageServer/LanguageServer/LanguageServerHost.cs +++ b/src/Features/LanguageServer/Microsoft.CodeAnalysis.LanguageServer/LanguageServer/LanguageServerHost.cs @@ -48,7 +48,6 @@ public LanguageServerHost(Stream inputStream, Stream outputStream, ExportProvide public void Start() { - _logger.LogInformation("Starting server..."); _jsonRpc.StartListening(); // Now that the server is started, update the our instance reference diff --git a/src/Features/LanguageServer/Microsoft.CodeAnalysis.LanguageServer/Program.cs b/src/Features/LanguageServer/Microsoft.CodeAnalysis.LanguageServer/Program.cs index 3b6d2e1901f2f..d43a140492411 100644 --- a/src/Features/LanguageServer/Microsoft.CodeAnalysis.LanguageServer/Program.cs +++ b/src/Features/LanguageServer/Microsoft.CodeAnalysis.LanguageServer/Program.cs @@ -51,6 +51,8 @@ static async Task RunAsync(ServerConfiguration serverConfiguration, Cancellation )); }); + var logger = loggerFactory.CreateLogger(); + if (serverConfiguration.LaunchDebugger) { if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows)) @@ -60,7 +62,6 @@ static async Task RunAsync(ServerConfiguration serverConfiguration, Cancellation } else { - var logger = loggerFactory.CreateLogger(); var timeout = TimeSpan.FromMinutes(1); logger.LogCritical($"Server started with process ID {Environment.ProcessId}"); logger.LogCritical($"Waiting {timeout:g} for a debugger to attach"); @@ -103,6 +104,8 @@ static async Task RunAsync(ServerConfiguration serverConfiguration, Cancellation var server = new LanguageServerHost(Console.OpenStandardInput(), Console.OpenStandardOutput(), exportProvider, loggerFactory.CreateLogger(nameof(LanguageServerHost))); server.Start(); + logger.LogInformation("Language server initialized"); + try { await server.WaitForExitAsync();