I am new to Ocaml and just setting up my dev environment with emacs, merlin and flycheck. Everything works more or less expected except one thing : merlin doesn't seem to be able recognise the dependencies between the modules in the same project.
e.g. I have a test project with two modules: main.ml and awesome.ml.
here is my main.ml which references the second module awesome.ml
(* 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 is 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 main.ml buffer to evaluate into utop with utop-eval-buffer function, I am getting an error: "Error: Unbound module Awesome"
I have .merlin in the root of the project which has S instruction. I know it is found by merlin as it doesn't complain about "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
the regular project compilation with ocamlbuild works fine, no errors. here is Makefile
## Makefile
default: main
main: main.native
test: test.native
%.native:
ocamlbuild -use-ocamlfind $@
mv $@ $*
.PHONY: test default
any ideas why Awesome module is not recognised in utop or this is expected behaviour?