Can't find import

Took an SML compilers class and I am trying to migrate my SML to OCaml. I have been struggling to get imports to work properly

File Structure:
lib
├── dune
└── middle_end
\ ├── absyn.ml
\ ├── symbol.ml
\ ├── temp.ml
\ ├── tree.ml
\ └── types.ml

Lib/dune

(include_subdirs unqualified)
(library
 (name my_compiler)
 )

Files can read symbol.ml but not temp.ml and I can’t tell the difference

“The module Temp is an alias for module My_compiler__Temp, which is missing” ocamllsp

Can you post the full error message with all context in the output?

Also, since it looks like your error is coming from ocamllsp, it would be helpful to run the build directly and get the full error that way, e.g. dune build.

dune build doesn’t error, however I would still like for the lsp to be functional before I continue adding files

If dune build is succeeding, try restarting your editor. The LSP might have just gotten stuck.

1 Like

I do find with neovim+lsp sometimes I need to reload a file to clear an error. Particularly in cases where I may have restructured the code and maybe created a couple of new modules.