From f252aad41d51df05abab2a00490d8e7f16bc488d Mon Sep 17 00:00:00 2001 From: DanielGavin Date: Fri, 3 Oct 2025 22:41:14 +0200 Subject: Added diagnostic system to collect all the diagnostics. Unused imports are shown on save and open. --- src/server/requests.odin | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) (limited to 'src/server/requests.odin') diff --git a/src/server/requests.odin b/src/server/requests.odin index e153503..49119aa 100644 --- a/src/server/requests.odin +++ b/src/server/requests.odin @@ -1041,6 +1041,12 @@ notification_did_open :: proc( return .InternalError } + document := document_get(open_params.textDocument.uri) + + check_unused_imports(document, config) + + push_diagnostics(writer) + return .None } @@ -1135,7 +1141,13 @@ notification_did_save :: proc( corrected_uri := common.create_uri(fullpath, context.temp_allocator) - check(config.profile.checker_path[:], corrected_uri, writer, config) + check(config.profile.checker_path[:], corrected_uri, config) + + document := document_get(save_params.textDocument.uri) + + check_unused_imports(document, config) + + push_diagnostics(writer) return .None } -- cgit v1.2.3