vscode-ocaml-platform icon indicating copy to clipboard operation
vscode-ocaml-platform copied to clipboard

Mismatches between ml and mli are not presented clearly

Open yminsky opened this issue 3 years ago • 2 comments

I've noticed that the plugin does not do a good job of reporting mismatches between the ml and mli. In the project in question, running dune produces an actionable error message:

Entering directory '/home/yminsky/Code/game-programming-bxsci-2021/multi-uttt'
File "lib/miniboard.ml", line 1:
Error: The implementation lib/miniboard.pp.ml
       does not match the interface lib/.multi_uttt.objs/byte/multi_uttt__Miniboard.cmi:
        The value `get_space' is required but not provided
       File "lib/miniboard.mli", line 13, characters 0-50:
         Expected declaration
       The value `set_space' is required but not provided
       File "lib/miniboard.mli", line 16, characters 0-51:
         Expected declaration

But in vscode, the error shows up by underlining the open declaration at the top of the file, and the text of the error is:

The implementation lib/miniboard.pp.ml

which is not especially helpful.

yminsky avatar Jan 23 '22 19:01 yminsky

Hi, thanks for the report!

I'd like to reproduce the problem, but I don't get any errors when the ml and corresponding mli file mismatch (merlin doesn't detect such mismatches in general, to my understanding). Do you have your project available online somewhere?

re: unclear error message The error message is indeed unclear. I'll see if we can improve that.

re: actionable error There's an ongoing work for dune RPC integration in ocaml-lsp & this extension, so we should in future be able to suggest the user some actions to fix these errors.

ulugbekna avatar Jan 24 '22 18:01 ulugbekna

Oddly, I've had trouble reproducing it on a small example. I'm not sure why.

yminsky avatar Jan 29 '22 14:01 yminsky