From 6a6045e1f98f7a822f240b63518402f8d4d6257b Mon Sep 17 00:00:00 2001 From: DanielGavin Date: Wed, 22 Oct 2025 00:38:35 +0200 Subject: Use get_case_sensitive_path for the uri in diagnostic. It matters for Zed that they are case correct. --- src/server/check.odin | 16 ++++++++++++++-- src/server/documents.odin | 8 +++++++- 2 files changed, 21 insertions(+), 3 deletions(-) diff --git a/src/server/check.odin b/src/server/check.odin index b4bc674..e4185c7 100644 --- a/src/server/check.odin +++ b/src/server/check.odin @@ -72,7 +72,13 @@ check_unused_imports :: proc(document: ^Document, config: ^common.Config) { unused_imports := find_unused_imports(document, context.temp_allocator) - uri := common.create_uri(document.uri.path, context.temp_allocator) + path := document.uri.path + + when ODIN_OS == .Windows { + path = common.get_case_sensitive_path(path, context.temp_allocator) + } + + uri := common.create_uri(path, context.temp_allocator) remove_diagnostics(.Unused, uri.uri) @@ -174,7 +180,13 @@ check :: proc(paths: []string, uri: common.Uri, config: ^common.Config) { continue } - uri := common.create_uri(error.pos.file, context.temp_allocator) + path := error.pos.file + + when ODIN_OS == .Windows { + path = common.get_case_sensitive_path(path, context.temp_allocator) + } + + uri := common.create_uri(path, context.temp_allocator) add_diagnostics( .Check, diff --git a/src/server/documents.odin b/src/server/documents.odin index a042ee0..ed1fb52 100644 --- a/src/server/documents.odin +++ b/src/server/documents.odin @@ -318,7 +318,13 @@ document_refresh :: proc(document: ^Document, config: ^common.Config, writer: ^W return .None } - uri := common.create_uri(document.uri.path, context.temp_allocator) + path := document.uri.path + + when ODIN_OS == .Windows { + path = common.get_case_sensitive_path(path, context.temp_allocator) + } + + uri := common.create_uri(path, context.temp_allocator) remove_diagnostics(.Syntax, uri.uri) remove_diagnostics(.Check, uri.uri) -- cgit v1.2.3