vscode: User settings.json can't be formatted in v1.37
Version: 1.37.0 (user setup) Commit: 036a6b1d3ac84e5ca96a17a44e63a87971f8fcc8 Date: 2019-08-08T02:33:50.993Z Electron: 4.2.7 Chrome: 69.0.3497.128 Node.js: 10.11.0 V8: 6.9.427.31-electron.0 OS: Windows_NT x64 10.0.18362
Steps to Reproduce:
- add
"workbench.settings.editor": "json", "workbench.settings.useSplitJSON": trueto User settings.json - indent a line in settings.json
- use prettier to format settings.json
- vscode warns in the status bar

It’s not the case in v1.36.1
Does this issue occur when all extensions are disabled?: Yes
About this issue
- Original URL
- State: closed
- Created 5 years ago
- Comments: 22 (12 by maintainers)
I got findings. The “solution” (or the reason why it worked) was to close all folders. In short: (for me) formatting
settings.jsondoesn’t work if a folder is open. Update: it seems the same happens when editingkeybindings.json.Could anyone please reopen this?
Just to be clear:
I don’t think it’s a Prettier issue because it works with
jsoncfiles normally (also if you try withHookyQR.beautifywhich also supportsjsonc, the same thing happens). Curious thing is that, if you try with the same plugin versions and VSCode1.36.1or1.36.0it works as expected, so it’s likely not a plugin issue but something that was introduced in1.37.0. Also, as others have pointed out, it works normally if you open the files viaFile > Open fileso it’s clear it’s not a plugin issue.@roblourens No, it doesn’t have any comments, although the language mode shows “JSON with comments”. Other jsonc files can be formatted as normal. Again, formatting is only not working if I open settings.json through vscode settings commands.