aboutsummaryrefslogtreecommitdiff
path: root/Scripts/main.js
diff options
context:
space:
mode:
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}`);