Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Doesn't honor current indentation settings #33

Open
garethflowers opened this issue Nov 25, 2019 · 5 comments
Open

Doesn't honor current indentation settings #33

garethflowers opened this issue Nov 25, 2019 · 5 comments

Comments

@garethflowers
Copy link

garethflowers commented Nov 25, 2019

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?

@richie5um
Copy link
Owner

“Tabs”!?!

;-)

I‘ll take a look.

@rickvian
Copy link

@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~

@unional
Copy link

unional commented Feb 15, 2023

Any update to this? It is still using space while the project setting is using tab

@unional
Copy link

unional commented Feb 15, 2023

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

@mkimitch
Copy link

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.

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

No branches or pull requests

5 participants