richie5um / vscode-sort-json

VSCode Extension to Sort JSON objects
https://marketplace.visualstudio.com/items?itemName=richie5um2.vscode-sort-json
MIT License
110 stars 19 forks source link

Sort on save is broken? #78

Open tylerlaprade opened 1 year ago

tylerlaprade commented 1 year ago

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

dantefromhell commented 1 year ago

Yeah I'm seeing the same issue with version richie5um2.vscode-sort-json@1.20.0 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?

dlastrazeneca commented 1 year ago

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

mcm-ham commented 1 year ago

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).