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

Support --error-format=json #2499

Open
1 task
hsanson opened this issue Mar 10, 2024 · 2 comments
Open
1 task

Support --error-format=json #2499

hsanson opened this issue Mar 10, 2024 · 2 comments
Labels
enhancement New feature or request
Milestone

Comments

@hsanson
Copy link

hsanson commented Mar 10, 2024

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

  • ...
@hsanson hsanson added the enhancement New feature or request label Mar 10, 2024
@jcamiel
Copy link
Collaborator

jcamiel commented Mar 14, 2024

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?

@hsanson
Copy link
Author

hsanson commented Mar 15, 2024

As long as it is json format, I can parse, modify, and present it whichever way is best for my editor.

@jcamiel jcamiel added this to the 5.0.0 milestone Apr 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants