aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorDaniel Gavin <danielgavin5@hotmail.com>2021-12-26 16:30:59 +0100
committerDaniel Gavin <danielgavin5@hotmail.com>2021-12-26 16:30:59 +0100
commitcc0415c049f9bff9a13acc67256552a782f3fd7a (patch)
tree2998e78e59f83ebd66ac38070e90cc6ffc4f1fa4 /src
parent7fa5943ee9335407f5294187630e51efbffc7e89 (diff)
Fix clearing errors on all the files in checker
Diffstat (limited to 'src')
-rw-r--r--src/server/check.odin30
1 files changed, 28 insertions, 2 deletions
diff --git a/src/server/check.odin b/src/server/check.odin
index 9d67455..5ff91d8 100644
--- a/src/server/check.odin
+++ b/src/server/check.odin
@@ -168,12 +168,36 @@ when ODIN_OS == "windows" {
},
message = error.message,
});
-
+ }
+
+ matches, err := filepath.glob(fmt.tprintf("%v/*.odin", path.dir(uri.path, context.temp_allocator)));
+
+ if err == .None {
+ for match in matches {
+ uri := common.create_uri(match, context.temp_allocator);
+
+ params := NotificationPublishDiagnosticsParams {
+ uri = uri.uri,
+ diagnostics = {},
+ };
+
+ notifaction := Notification {
+ jsonrpc = "2.0",
+ method = "textDocument/publishDiagnostics",
+ params = params,
+ };
+
+ if writer != nil {
+ send_notification(notifaction, writer);
+ }
+ }
}
for k, v in errors {
+ uri := common.create_uri(k, context.temp_allocator);
+
params := NotificationPublishDiagnosticsParams {
- uri = k,
+ uri = uri.uri,
diagnostics = v[:],
};
@@ -187,6 +211,8 @@ when ODIN_OS == "windows" {
send_notification(notifaction, writer);
}
}
+
+
}
} else {
check :: proc(uri: common.Uri, writer: ^Writer) {