Unqualify/Qualify all branches in a case expression with a code action #6093
CristianRos
started this conversation in
Ideas & suggestions
Replies: 2 comments 1 reply
|
I've felt the same pain a few times! I personally think it would be a nice change for the code action to qualify/unqualify all variants of the same type in the module. I always end up doing that myself for consistency anyway. I think the code action making everything consistent would be nice, the only exception is if one of the variants can't be unqualified because there's already a value (imported from another module, or defined in the current module) with the same name. In that case it should leave it unchanged |
0 replies
|
Could be useful, but I don't think it should be bound to case expressions in any way as they don't have anything specific to do with variants or imports, and one may way to qualify or unqualify many values in other bits of code too. |
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Right now if you have:
and you want to have:
You have to manually unqualify those through 2 code actions, this grows to N number of branches that you may have to unqualify. I believe you may also want to do the opposite in case you had it unqualified and now something feels ambiguous because you added something new, so qualify everything again.
Invoking an action directly from the expression that handle all the cases is the suggestion.
All reactions