Skip to content

Commit 9ce8911

Browse files
JustinGroteandyleejordan
authored andcommitted
Fix bug with Info getting extra logs on the vscode LSP client side
1 parent 3585f00 commit 9ce8911

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

src/PowerShellEditorServices/Logging/LanguageServerLogger.cs

+7-1
Original file line numberDiff line numberDiff line change
@@ -68,14 +68,20 @@ public void Log<TState>(
6868
{
6969
messagePrepend = logLevel switch
7070
{
71-
LogLevel.Critical => "<Error> CRITICAL: ",
71+
LogLevel.Critical => "<Error>CRITICAL: ",
7272
LogLevel.Error => "<Error>",
7373
LogLevel.Warning => "<Warning>",
7474
LogLevel.Information => "<Info>",
7575
LogLevel.Debug => "<Debug>",
7676
LogLevel.Trace => "<Trace>",
7777
_ => string.Empty
7878
};
79+
80+
// 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.
81+
if (messageType == MessageType.Info)
82+
{
83+
messageType = MessageType.Log;
84+
}
7985
}
8086

8187
LogMessageParams logMessage = new()

0 commit comments

Comments
 (0)