Skip to content

Commit

Permalink
Fix bug with Info getting extra logs on the vscode LSP client side
Browse files Browse the repository at this point in the history
  • Loading branch information
JustinGrote authored and andyleejordan committed Nov 15, 2024
1 parent 3585f00 commit 9ce8911
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/PowerShellEditorServices/Logging/LanguageServerLogger.cs
Original file line number Diff line number Diff line change
Expand Up @@ -68,14 +68,20 @@ public void Log<TState>(
{
messagePrepend = logLevel switch
{
LogLevel.Critical => "<Error> CRITICAL: ",
LogLevel.Critical => "<Error>CRITICAL: ",
LogLevel.Error => "<Error>",
LogLevel.Warning => "<Warning>",
LogLevel.Information => "<Info>",
LogLevel.Debug => "<Debug>",
LogLevel.Trace => "<Trace>",
_ => string.Empty
};

// The vscode formatter prepends some extra stuff to Info specifically, so we drop Info to Log, but it will get logged correctly on the other side thanks to our inline indicator that our custom parser on the other side will pick up and process.
if (messageType == MessageType.Info)
{
messageType = MessageType.Log;
}
}

LogMessageParams logMessage = new()
Expand Down

0 comments on commit 9ce8911

Please sign in to comment.