-
Notifications
You must be signed in to change notification settings - Fork 918
Open
Labels
Java[ci] enable extra Java tests (java.completion, java.source.base, java.hints, refactoring.java, form)[ci] enable extra Java tests (java.completion, java.source.base, java.hints, refactoring.java, form)kind:featureA feature requestA feature requestneeds:triageRequires attention from one of the committersRequires attention from one of the committers
Description
Description
The hint Assign Return Value To New Variable is available for most expressions, but not for switch expressions.
Use case/motivation
Example:
enum FooBar { FOO, BAR };
FooBar fooBar = FooBar.FOO;
switch (fooBar) { case FOO -> 10; case BAR -> 20; };The hint should be available on the switch line and result in:
int [name] = switch (fooBar) { case FOO -> 10; case BAR -> 20; };For comparison, it is available on:
fooBar == FooBar.FOO ? 10 : fooBar == FooBar.BAR ? 20 : -1;The usefulness should hopefully be obvious.
Related issues
No response
Are you willing to submit a pull request?
No
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
Java[ci] enable extra Java tests (java.completion, java.source.base, java.hints, refactoring.java, form)[ci] enable extra Java tests (java.completion, java.source.base, java.hints, refactoring.java, form)kind:featureA feature requestA feature requestneeds:triageRequires attention from one of the committersRequires attention from one of the committers