rest.nvim icon indicating copy to clipboard operation
rest.nvim copied to clipboard

Feature request: use an internal JSON beautifier

Open NTBBloodbath opened this issue 3 years ago • 3 comments

I think I can do a pure Lua parser for beautifying JSON, in this way we can ditch jq for the JSON formatting and avoid having additional system-wide dependencies.

NTBBloodbath avatar Sep 22 '21 22:09 NTBBloodbath

Hello.

I used to use my own HTTP client plugin. But I came across this one recently, and ditched my own in favour of yours. So, thanks for that! :)

Although I do consider dependencies as bad for plugins, I think jq is a good one. I would prefer being able to use jq and even have an option to pass the output through my own chain of commands than to use an internal parser that may or may not be as flexible.

I just noticed the issue and I thought I could give my 2 cents. Thanks for the good work!

Furkanzmc avatar Sep 24 '21 03:09 Furkanzmc

chiming in on @Furkanzmc's comment, perhaps it could be an overridable function. This way it could be the most flexible and customizable. I was also playing with the idea of running it through a custom command, perhaps dprint.

disrupted avatar Sep 24 '21 09:09 disrupted

https://github.com/prettier/prettier is also a popular choice...

jens1205 avatar Sep 24 '21 20:09 jens1205