Community
Participate
Working Groups
Created attachment 275302 [details] Screenshot Our plugin is contributing some MarkerResolutions. They are displayed when you hit Ctrl+1 in an editor on a marker. Some users are complaining of the order, they would prefer to see "normal" Eclipse refactorings first. I just discovered the new IMarkerResolutionRelevance which seemed to be exactly what I was looking for. But after a quick test, it seems the order is only used when building the quick fix dialog, but not to display quick fixes in the editor tooltip (see screenshot). Would it be possible to also apply IMarkerResolutionRelevance there? Thanks
Which editor? Please attach a sample plug-in that demonstrates the issue.
(In reply to Dani Megert from comment #1) > Which editor? I reproduced with the Java Editor. > Please attach a sample plug-in that demonstrates the issue. Hum, this is quite some work. Do you really need that? Our plugin is open source: https://github.com/SonarSource/sonarlint-eclipse so you can use it as a reproducer. * install it from the marketplace * create a new Java project * type some code that will trigger both a SonarLint marker and a JDT refactoring suggestion (see my screenshot) * hit Ctrl + 1 Also I looked at the code, and the only place where IMarkerResolutionRelevance is used is when building the QuickFixPage: https://github.com/eclipse/eclipse.platform.ui/blob/5cc6deb2c59b6282f7ee2bb8ccea4918838f27d9/bundles/org.eclipse.ui.ide/src/org/eclipse/ui/internal/views/markers/QuickFixPage.java#L264 So to me it is clear that this concept of resolution priority is not used when showing the resolutions in the Quick Fix tooltip.
Julien, could you upload a Gerrit? I'm happy to review it and test it, using your SonarLint plug-in. In case you are not familiar with Gerrit please feel free to reach out to me (Lars.Vogel@vogella.com), the base setup should be described here: http://www.vogella.com/tutorials/EclipsePlatformDevelopment/article.html#exericse-eclipse-user-creation-and-gerrit-server-configuration Just for reference, we do hackathons on a regular basis and it typically takes 10-20 mins for the Gerrit setup.
Hi Lars, Can you point me to the place that should be updated? I tried to look for the quick fix tooltip, but I can't find it. Is it something specific to JDT?
(In reply to Julien HENRY from comment #4) > Hi Lars, > > Can you point me to the place that should be updated? I tried to look for > the quick fix tooltip, but I can't find it. Is it something specific to JDT? Sorry Julien for the deplayed response. I think the relevant class is: JavaCorrectionProcessor.computeQuickAssistProposals(IQuickAssistInvocationContext) line: 249 a few lines later is seem to delegate to CompletionProposalComparator#getRelevance for the sorting. Can you have a look if that is the place in which also your quickfixes show up? I debugged in a plain SDK.
(In reply to Julien HENRY from comment #0) > Created attachment 275302 [details] > Screenshot > > Our plugin is contributing some MarkerResolutions. Noopur, can you please tell us which class shows the quick fixes / quick assists? Looks like the sorting is not correct in this class.
(In reply to Lars Vogel from comment #6) > Noopur, can you please tell us which class shows the quick fixes / quick > assists? Showing the quick fixes/assists is done in org.eclipse.jface.text.quickassist.QuickAssistAssistant.showPossibleQuickAssists(). For relevance of Java proposals, see org.eclipse.jdt.ui.text.java.IJavaCompletionProposal.getRelevance(). See bug 517052 where IMarkerResolutionRelevance was added for QuickFixPage. Adding Vikas in cc in case you have any other questions related to this.