Skip to content

[merlin] Handle relative paths and perform case insensitive path comparison on Windows#4221

Merged
voodoos merged 4 commits intoocaml:mainfrom
voodoos:ocaml-merlin-relative-paths
Feb 15, 2021
Merged

[merlin] Handle relative paths and perform case insensitive path comparison on Windows#4221
voodoos merged 4 commits intoocaml:mainfrom
voodoos:ocaml-merlin-relative-paths

Conversation

@voodoos
Copy link
Copy Markdown
Collaborator

@voodoos voodoos commented Feb 12, 2021

This a part of #4217

This PR improve the flexibility of the dune ocaml-merlin command.

  1. Relative paths are now accepted. These paths should be relative to the initial_cwd of the dune ocaml-merlin command. This should solves issues where symlinks were confusing the communication between Dune and Merlin.
  2. On Windows, when determining the relative path to the root of the workspace from an absolute path, both are now lowercased before the comparison. Path separators are untouched but Merlin should always send paths using backslashes \ on Windows (on master).

The first change need Merlin to switch to sending relative paths instead of absolute ones. However to maintain the best compatibility possible future releases of Merlin will always retry using an absolute path if no configuration was found with a relative path.

CC @nojb @emillon

@voodoos voodoos added this to the 2.9 milestone Feb 12, 2021
@voodoos voodoos requested a review from rgrinberg February 12, 2021 16:02
Signed-off-by: Ulysse Gérard <thevoodoos@gmail.com>
Signed-off-by: Ulysse Gérard <thevoodoos@gmail.com>
Signed-off-by: Ulysse Gérard <thevoodoos@gmail.com>
Signed-off-by: Ulysse Gérard <thevoodoos@gmail.com>
@voodoos voodoos force-pushed the ocaml-merlin-relative-paths branch from f9cee32 to bdf2eda Compare February 15, 2021 14:18
@voodoos voodoos merged commit 86522e9 into ocaml:main Feb 15, 2021
@voodoos voodoos modified the milestones: 2.9, 2.8.3 Feb 16, 2021
voodoos added a commit to voodoos/dune that referenced this pull request Feb 22, 2021
…ns on windows (ocaml#4221)

* Handle both absolute and relative links
* Make path comparison case insensitive on Windows
* Update test suite

Signed-off-by: Ulysse Gérard <thevoodoos@gmail.com>
rgrinberg pushed a commit that referenced this pull request Mar 7, 2021
…ns on windows (#4221)

* Handle both absolute and relative links
* Make path comparison case insensitive on Windows
* Update test suite

Signed-off-by: Ulysse Gérard <thevoodoos@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants