Bug 517052 - Provide a way to set relevance for marker to sort quick fix resolutions
Summary: Provide a way to set relevance for marker to sort quick fix resolutions
Status: RESOLVED FIXED
Alias: None
Product: Platform
Classification: Eclipse Project
Component: IDE (show other bugs)
Version: 4.7   Edit
Hardware: PC Windows 7
: P3 normal (vote)
Target Milestone: 4.7.1   Edit
Assignee: Vikas Chandra CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: 516706 519549
  Show dependency tree
 
Reported: 2017-05-22 04:39 EDT by Vikas Chandra CLA
Modified: 2017-08-07 04:43 EDT (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Vikas Chandra CLA 2017-05-22 04:39:35 EDT
1) Import org.eclipse.ui.genericeditor
2) Go to preference option - Plug-in Development -> Compiler -> Usage - > Usage of non-externalized strings
3) Set the above option to "Error".
4) In the problem views, there are 2 new errors.
5) Right click any one of them and select quick fix

Expected : "Configure problem severity" should be seen as the last option.

Current Result : Alphabetical sort happens and hence  "Configure problem severity" is the 1st option.

There must be a way to provide relevance to the marker in platform.ide so that
QuickFixPage.java can use it during sort.
Comment 1 Eclipse Genie CLA 2017-05-22 04:41:20 EDT
New Gerrit change created: https://git.eclipse.org/r/97654
Comment 2 Vikas Chandra CLA 2017-07-05 06:52:35 EDT
Since this is an API addition, I have increased the minor version of this plugin.
Comment 3 Vikas Chandra CLA 2017-07-11 04:36:04 EDT
Dani, can you look at https://git.eclipse.org/r/#/c/97654/6

The problem in quickfix page needs relevance to sort. I have added an interface IMarkerRelevance which has a single method which gives relevance. The default implementation is that it returns 0. The quickfix page will sort the resolutions that has relevance such that the greater the relevance, the higher up that resolution is on the list. Putting this method in IMarkerResolution or IMarkerResolution2 ( even with default implementation ) would have meant a breaking change ( and hence major version change). Another option is creating IMarkerResolution3 but I think abstracting out the relevance gives greater flexibility to the clients.
Comment 4 Dani Megert CLA 2017-07-14 06:39:47 EDT
(In reply to Vikas Chandra from comment #3)
> Dani, can you look at https://git.eclipse.org/r/#/c/97654/6
> 
> The problem in quickfix page needs relevance to sort. I have added an
> interface IMarkerRelevance which has a single method which gives relevance.
> The default implementation is that it returns 0. The quickfix page will sort
> the resolutions that has relevance such that the greater the relevance, the
> higher up that resolution is on the list. Putting this method in
> IMarkerResolution or IMarkerResolution2 ( even with default implementation )
> would have meant a breaking change ( and hence major version change).
> Another option is creating IMarkerResolution3 but I think abstracting out
> the relevance gives greater flexibility to the clients.

The marker resolution needs the relevance and not the marker. Please fix the Gerrit change accordingly.

Also, the Javadoc should be clearer, see e.g. IJavaCompletionProposal.getRelevance().
Comment 6 Eclipse Genie CLA 2017-08-04 04:11:02 EDT
New Gerrit change created: https://git.eclipse.org/r/102512
Comment 7 Vikas Chandra CLA 2017-08-04 05:04:51 EDT
Verified on photon
Version: Photon (4.8)
Build id: I20170802-2000

by code inspection and also that the 2 clients ( pde and jdt ui) are able to use it successfully. See bugs in "Blocks" list for details.