[ad_1]
When I use vscode
‘s apple-swift-format (whose hot-key is Shift+Option+F
) to format my code, the result show it doesn’t work with the ../../.swift-format
.
I set my custom .swift-format
as
"indentation" : {
"spaces" : 4
},
but when I pressed Shift+Option+F
, I got the result with indentation spaces 2
. And this should be the default configuration.
As for the description from https://github.com/apple/swift-format:
For any source file being checked or formatted, swift-format looks for a JSON-formatted file named
.swift-format
in the same directory. If one is found, then that file is loaded to determine the tool’s configuration. If the file is not found, then it looks in the parent directory, and so on.
Besides, I tried to use command-line-tool to format my source code and it works well in expection, with indentation spaces 4
.
So why the vscode/apple-swift-format
extention doesn’t work in expect? Is this is a bug for the extention?
My swift-format
tool’s version is 0.50600.0
.
[ad_2]