Community
Participate
Working Groups
Build ID: I20080617-2000 Steps To Reproduce: 1. Create a .java file with 2 methods that both have unused parameters 2. select both rows in the table in the Problems view. 3. Type CTRL-1, 4. Notice that nothing happens. What I would like to happen is: 4. In the Quick Fix Dialog, select "Add @SuppressWarnings('unused') to '???'" 5. Click the Finish button. Thanks. More information:
You can select one of them and then you'll get a dialog that allows to fix both problems. The Problems view should enable the Quick Fix action if all selected markers have a quick fix. For performance reasons it could do the check whether they all have the same set of fixes later and inform the user if that's not the case.
Are you saying that this is fixed in a newer version? Because the situation is as I describe in version 3.4.0. i.e. it is not possible to apply the "Add @SuppressWarnings" quick-fix to more than than one line at a time. Thanks.
There are two issues reported here: the multi-selection issue (this bug) and a feature request that the "Add @SuppressWarnings 'unused' to ..." quick fix becomes a multi-fix (see bug 252939).
Ah, my apologies. Don't know why I did not find that bug report. I only intended to report the feature-request, so this can get marked as a duplicate if you see fit.
>Ah, my apologies. Don't know why I did not find that bug report. Well, I just filed it a few minutes ago ;-) >I only intended to report the feature-request, so this can get marked as a >duplicate if you see fit. It is not a duplicate: even if bug 252939 gets fixed quick fix won't be enabled on multi-selection in the Problems view.
As indicated by Daniel, the feature you look for depends on the particular quick-fix (Marker Resolution) being a multi-fix .For example, observe the quick fix "Remove 'unused', keep side-effect assignments" for the warning "The local variable 'unused' is never read" .This works over multiple markers.
This bug is not fixed as multi-selection is not supported yet.
(In reply to comment #1) > You can select one of them and then you'll get a dialog that allows to fix both > problems. > > The Problems view should enable the Quick Fix action if all selected markers > have a quick fix. For performance reasons it could do the check whether they > all have the same set of fixes later and inform the user if that's not the > case. > Enabling multi-selection for quick fix would unnecessarily complicate things. If the selected markers have different sets of quick fixes , agreed, we may inform the user, but this is not very intuitive; also, which quick fix would we choose to work with , the first selected marker's ? Also, enabling for multi-selection may seem to suggest that multiple ( different ) quick-fixes are handled at same time (and may be subsequently requested). How do we test if the two quick fixes are the same - rely on 'Object.equals' ? This behaviour would depend on the contributed Marker Resolutions. If the sets of quick fixes happen to be the same (their labels may still differ), then we'd have to show them separately in the UI. All this would, however, not change the behaviour if they were multi-fixes already. I may not have highlighted all the points, but IMO, it is best to work on a per-problem basis and let the multi-fix take care of multiple markers.
This would be giving too much to the user and can lead to problems. Multi-fixes address this elegantly. Marking as WONTFIX.
We need to do something here in light of bug 326000.
OK, here's the plan: 1. Enable Quick Fix on a multi-selection if at least one element has resolutions. 2. When Quick Fix is invoked we look for resolutions that cover all selected markers. This is not expensive as we only need to check the other resolutions of the first selected marker against the rest of the selection. 3a.If step 2. gives no resolutions, we show a dialog (this can already happen now with single-selection) which gives the users some hints in the multi- selection case: - suggest to only select one marker - suggest to use Clean Up 3b.If step 2. returned common resolutions we show them in the Quick Fix dialog.
Fixed in HEAD. Available in builds >= N20101013-2000.
Created attachment 180779 [details] Fix
Verified for 3.7M3 on Linux-GTK with I20101025-1800.
(In reply to comment #14) > Verified for 3.7M3 on Linux-GTK with I20101025-1800. Quick fix still can not be applied to several similar "XXX can not be resolved to a type" error rows in 'Problems' View - for ambiguous Organize Imports problems.
> Quick fix still can not be applied to several similar "XXX can not be resolved > to a type" error rows in 'Problems' View - for ambiguous Organize Imports > problems. It only works if the Quick Fix is implemented as multi-fix. You need to file a bug report against the concrete Quick Fix(es).