vscode-sort-json
vscode-sort-json copied to clipboard
Doesn't honor current indentation settings
I currently use tabs for formatting a lot of my code, and have "editor.insertSpaces": false and "editor.detectIndentation": false configured in my settings. When sorting it doesn't seem to respect the current tab indentation settings and always reverts back to using spaces for indentation.
Can this be fixed to format the sorted json using the current indentation settings?
“Tabs”!?!
;-)
I‘ll take a look.
@garethflowers today i experienced the issue where the team using "tabs" as indentation (for JSON), in the git, which is different from other files that use 2 spaces but when i sort, it turns the tab to 2 spaces, hence the PR shows the whole file changed,
best solution for my case is -make everyone agree to replace the 2 spaces (standarized)
or if don't want to change:
-configure formatter to match your needs
i use Prettier extension with config, so after sort, i just do formatting and done~
Any update to this? It is still using space while the project setting is using tab
I took a quick look at vscode api, seems like may able to get that from https://code.visualstudio.com/api/references/vscode-api#TextEditorOptions
need to handle what to do when it is auto
I, too, would appreciate this feature. I use tabs for accessibility reasons, and eliminating that extra step of having to reformat my code after sorting my JSON would be fantastic.