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

Overly Broad Red Underline on Module Signature Mismatch #1187

Open
zevbo opened this issue Jul 22, 2023 · 1 comment
Open

Overly Broad Red Underline on Module Signature Mismatch #1187

zevbo opened this issue Jul 22, 2023 · 1 comment

Comments

@zevbo
Copy link

zevbo commented Jul 22, 2023

Currently, the linter underlines the entire module implementation when there is any mismatch in signature. This is problematic because (a) it makes it visually very hard to read what's going and (b) it overrides any other linting errors in the module. Take the following example:

0: module A : sig 
1:  type t 
2: end = struct
3:  type t = { field: InvalidSyntax }
4: end

Normally, one would expect InvalidSyntax to be underined on line 3. But here, the invalid syntax causes OCaml Platform not to know of any defined type t, therefore causing a module signature mismatch. As a result, everything from struct on line 2 to end on line 4 is underlined in red, and you can't see the specific underline under InvalidSyntax.

Thus, it would be helpful if the underline for module signature mismatch was much smaller--perhaps only on the struct keyword.

@rgrinberg
Copy link
Contributor

cc @voodoos I imagine this would require some deeper changes in the error reporting of merlin and the compiler

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants