Skip to content

Conversation

@rickhohler
Copy link

This PR implements the ConvertToSwitchStmt refactoring action as requested in SourceKit-LSP #2424.

It supports converting if/else if/else chains into switch statements when simpler == comparisons are used against a common subject.

Includes comprehensive unit tests to verify correctness and safety (e.g. exhaustiveness checks via implicit default: break insertion).

…g#2424)

- Implements ConvertToSwitchStmt refactoring action.
- Supports converting if/else if/else chains with == conditions on a common subject.
- Adds comprehensive unit tests including failure scenarios.
- Ensures generated switch statements are exhaustive (implicit default: break).
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.

1 participant