Skip to content

Add switch autocomplete on enum #36290

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

Closed
tolotrasamuel opened this issue Mar 21, 2019 · 2 comments
Closed

Add switch autocomplete on enum #36290

tolotrasamuel opened this issue Mar 21, 2019 · 2 comments
Assignees
Labels
devexp-server Issues related to some aspect of the analysis server legacy-area-analyzer Use area-devexp instead. type-enhancement A request for a change that isn't a bug

Comments

@tolotrasamuel
Copy link

tolotrasamuel commented Mar 21, 2019

In Android Studio, Dart does not compile if a switch is used on an enum and some clause are missing.
Though I do not see why should that trigger a fatal compiler error, (Why not just skip missing clause) one would intuitively place the cursor on the error and press the keys: ALT+ENTER but nothing happens.

I suggest a feature that auto-generate all missing clause with an empty: break statement or just not consider this a fatal compiler error at all.

image

@lrhn
Copy link
Member

lrhn commented Mar 21, 2019

It makes sense to have a fix to remove the error. Just adding default: break; is likely not sufficient :)

(See #36127 for the ongoing discussion about whether this should be a warning or error. The fix makes sense in either case).

@lrhn lrhn added legacy-area-analyzer Use area-devexp instead. devexp-server Issues related to some aspect of the analysis server type-enhancement A request for a change that isn't a bug labels Mar 21, 2019
@bwilkerson bwilkerson self-assigned this Mar 23, 2019
@bwilkerson
Copy link
Member

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
devexp-server Issues related to some aspect of the analysis server legacy-area-analyzer Use area-devexp instead. type-enhancement A request for a change that isn't a bug
Projects
None yet
Development

No branches or pull requests

3 participants