Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

No config found for file .ocamlinit. Try calling 'dune build'. #1790

Open
dalps opened this issue Jun 18, 2024 · 3 comments
Open

No config found for file .ocamlinit. Try calling 'dune build'. #1790

dalps opened this issue Jun 18, 2024 · 3 comments

Comments

@dalps
Copy link

dalps commented Jun 18, 2024

Hi, the dune guys suggested I report this issue (feature request?) to merlin or OCamlLSP issue tracker, but I believe here is more appropriate.

I have a small gripe with merlin, being that it is unable to properly type check or provide code completion for external modules loaded in an .ocamlinit file. Any module I open there results in an Unbound module error.

The root of the problem seems to be this error that lurks in the first line of an .ocamlinit within a dune project (image is taken in VS Code, but I see it in vim too):

image

I understand that it happens because an .ocamlinit file is just read and interpreted by the toplevel, it is not compiled by the build system; still it would be nice if merlin could make an effort to fully type check this kind of file, I myself use it quite often for debugging purposes and I think such feature would greatly improve the UX of the toplevel in dune projects.

@voodoos voodoos transferred this issue from ocaml/merlin Jun 19, 2024
@voodoos
Copy link
Collaborator

voodoos commented Jun 19, 2024

Transferring here since I think the fix should be done in the lsp server: if the file kind is .ocamlinit we should not try to load a configuration for it.

However the error does not prevent Merlin from "working" in the buffer:
image

@dalps
Copy link
Author

dalps commented Jun 21, 2024

Hi @voodoos, are you sure this is not merlin's responsibility? As I said, I see this error in vim too, which (correct me if I'm wrong) doesn't use the LSP server. My .vimrc is configured by opam user-setup and there's no mention of the lsp.

@voodoos
Copy link
Collaborator

voodoos commented Jun 24, 2024

Ah, I think you're right, sorry for the back and forth :-)

@voodoos voodoos transferred this issue from ocaml/ocaml-lsp Jun 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants