Writing custom quick fix for SonarLint On-The-Fly in Eclipse

Hi,

i’m developing a tool to automatically refactor Java-Source-Code to solve Sonar-Issues and i was wondering if there is a possibility to add a custom quick-fix or a new action inside the context menu of the SonarLint On-The-Fly view in Eclipse IDE to trigger my tool and automatically fix the issue.

Thanks in advance
Vladislav

Hi,

Eclipse has its own API to provide quick fixes (look for IMarkerResolutionGenerator2).

Anyway I would be very interested if you could share the list of quick fixes that you intend to implement. We are regularly thinking about implementing some, but always conclude they are either:

  • too simple, could be easily achieved by an IDE shortcut (delete the line, extract a method, …)
  • unsafe, no obvious fix, developer will have to review each issue one by one

So if you have good examples, it might help us to decide implementing them ourselves :wink: