aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDanielGavin <danielgavin5@hotmail.com>2025-10-22 00:38:35 +0200
committerDanielGavin <danielgavin5@hotmail.com>2025-10-22 00:38:35 +0200
commit6a6045e1f98f7a822f240b63518402f8d4d6257b (patch)
treea0a01f1e730cff46d7390a36cf0105ff3e39a995
parent7d293c322ef85e4b60c943c220f1a6dd45895672 (diff)
Use get_case_sensitive_path for the uri in diagnostic. It matters for Zed that they are case correct.
-rw-r--r--src/server/check.odin16
-rw-r--r--src/server/documents.odin8
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)