aboutsummaryrefslogtreecommitdiff
path: root/Scripts/main.js
diff options
context:
space:
mode:
authorDavid Czihak <git@dcz.at>2026-05-07 18:43:37 +0200
committerDavid Czihak <git@dcz.at>2026-05-07 18:43:37 +0200
commit07f1f2952ca97bea50af28a5c169fd6b6de723ad (patch)
tree55eee13096a03b82bdf3fc7a8b57e9676a41364d /Scripts/main.js
parent384a44bd1189119326350996fcdff1cf4394a8cd (diff)
Chore: Improve ZLS error logging
Diffstat (limited to 'Scripts/main.js')
-rw-r--r--Scripts/main.js15
1 files changed, 15 insertions, 0 deletions
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}`);