This is because the ta's version of formatting is relatively easier to parse(from plaintext to data) and has enough information to display warnings.
IMHO this process could be improved using some formatting tweaks in camelot's output logic.
Proposal
An option to print a JSON-formatted list of the warnings.
For instance, the following flag would produce an output according to the schema presented below:
camelot -show json
[{
"filename": "./examples/lexical.ml",
"lines": [5, 5],
"cols": [0, 80],
"warning": "exceeding the 80 character line limit",
"fix": "indenting to avoid exceeding the 80 character line limit",
"source": "let verylongvariablenamethisispainful = [1;2;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1]"
},
...
]
the output doesn't have to be pretty-printed
the source field is optional
the lines field, if representing a single line, should simply be a tuple of two identical numbers
alternative: lines and cols could be presented as a string(ex. "5", "0-80") so that the language server parses it afterwards
Background
An implementation of language server for using camelot with vscode is in the works!
The current PoC implementation uses regex to parse the ta's version of output to display warnings in the editor:
This is because the ta's version of formatting is relatively easier to parse(from plaintext to data) and has enough information to display warnings. IMHO this process could be improved using some formatting tweaks in camelot's output logic.
Proposal
An option to print a JSON-formatted list of the warnings. For instance, the following flag would produce an output according to the schema presented below: