vknabel / vscode-swiftformat

SwiftFormat for VS Code
https://marketplace.visualstudio.com/items?itemName=vknabel.vscode-swiftformat
MIT License
39 stars 7 forks source link

Strange logic for calling swiftformat "--config .swiftformat --indent 4"???? #16

Closed centny closed 3 years ago

centny commented 3 years ago

i print arguments when plugin call swiftforamt, go

--config /Users/cny/git/im/tinode/.swiftformat --indent 4

so --indent 2 in .swiftformat is not working

so .........

vknabel commented 3 years ago

Hey @Centny!

Thanks for your feedback. Currently there is already #15 for this. Initially it has been thought as feature, but I know about the misleading behaviour. If you have suggestions, feel free to discuss.

As a temporary workaround, you can set swiftformat.options to ["--indent", "2"] or you can tap on the Spaces: 4-Entry in vscode's status bar below and change the indentation to Indent using Spaces and then 2.

Alternatively I can recommend to add an .editorconfig-file and set the indent-size to 2 for Swift-files.

Hope this helps!