javaeclipse-plugin

Print list of all Eclipse quick fix suggestions for the active project


I want to write a piece of Java code to call Eclipse quick fix and print all its suggestions in the console.

As an example, if I have a reference to an undefined variable, then the compiler error will be cannot be resolved to a variable. In this case, Eclipse suggestes some fixes such as Create Local Variable, Create Field, or Create Parameter. In my project I want to print this three suggestions as output.

I saw this page, but not useful.

Please let me know what is the best way to do this task.


Solution

  • The solution is to extend org.eclipse.jdt.ui.quickFixProcessors plug-in, and also extends IJavaCompletionProposal interface.

    This web page describes all details that you need. It is in Germany, but I am sure you can use Google translator to have it is English. Hope, it helps.