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

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

Open
#1,450 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Java
Stars
59
Forks
127
Avg merge
1d 8h
Merged PRs (30d)
37

Description

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.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the missing-method example in Eclipse 4.31 and compare it with the @Override case, including Quick Fix from the Problems view. Trace the common quick-fix selection path for the selected diagnostics; done means the dialog offers the shared create-method and cast fixes instead of reporting no common quick fix.

Written by the indexing model from the issue text.

Assessment

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.