ocaml / merlin

Context sensitive completion for OCaml in Vim and Emacs
https://ocaml.github.io/merlin/
MIT License
1.58k stars 233 forks source link

Add toolchain support #681

Closed saschatimme closed 4 years ago

saschatimme commented 7 years ago

I currently work with opam-cross-ios to compile my ocaml program for iOS. If you are using cross compiled packages they are installed on a different path than usual. So for iOS you can find them under ~/.opam/<switch>/ios-sysroot/lib instead of ~/.opam/<switch>/lib.

In order to make our life easier ocamlfind added -toolchain flag, so that with e.g. ocamlfind -toolchain ios list you would get a list of all for ios patched packages. Currently merlin doesn't provide a way to tell it about toolchain and thus if I add PKG myPackage to my .merlin file it doesn't find the package.

Obviously I could manually add correct paths, but it would be cool if Merlin would have proper support for it :)

saschatimme commented 7 years ago

It just came in my mind, that to circumvent this problem, one could also simply have every package in a normal version installed.

let-def commented 7 years ago

I will add a .merlin directive to select a toolchain. In the meantime some workarounds:

let-def commented 7 years ago

FINDLIB_TOOLCHAIN is now supported by merlin. Can you try if it fixes your problem? Just put: FINDLIB_TOOLCHAIN ios in .merlin.

rgrinberg commented 4 years ago

2 years later, I think we can assume this fixed the OP's problem.