Skip to content
This repository has been archived by the owner on Mar 21, 2024. It is now read-only.

Incorrect problem matcher for ocaml >= 4.09 #279

Open
Khady opened this issue Jun 28, 2019 · 0 comments
Open

Incorrect problem matcher for ocaml >= 4.09 #279

Khady opened this issue Jun 28, 2019 · 0 comments

Comments

@Khady
Copy link
Collaborator

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)

The code to change seems to be in package.json:

{
"regexp":
"^\\s*\\bFile\\b\\s*\"(.*)\",\\s*\\bline\\b\\s*(\\d+),\\s*\\bcharacters\\b\\s*(\\d+)-(\\d+)\\s*:\\s*$",
"file": 1,
"line": 2,
"column": 3,
"endColumn": 4
},

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

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

No branches or pull requests

2 participants
@Khady and others