merlin icon indicating copy to clipboard operation
merlin copied to clipboard

Library information unavailable when dune executable name is a prefix of another

Open yannl35133 opened this issue 1 year ago • 3 comments

I found this out through the LSP, but I think I reproduced it in merlin.

Test files (I imagine containers can be replaced by any other library (not unix)) : |- dune

(executable (name foo))
(executable (name foobar) (libraries containers))

|- dune-project (minimal, eg. (lang dune 3.16)) |- foo.ml (empty) |- foobar.ml : open Containers

Then dune build --profile release (for the unused open) works fine, but goto Containers or print-type Containers don't work.

yannl35133 avatar Nov 26 '24 16:11 yannl35133

Thanks for your report, I was able to reproduce. There's definitively an issue with configuration here. This is usually the responsibility of Dune, but we can keep the issue here.

voodoos avatar Nov 27 '24 15:11 voodoos

I'm finding that completion for files in a directory only match the libraries of a single executable block when there are multiple executables in a dune file. The executable block that is used appears to be the one with the alphabetically first name field.

As a workaround I can add an empty "a.ml" file with the same libraries in the file I'm working on.

(executable
 (name a)
 (libraries base zarith))

;; ...

(executable
 (name problem_003)
 (libraries base zarith))

herbertjones avatar Sep 18 '25 08:09 herbertjones

Also, wouldn't dune build @check work ?

voodoos avatar Sep 18 '25 09:09 voodoos