diff options
| author | Daniel Gavin <danielgavin5@hotmail.com> | 2021-12-26 16:30:59 +0100 |
|---|---|---|
| committer | Daniel Gavin <danielgavin5@hotmail.com> | 2021-12-26 16:30:59 +0100 |
| commit | cc0415c049f9bff9a13acc67256552a782f3fd7a (patch) | |
| tree | 2998e78e59f83ebd66ac38070e90cc6ffc4f1fa4 /src | |
| parent | 7fa5943ee9335407f5294187630e51efbffc7e89 (diff) | |
Fix clearing errors on all the files in checker
Diffstat (limited to 'src')
| -rw-r--r-- | src/server/check.odin | 30 |
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) { |