Skip to content

Commit

Permalink
fix(dunerpc): normalize case under Windows (#1080)
Browse files Browse the repository at this point in the history
Signed-off-by: nojebar <[email protected]>
  • Loading branch information
rgrinberg authored May 3, 2023
1 parent 99494a6 commit 59a8718
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
3 changes: 3 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,10 @@

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

- Fix connecting to dune rpc. (#1080)

## Features

- Add "Remove type annotation" code action. (#1039)

# 1.15.1
Expand Down
3 changes: 2 additions & 1 deletion ocaml-lsp-server/src/dune.ml
Original file line number Diff line number Diff line change
Expand Up @@ -597,6 +597,7 @@ let uri_dune_overlap =
| "." :: xs -> xs
| xs -> xs
in
let normalize = if Sys.win32 then String.lowercase_ascii else fun x -> x in
fun (uri : Uri.t) (dune : Registry.Dune.t) ->
let dune_root = Registry.Dune.root dune in
let path =
Expand All @@ -606,7 +607,7 @@ let uri_dune_overlap =
in
let rec loop xs ys =
match (xs, ys) with
| x :: xs, y :: ys -> x = y && loop xs ys
| x :: xs, y :: ys -> normalize x = normalize y && loop xs ys
| [], _ | _, [] -> true
in
loop (explode_path dune_root) (explode_path path)
Expand Down

0 comments on commit 59a8718

Please sign in to comment.