Skip to content

Commit 59a8718

Browse files
authored
fix(dunerpc): normalize case under Windows (#1080)
Signed-off-by: nojebar <[email protected]>
1 parent 99494a6 commit 59a8718

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

CHANGES.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,10 @@
2525

2626
- Accept `--port` as a synonym for `--socket`. (#1075)
2727

28+
- Fix connecting to dune rpc. (#1080)
29+
2830
## Features
31+
2932
- Add "Remove type annotation" code action. (#1039)
3033

3134
# 1.15.1

ocaml-lsp-server/src/dune.ml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -597,6 +597,7 @@ let uri_dune_overlap =
597597
| "." :: xs -> xs
598598
| xs -> xs
599599
in
600+
let normalize = if Sys.win32 then String.lowercase_ascii else fun x -> x in
600601
fun (uri : Uri.t) (dune : Registry.Dune.t) ->
601602
let dune_root = Registry.Dune.root dune in
602603
let path =
@@ -606,7 +607,7 @@ let uri_dune_overlap =
606607
in
607608
let rec loop xs ys =
608609
match (xs, ys) with
609-
| x :: xs, y :: ys -> x = y && loop xs ys
610+
| x :: xs, y :: ys -> normalize x = normalize y && loop xs ys
610611
| [], _ | _, [] -> true
611612
in
612613
loop (explode_path dune_root) (explode_path path)

0 commit comments

Comments
 (0)