Hello,
A new feature exists in Eclispe's 3.2 Quick fix.
It's the magic button "Find Similar Problems"
When you click on that button you can apply the same fix for the same problem.
Can you please implements this feature with checkstyle.
Thank you
Regards
Logged In: YES
user_id=1238882
Originator: NO
I looked into it.
To get this working we would need our MarkerResolutions to extend from WorkbenchMarkerResolution.
Unfortunatly this abstract class was introduced in Eclipse 3.2.
If I would implement this feature we would break compatibility of the plugin with Eclipse 3.0/3.1, which is not desirable since many corporate users are still hooked with those versions.
We also lack the resources to maintain 2 development streams, so I figure this feature would be unimplementable until Eclipse 3.0/3.1 goes into retirement.
However, we could implement a similar feature for the Checkstyle violations view, where you could select a bug category and invoke something like "Fix all occurrences".
How would you like that?
I recently raised a question on StackOverflow regarding multiple quick fixes before encountering this feature request. Can I ask if this idea ever gained traction? Some kind of bespoke eclipse-cs solution to implementing multiple fixes of the same type would be highly desirable (to me at least).
Since Eclipse 3.6 is the minimum supported Eclipse version nowadays I think this could be picked up again.
I'll try and see if this works out easily...
Ok, please give this a spin, if you like:
http://eclipse-cs.sourceforge.net/net.sf.eclipsecs-updatesite_5.6.1-SNAPSHOT.zip
When invoked via the Problems view the quickfix dialog should now contain all other occurrences of the problem, and you should be able to process them all.
Cheers,
Lars
Hi Lars,
Thanks for the very swift response.
I tested this using the simple class defined in my StackOverflow question (linked above). Using the standard Sun checkstyle checks, the missing
if
braces result in two checkstyle problems (line 12 and line 15).Using the Problems view, if I right-click on the problem on line 12 and select Quick Fix, the dialog box shown by Eclipse offers to fix the following issues:
As you can see, line 12 is referenced twice and auto-selected, line 15 is not selected automatically. If I adjust the selections so that line 12 and 15 are correctly chosen, the fix works fine. E.g.
So it seems like you've solved the fundamental issue, but now have a tiny display bug. (Or Eclipse has a bug). Thanks again for such a swift response on this.
Thanks for the feedback.
Yeah, I noticed this duplication issue too - it's alway the marker selected in Problems view which is duplicated.
My debugging revealed that the duplication happens in Eclipse code (selected marker is added to the fixable collection), and there seems no way to counter-act that.
In any case, the duplication does not seem to impair the functionality itself, so I guess it's good enough.
The bug is in org.eclipse.ui.internal.views.markers.QuickFixHandler.execute(ExecutionEvent)
Still present in 4.2, I filed a bug report over @Eclipse:
https://bugs.eclipse.org/bugs/show_bug.cgi?id=391711
Thanks for the information. Again, I really appreciate your swift reaction to a feature request!
Hi again - could you kindly confirm which version first introduced this feature? It seems like it was 4.4.0, based on the milestone. But the release notes at http://eclipse-cs.sourceforge.net/releasenotes/4.4.0/release_notes.html don't list this.
(Side note: it would be great to have an option to see all the release notes on one page).
Given that I provided a 5.6.1-SNAPSHOT build to test back then, I assume it was fixed in the 5.6.1 version.
Seems I had missed adding it to the 5.6.1 release notes - also I am not sure why I tagged the issue with milestone 4.4.0.