MerlinTypeOf only displaying types as `'a`, `'b` etc

merlin

#1

I’m trying to transition toward Merlin to get type info from my editor (I was happily using ocaml-annot so far, but as non-binary annotations are going to disappear…)

The experience so far is disappointing: most of the time, MerlinTypeOf (which is the only function I really need) only shows type as 'a or 'a -> 'b, etc. unless I point it at an obvious constant in which case it will successfully print int or whatever.
On the same source files with the same annotation (just non-binnary), ocaml-annot is able to properly display the correct type.

I don’t know what’s in a .cmt file but a strings on it suggests that the types are actually present in there as in the .annot file.
Any idea how I could improve things?
I’d like not to maintain a .merlin file if that’s possible.


#2

If you use dune as your build system, it automatically generates .merlin files for you.


#3

Dune won’t build your .merlin file unless you build something. You can either try building some portion of your project, or (I believe) you can call dune build @check in order to get the necessary files for tooling, such as .merlin.


#4

Should I understand that this behavior (not being able to display most types) is caused by the lack of a merlin file? That sounds strange as the whole content required to answer MerlinTypeOf seems to be in the cmt file.