From 07f1f2952ca97bea50af28a5c169fd6b6de723ad Mon Sep 17 00:00:00 2001 From: David Czihak Date: Thu, 7 May 2026 18:43:37 +0200 Subject: Chore: Improve ZLS error logging --- Scripts/main.js | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/Scripts/main.js b/Scripts/main.js index d9aac14..6f0a54e 100644 --- a/Scripts/main.js +++ b/Scripts/main.js @@ -476,6 +476,21 @@ class ZigLanguageServer { clientOptions ); + client.onNotification("window/logMessage", ({ type, message }) => { + // type: 1=Error, 2=Warning, 3=Info, 4=Log + const enriched = + message === "ParseError" + ? "ParseError — ZLS could not fully parse the Zig source (normal while editing)" + : message; + if (type === 1) { + console.error(`[ZLS] ${enriched}`); + } else if (type === 2) { + console.warn(`[ZLS] ${enriched}`); + } else if (debugLogs) { + console.log(`[ZLS] ${enriched}`); + } + }); + this.clientStopDisposable = client.onDidStop((error) => { if (error) { console.error(`[${LANGUAGE_CLIENT_ID}] ${error.message}`); -- cgit v1.3