Open liam923 opened 1 month ago
Thanks for the very thorough report ! I will have a look.
Foo.1 is correct in the sense that Bar is Foo.1 according to foo.mli, but Foo.1 in foo.ml is the constructor Foo, which is what Merlin incorrectly returns.
This is a case of "the uid doesn't indicate if it comes from the implementation or the interface" and we should be able to provide a robust fix soon thanks to https://github.com/ocaml/ocaml/pull/13286
Given how locate works right now, I would expect the correct result of locating Bar
in the failing test to be 1:9 in foo.mli
since only the module type of Foo
was included and not the module implementation itself.
We might, however, be more clever at some point by looking at the new information linking declaration together in 5.3 https://github.com/ocaml/ocaml/pull/13308
Here is a cram test of the issue:
Locating the
Bar
originating from aninclude module type of Foo
goes to the wrong location. Looking at the logs for the failing case, we see:Foo.1
is correct in the sense thatBar
isFoo.1
according tofoo.mli
, butFoo.1
infoo.ml
is the constructorFoo
, which is what Merlin incorrectly returns.Compare this to the logs in the successful cases: