Skip to content

Conversation

dylansturg
Copy link
Contributor

The special IfConfigDecl, aka #if, can exist in the cases of a SwitchStmtSyntax because the #if "wraps" one or more switch cases. These weren't being considered for the purposes of indenting the cases. There were also no breaks between the switch statement's left brace and #if when #if was the first "case" which caused malformed code.

I have opted to treat indentSwitchCaseLabels as also indenting the #if cases in a switch statement, because that makes the #if here consistent with other locations.

The special IfConfigDecl, aka `#if`, can exist in the `cases` of a SwitchStmtSyntax because the `#if` "wraps" one or more switch cases. These weren't being considered for the purposes of indenting the cases. There were also no breaks between the switch statement's left brace and `#if` when `#if` was the first "case" which caused malformed code.

I have opted to treat `indentSwitchCaseLabels` as also indenting the `#if` cases in a switch statement, because that makes the `#if` here consistent with other locations.
@allevato allevato merged commit 8df2cb0 into swiftlang:main Oct 7, 2020
@dylansturg dylansturg deleted the pound_if_cases branch May 4, 2022 23:17
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

Successfully merging this pull request may close these issues.

2 participants