eclipse-jdt / eclipse-jdt/eclipse.jdt.ui

[quickfix] Allow creating switch expressions from quickfix context menu

Open
#1,143 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Java
Stars
59
Forks
127
Avg merge
1d 8h
Merged PRs (30d)
37

Description

(I guess this is a feature request)

The quick fixes for the switch only supports creating old-style switch statements, not switch expressions:

image

It would be great if we had "Add missing case expressions" so that we would get
````
switch (type) {
VALUE_1 -> {}
VALUE_2 -> {}
}
````

instead of

````
switch (type) {
VALUE_1: break;
VALUE_2: break;
default: break;
}
````

Contributor guide

Open the contributing guide

Research direction

Start by locating the Java quick-fix entry point for completing missing switch cases and inspect how it builds old-style switch statements. Add support for offering an expression form from the quick-fix context menu, producing arrow cases like the example, and verify both generated forms through the relevant quick-fix tests.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
devtools
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.