Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix misleading lsp server logs #69378

Merged
merged 1 commit into from
Aug 4, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,8 @@ static async Task RunAsync(ServerConfiguration serverConfiguration, Cancellation
));
});

var logger = loggerFactory.CreateLogger<Program>();

if (serverConfiguration.LaunchDebugger)
{
if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows))
Expand All @@ -60,7 +62,6 @@ static async Task RunAsync(ServerConfiguration serverConfiguration, Cancellation
}
else
{
var logger = loggerFactory.CreateLogger<Program>();
var timeout = TimeSpan.FromMinutes(1);
logger.LogCritical($"Server started with process ID {Environment.ProcessId}");
logger.LogCritical($"Waiting {timeout:g} for a debugger to attach");
Expand Down Expand Up @@ -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();
Expand Down