Repository navigation
Conversation
Add a new plugin that verifies, formats and minifies JSON documents using the Python standard library json module. The plugin adds three actions to the Tools menu (Verify, Format, Minify) with the accelerators Ctrl+Alt+V, Ctrl+Alt+F and Ctrl+Alt+M. It is opt-in: it is not marked as builtin, so it must be enabled in Preferences > Plugins. It is wired into the build (plugins/meson.build), its translatable strings are listed in po/POTFILES.in, and it is documented in the user manual. See linuxmint#139
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Add a new plugin that verifies, formats and minifies JSON documents using the Python standard library
jsonmodule.This PR aims to add support for one of the code formatters requested in #139.
What it does
Three actions are added to the Tools menu:
Ctrl+Alt+VCtrl+Alt+FCtrl+Alt+MThe result is reported in the status bar.
Invalid JSON leaves the document unchanged and reports the error (with line/column).
Verify works on read-only documents; Format/Minify are disabled for them.
The status bar message is cleared when the active document changes or is modified, so it cannot go stale.
Notes for reviewers
Builtin, so it must be enabled in Preferences → Plugins.json) — no new dependency.plugins/meson.build), its translatable strings are listed inpo/POTFILES.in, and it is documented in the user manual..pofiles are intentionally left untouched.Screenshots
Thank you !