From d2f19e54bfbb04fcfc6fe3a2170df79d29c42e74 Mon Sep 17 00:00:00 2001 From: Stone Tickle Date: Sat, 7 Dec 2024 12:40:10 -0800 Subject: [PATCH] use stdout for newer muon --- src/tools/muon.ts | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/tools/muon.ts b/src/tools/muon.ts index b4cac21..59363e7 100644 --- a/src/tools/muon.ts +++ b/src/tools/muon.ts @@ -3,15 +3,22 @@ import { ExecResult, exec, execFeed, extensionConfiguration, getOutputChannel } import { Tool } from "../types"; export async function lint(muon: Tool, root: string, document: vscode.TextDocument): Promise { - const { stderr } = await execFeed( + const { stdout, stderr } = await execFeed( muon.path, ["analyze", "-l", "-O", document.uri.fsPath], { cwd: root }, document.getText(), ); + var out; + if (muon.version[0] == 0 && muon.version[1] <= 3) { + out = stderr; + } else { + out = stdout; + } + let diagnostics: vscode.Diagnostic[] = []; - stderr.split("\n").forEach((line) => { + out.split("\n").forEach((line) => { const parts = line.split(":"); if (parts.length < 4) { return;