Library information unavailable when dune executable name is a prefix of another
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.
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.
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))
Also, wouldn't dune build @check work ?