vscode-sort-json icon indicating copy to clipboard operation
vscode-sort-json copied to clipboard

Sort on save is broken?

Open tylerlaprade opened this issue 2 years ago • 3 comments

I tried both, "all formatters" and specifically enabling just this formatter. Neither autoformats on save for me.

tylerlaprade avatar Mar 27 '23 19:03 tylerlaprade

Yeah I'm seeing the same issue with version [email protected] on VSCode 1.78.2.

My test files are a workspace and user settings.json file, the auto-format on save configuration is c&p from the README

    "editor.codeActionsOnSave": {
        "source.fixAll.sortJSON": true
    }

Manually sorting the files works as expected, the 'sort on save' though is not triggered.

I'm happy to troubleshoot, any hints where to start?

dantefromhell avatar Jun 07 '23 17:06 dantefromhell

I'm seeing the same issue. Manual sorting via the command palette is fine, but workspace settings.json is not respected.

dlastrazeneca avatar Jul 21 '23 06:07 dlastrazeneca

You can use VSCode built-in JSON sort on save json.sortOnSave.enable (will be changed to "editor.codeActionsOnSave": { "source.sort.json": true } on Sep 23 release).

mcm-ham avatar Sep 07 '23 23:09 mcm-ham