Skip to content

[Next] Add a JSON Formatter plugin - #769

Open
Elnaril wants to merge 1 commit into
linuxmint:masterfrom
Elnaril:json-plugin
Open

Elnaril wants to merge 1 commit into
linuxmint:masterfrom
Elnaril:json-plugin

Conversation

@Elnaril

@Elnaril Elnaril commented Nov 8, 2026

Copy link
Copy Markdown

Add a new plugin that verifies, formats and minifies JSON documents using the Python standard library json module.
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:

Action Accelerator Behaviour
Verify JSON Ctrl+Alt+V Reports whether the active document is valid JSON
Format JSON Ctrl+Alt+F Pretty-prints with 4-space indentation
Minify JSON Ctrl+Alt+M Removes insignificant whitespace

The 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

  • The plugin is opt-in: it is not marked Builtin, so it must be enabled in Preferences → Plugins.
  • It uses only the Python standard library (json) — no new dependency.
  • 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.
  • The .po files are intentionally left untouched.

Screenshots

format_json minify_json verify_json

Thank you !

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
@clefebvre clefebvre changed the title Add a JSON Formatter plugin [Next] Add a JSON Formatter plugin Nov 10, 2026
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

Successfully merging this pull request may close these issues.

1 participant