1

The issue is simple: I can't find anywhere in the OCamlBuild or Oasis manual how to tell the tool to automatically generate annotation files (.cmt) at compilation time.

Annotation files are useful because Merlin eats them up when it comes time to tell you what the type of an expression is when you are using Emacs.

Adam Miller
  • 1,756
  • 1
  • 25
  • 44

2 Answers2

1

Add the following to your _tags file:

true: annot, bin_annot

But, as far as I remember oasis produces annotations by default since 0.4.4 or even earlier. So, I think, that you have problems in your merlin setup. Make sure, that in your .merlin file you have the following lines:

B _build

If you have deep hierarchy in your source tree, then you need to tell merlin about this. For example, if you have two folders: lib and src on the same level as your _oasis file, then you need also to add the following:

S lib
B _build/lib
ivg
  • 34,431
  • 2
  • 35
  • 63
0

Here's how you tell oasis to tell ocamlbuild to do just that:

ocaml setup.ml -build -cflag -bin-annot -cflag -annot
Adam Miller
  • 1,756
  • 1
  • 25
  • 44