Skip to content

Commit

Permalink
Wire up loglevels in-band due to LSP bug
Browse files Browse the repository at this point in the history
  • Loading branch information
JustinGrote committed Nov 15, 2024
1 parent fd579ea commit fd5ee38
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/logging.ts
Original file line number Diff line number Diff line change
Expand Up @@ -153,8 +153,10 @@ export class LanguageClientOutputChannelAdapter implements LogOutputChannel {
this.sendLogMessage(parsedMessage, level);
}

// We include the log level inline from PSES for VSCode because our LanguageClient doesn't support middleware for logMessages yet.
// BUG:
protected parse(message: string): [string, LogLevel] {
const logLevelMatch = /^\[(?<level>Trace|Debug|Info|Warn|Error) +- \d+:\d+:\d+ [AP]M\] (?<message>.+)/.exec(message);
const logLevelMatch = /^<(?<level>Trace|Debug|Info|Warning|Error)>(?<message>.+)/.exec(message);
if (logLevelMatch) {
const { level, message } = logLevelMatch.groups!;
let logLevel: LogLevel;
Expand All @@ -168,7 +170,7 @@ export class LanguageClientOutputChannelAdapter implements LogOutputChannel {
case "Info":
logLevel = LogLevel.Info;
break;
case "Warn":
case "Warning":
logLevel = LogLevel.Warning;
break;
case "Error":
Expand Down

0 comments on commit fd5ee38

Please sign in to comment.