Skip to content

Commit

Permalink
fix(dunerpc): normalize case under Windows
Browse files Browse the repository at this point in the history
Signed-off-by: nojebar <[email protected]>

<!-- ps-id: 40c3ff21-3bb9-489c-8936-53fb4f0bb9f0 -->
  • Loading branch information
nojb authored and rgrinberg committed May 3, 2023
1 parent 99494a6 commit ec06c1f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 2 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@

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

- Fix connecting to dune rpc. (#1079)

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

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 ec06c1f

Please sign in to comment.