solvuu / solvuu-build

DEPRECATED. We recommend Jane Street's dune (formerly jbuilder).
ISC License
24 stars 5 forks source link

More complete merlin file #41

Open copy opened 7 years ago

copy commented 7 years ago

Currently the following are missing from .merlin files:

  1. A FLG -w directive according to the ~w argument
  2. safe_string, strict_sequence, short_paths if they are set
  3. As a bonus, it would be awesome if solvuu-build could generate location information according to this, i.e. CMT /home/user/.opam/build/$PKG/** or similar
agarwal commented 7 years ago

FLG directives for -w, -safe-string, and -short-paths are generated as of 52f5f575a25089487c050fd3299b0cf1ec0b0446.

-strict-sequence should be easy to add, but I didn't do it yet because it should be supported in the type of lib and app too, not just for merlin files.

I'll have to read more about item 3.

agarwal commented 7 years ago

b1e88b9f9e0d20f28e9eada4d8cac281de29c860 adds support for -strict-sequence.

agarwal commented 7 years ago

I'm uncertain which directory to give to the CMT directives. The link you provided implies that you have to tell opam to keep the build directory, but I find plenty of .cmt files installed in opam's lib dir. For example, all project's using solvuu-build install the .cmt files. 😄

We could follow this heuristic:

Does that sound correct?

copy commented 7 years ago

If the cmt files are within the lib folder, merlin locates them automatically (if the package is referenced using PKG), so adding a CMT directive to the lib folder is not necessary. However the lib folder often does not contain the .ml files, so pointing to the build folder is still useful for jump-to-definition to libraries. So I'd suggest adding the CMT directive to the build folder for all packages.