I'm new to Ocaml and just setting up my emacs, merlin and flycheck developers' environment. Everything works more or less as expected, except for one: merlin does not seem to be able to recognize dependencies between modules in the same project.
eg. I have a test project with two modules: main.ml and awesome.ml.
here is my main.ml that references the second awesome.ml module
(* main.ml *) open Core module A = Awesome let _ = Printf.printf "hello \n Converted to string we get: %s\n" (A.str_of_t (A.succ A.one_t));
here awesome.ml:
(* awesome.ml *) type t = int let one_t = 1 let succ i = i + 1 let str_of_t = string_of_int
when I send the main.ml buffer for calculation to utop using the utop-eval-buffer function, I get the error message: "Error: Unbound module Awesome"
I have .merlin at the root of a project that has an S instruction. I know that he was found by Merlin, since he does not complain about the "open core"
S src PKG core lwt ounit B _build/src B +threads
here is my _tags:
<src/**>: include <src/**>: package(oUnit), package(core) true:thread
regular compilation of the project with ocamlbuild works fine, no errors. here is the makefile
## Makefile default: main main: main.native test: test.native %.native: ocamlbuild -use-ocamlfind $@ mv $@ $* .PHONY: test default
any ideas why the awesome module is not recognized in utop or is this the expected behavior?
source share