json-emacs/json-mode

Json error replaces buffer

rogerbinns opened this issue · 2 comments

If there is an error in the json code and you do the beautify (C-c C-f) then the buffer is replaced with the error message. You can undo to get back the contents, but this is rather scary.

It should leave the buffer as is and put the error message somewhere else (bonus points for highlighting where the problem is!)

For example have a list of strings and forget a comma between some of them, or have a trailing comma after the last item in a list.

Good point. I definitely want to bring in some kind of error feedback here, possibly even using flymake.

I'm hoping we can resolve this by using json-reformat as in #20. The error reporting could still be made more descriptive, but for now at least it's an improvement.