diff options
| author | DanielGavin <danielgavin5@hotmail.com> | 2024-05-05 00:11:04 +0200 |
|---|---|---|
| committer | DanielGavin <danielgavin5@hotmail.com> | 2024-05-05 00:11:04 +0200 |
| commit | 82db36fdbf44236dd0e2bad69ca8402c4c8942fb (patch) | |
| tree | ae45d76fd0990ed718cd7f0828c56ba69348a64c /src | |
| parent | 11741a8e42aa237b01593bc15d7fafc6cb4c2a52 (diff) | |
Log the json that fails
Diffstat (limited to 'src')
| -rw-r--r-- | src/server/check.odin | 19 |
1 files changed, 14 insertions, 5 deletions
diff --git a/src/server/check.odin b/src/server/check.odin index bd04bb1..b18de55 100644 --- a/src/server/check.odin +++ b/src/server/check.odin @@ -78,7 +78,12 @@ fallback_find_odin_directories :: proc(config: ^common.Config) -> []string { return data[:] } -check :: proc(paths: []string, uri: common.Uri, writer: ^Writer, config: ^common.Config) { +check :: proc( + paths: []string, + uri: common.Uri, + writer: ^Writer, + config: ^common.Config, +) { paths := paths if len(paths) == 0 { @@ -157,7 +162,11 @@ check :: proc(paths: []string, uri: common.Uri, writer: ^Writer, config: ^common json.DEFAULT_SPECIFICATION, context.temp_allocator, ); res != nil { - log.errorf("Failed to unmarshal check results: %v", res) + log.errorf( + "Failed to unmarshal check results: %v, %v", + res, + string(buffer), + ) } for error in json_errors.errors { @@ -186,12 +195,12 @@ check :: proc(paths: []string, uri: common.Uri, writer: ^Writer, config: ^common Diagnostic { code = "checker", severity = .Error if error.type == "error" else .Warning, - range = { - start = { + range = { + start = { character = error.pos.column - 1, line = error.pos.line - 1, }, - end = { + end = { character = error.pos.end_column - 1, line = error.pos.line - 1, }, |