Closed domkm closed 4 months ago
I think what must be going on is:
organizeDeclarations
and sortDeclarations
rules enabled. When this is the case, sortDeclarations
would never attempt to sort a declaration body, since that could conflict with organizeDeclarations
(which implements its own sorting support)organizeTypes
option excludes extension
(the default value is class,actor,struct,enum
). This made it so the organizeTypes
rule didn't run on extensions. So there was no rule that would attempt to sort this declaration.https://github.com/nicklockwood/SwiftFormat/pull/1628 fixes this so that the sortDeclarations
will still sort the body of any declaration type excluded from organizeDeclarations
via the organizeTypes
option.
Thanks for fixing this!
I did have both organizeDeclarations
and sortDeclarations
enabled. However, I was using --organizetypes class,actor,struct,enum,extension,protocol
so I thought it would both organize and sort within extensions.
Is your issue fixed in 0.53.3? If not can you share more details to help me reproduce the issue (sharing a test case with a standalone swift file that reproduces the issue when running a specific SwiftFormat command)?
@domkm I'm assuming this is fixed. Feel free to reopen if not
// swiftformat:sort
beforeextension
does not sort declarations inside the extension.