[BUG] Refresh Errors doesn't seem to do anything
When I had errors in my JSON (for example, the error I make most often is having a Comma after last key-value pair of object, since Perl allows commas after the last item in a hash), after I fix them, I'd like to refresh the error list.
At first, I thought this would be a feature request to add a "refresh errors" button, but while writing it up, I tried the right-click context menu, and found Refresh with current errors
Steps to Reproduce
- FILE =
{ "first": { "l2": [ 1, 2 , 3 ], "level2": false, }, "second": { "l2": [ 9, 8 , 7 ], "level2": true, }, "third": { "l2": [ 5, 5, 5 ], "level2": null, } } - Plugins > JsonTools > Check JSON Syntax Now => See three errors
- Edit so only "second" has the error, but the other two are fixed, and save
- Right-Click,
Refresh with current errors=> still see three errors; expect only one error - Plugins > JsonTools > Check JSON Syntax Now => now see one error, as expected
Conclusion
Either I've misunderstood what Refresh with current errors is supposed to do and I thus want this as a FEATURE REQUEST; or I've correctly understood what the action should do but it's not working, so it should be fixed as a BUG.
@pryrt
For some reason I cannot fathom, I must have originally intended for the error form to work that way, but that was a stupid design decision. It should be rectified by this commit. Now the Refresh with current errors context menu item has the same effect as hitting Enter in the error form, which already performed the operation you wanted (but was not obvious to anyone who didn't carefully read the documentation).
On a related note, I'm thinking about changing the way the See most recent syntax errors in this file menu command works if the error form does not currently exist, and making it so that instead of telling the user there are no errors, it just creates the error form. That would probably be more intuitive than the current implementation.
It should be rectified by this commit. Now the
Refresh with current errorscontext menu item has the same effect as hittingEnterin the error form, which already performed the operation you wanted
I verified using artifact from that commit that either the right-click context choice or hitting Enter will refresh the errors.
(but was not obvious to anyone who didn't carefully read the documentation)
You'd think I, of all people, would Read the Fine Manual before asking a question. ;-)
On a related note, I'm thinking about changing the way the
See most recent syntax errors in this filemenu command works if the error form does not currently exist, and making it so that instead of telling the user there are no errors, it just creates the error form. That would probably be more intuitive than the current implementation.
I hadn't ever used that one. I should RTFM, but when I tried it when there is a syntax error, it just seems to toggle the syntax error panel (ie, if it's already showing, it will hide it). (Okay, before hitting COMMENT, I did look through README and searched your whole repo for most recent syntax, and while I found the source code and translation for those strings, I didn't see that command documented anywhere, so I don't feel as bad.) If the purpose of that action is to just toggle the panel, I think that having "toggle" in the name. Just a thought.