Skip to content

Improve var decl completion in switch cases #1481

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 2, 2016

Conversation

gregomni
Copy link
Contributor

Variables bound in the case item pattern should be available inside the case body and in the where clause, but not elsewhere within the statement (e.g. other case items). The added accessor
CaseStmt.getLabelItemsRange() is needed to be able to determine the difference between a completion location after a colon and one where the colon doesn’t exist (in both cases this would be in the — implicit
— body statement range).

This is the follow up to completions discussed in #1383.

Variables bound in the case item pattern should be available inside the
case body and in the where clause, but not elsewhere within the
statement (e.g. other case items). The added accessor
CaseStmt.getLabelItemsRange() is needed to be able to determine the
difference between a completion location after a colon and one where
the colon doesn’t exist (in both cases this would be in the — implicit
— body statement range).
@tkremenek
Copy link
Member

@swift-ci Please test

gregomni added a commit that referenced this pull request Mar 2, 2016
Improve var decl completion in switch cases
@gregomni gregomni merged commit de8deb0 into swiftlang:master Mar 2, 2016
@gregomni gregomni deleted the switch-cases branch August 18, 2020 23:12
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