-
Notifications
You must be signed in to change notification settings - Fork 125
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix nested dune workspace #545
Conversation
So is this bug also present in dot-merlin-reader? cc @voodoos |
It's appreciated but not required. |
It should not impact But limiting the recursion to the first encounter with a I will try to reproduce in the Merlin setting. |
Looking at the tests files I don't see any "outer" dune project ? There is a It looks like the "outer" project used in the test is ocaml-lsp itself. Is that correct ? Aren't the e2e tests running in a sandbox ? |
Hey @voodoos , thanks for taking a look . I added the The |
The e2e tests run outside of dune because they are written in typescript. |
3f05a86
to
73f1645
Compare
Ok I see it works in my example because I have a However when nesting
I am not able to build your example with dune... it says As far as I understand, there is no issue with OCaml-LSP here but I might be wrong. |
Thanks for taking a look again. I did manage to repro in this repo: https://github.com/actionshrimp/lsp-dune-test-repo (simulating a project that brings in a submodule as a dependency that has its own However in the process of playing around with that I noticed a much simpler way of resolving the issue, which is to just add a Apologies for the confusion and I'll close this! |
The first commit fixes a bug in the toEqualUri jest helper (happy to split this out into a separate PR if that makes sense).
Second commit fixes an issue with merlin config setup when a subfolder inside a project has its own dune-project or dune-workspace file.
The current implementation searches upwards until the first dune-project or dune-workspace file is found, but there may be such files further up the tree, for example if there's a dependency bought in as a submodule with its own
dune-project
file - currently this breaks ocaml-lsp in files in such a submodule.Now we search for the
innermost
dune
file to get the 'workdir' referenced in the function's comment, but theoutermost
dune-projector
dune-workspace` file. (The newly added test fails under the old implementation).For the tests to work, we have to temporarily rename the
dune-project
from theocaml-lsp
project itself in test setup/teardown so it doesn't interfere with the context (perhaps there's a better way to do this :)).