solvuu-build
solvuu-build copied to clipboard
More complete merlin file
Currently the following are missing from .merlin files:
- A
FLG -w
directive according to the~w
argument -
safe_string
,strict_sequence
,short_paths
if they are set - 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
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.
b1e88b9f9e0d20f28e9eada4d8cac281de29c860 adds support for -strict-sequence
.
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:
- check if there are
.cmt
files in the lib dir and if so use that dir - else check if there is a build dir and if it has
.cmt
files, if so use that dir - else omit the CMT directive for this package
Does that sound correct?
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.