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

Compiler output listener needs a change for ocaml >= 4.09 #174

Closed
Khady opened this issue Jun 28, 2019 · 2 comments
Closed

Compiler output listener needs a change for ocaml >= 4.09 #174

Khady opened this issue Jun 28, 2019 · 2 comments

Comments

@Khady
Copy link

Khady commented Jun 28, 2019

I sent a change to the OCaml compiler to change the format of the error messages ocaml/ocaml#8541. It means that messages printed by OCaml >= 4.09 won't be parsed properly by this LSP server.

The change affects the messages that are on multiple lines. The message now contains the first and last lines. Also the second part of the characters section is no longer a byte offset, it is the position on the last line.

Here is an exemple.

File "robustmatch.ml", lines 33-37, characters 6-23:
 9 | ......match t1, t2, x with
10 |       | AB, AB, A -> ()
11 |       | MAB, _, A -> ()
12 |       | _,  AB, B -> ()
13 |       | _, MAB, B -> ()
Warning 8: this pattern-matching is not exhaustive.
Here is an example of a case that is not matched:
(AB, MAB, A)

I found two places where a change might be necessary:

https://github.com/reasonml-editor/reasonml-idea-plugin/blob/8a2820d8dedc45f3a93a11a563f8d71fcae2b22d/src/com/reason/build/bs/compiler/BsOutputListener.java#L26
https://github.com/reasonml-editor/reasonml-idea-plugin/blob/8a2820d8dedc45f3a93a11a563f8d71fcae2b22d/src/com/reason/build/dune/DuneOutputListener.java#L28

Tuareg has a list of compilation messages that can be used for reference: https://github.com/Chris00/tuareg/blob/master/compilation.txt

@giraud
Copy link
Owner

giraud commented Jun 28, 2019

Thanks for the reference.
I'm not ready for ocaml >= 4.09 yet 😄

giraud added a commit that referenced this issue Mar 7, 2023
giraud added a commit that referenced this issue Mar 7, 2023
@giraud
Copy link
Owner

giraud commented Apr 28, 2023

should be ok

@giraud giraud closed this as completed Apr 28, 2023
giraud added a commit that referenced this issue May 3, 2023
giraud added a commit that referenced this issue May 3, 2023
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