Support --error-format=json
Problem to solve
Current error formats short and long are too complex to parse. Would be nice to have the output formatted in JSON so is easier to parse.
Proposal
Output compatible with vim's quickfix list would be best:
[
{
"filename": "/absolute/path/to/file.hurl",
"lnum": 20,
"end_lnum": 20,
"col": 1,
"end_col": 25,
"text": "Undefined Variable: you must set the variable post_id" ,
"type": "E"
}
]
Additional context and resources
Trying to improve the hurl.nvim plugin.
Tasks to complete
- [ ] ...
Hi @hsanson
Sorry for the delay!
Yes, it's make totally sens to add --error-format=json.
Just a small note, the JSON format will certainly be a little different from vim's. Partly because we already serialise error with --json but also because I think we'll add specific HTTP fields (like body response, headers etc...). Of course, we'll have every field necessary to display an error: filename, error start and end position, textual description so it should be easy to map to a vim's error JSON.
It's okay with you?
As long as it is json format, I can parse, modify, and present it whichever way is best for my editor.