eclipse-jdt / eclipse.jdt.ui

Eclipse Public License 2.0
32 stars 79 forks source link

Add batch quick fix option when there is more than 1 fix #1450

Open nlisker opened 1 month ago

nlisker commented 1 month ago

When a single file has several problems of the same type, the compiler offers us to apply a solution on all similar problems. For example, with missing @Override annotations: image

However, in the following example:

interface A {}

class B {

    B(A a) {
        getQ1();
        getQ2();
        getQ3();
    }
}

image we don't have "fix 3 problems of the same category in file".

Furthermore, selecting all similar problems in the Problems view, right clicking, and selecting Quick Fix (ctrl-1) shows the following dialog for the @Override example: image

But for my example with the missing methods, you get a message saying that there's no common quick fix: image

There are common quick fixes. The dialog should be shown with the 2 options shown above (create a method and cast) under "Select a fix".

Using Eclipse 4.31.