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

All text gets automatically selected unless some text is already select, then an error dialog pops up #186

Open
primehalo opened this issue May 10, 2024 · 3 comments

Comments

@primehalo
Copy link

primehalo commented May 10, 2024

When the JSON Viewer Panel is active and I switch to a document tab, if nothing in that document is currently selected then the entire document becomes selected.

If I switch to a document tab where a portion of the text is already selected then I get an error dialog box popping up saying "There was an error while parsing JSON. Refer to the current selection for possible problematic area. Error: (3: Invalid value.)" due to it attempting to parse the selected text which is not JSON.

At first I thought these were bugs. Then I thought the "Format JSON to beautify it" button might actually be a toggle switch instead of a button because when I click it a dark border appears around it which stays there when switching between tabs and goes away when I click it again. But regardless of whether or not it has the border around the button, the two above mentioned issues still happen. So now I'm not sure what to think. Can someone shed some light on this?

@SinghRajenM
Copy link
Collaborator

@primehalo, I assume that you are on the latest version of JsonViewer plugin (v2.0.7.0).

There was a feature added which will follow the current tab if it is json, then it will try to update Json Viewer Panel dialog as per current tab either full document or the selected piece of text.

If you don't want feature, please disable it from Json Viewer setting by navigating to Plugin->Json Viewer->Settings. Refer below screenshot for details. Hope this will help.

image

@primehalo
Copy link
Author

Thank you so much!

@primehalo
Copy link
Author

primehalo commented May 13, 2024

When that option is active I would suggest that the entire document not be auto-selected when formatting it (or if that's not possible then at least de-selected when formatting is done). I'd also suggest that if a portion of the document is already selected and that portion is not valid JSON then don't present the error popup.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants