Description
I only have in mind showing a quickfix (marker resolution) created based on CodeAction
marked as "preferred" above other quickfixes.
Eclipse sorts quick fixes alphabetically which may not be desirable... For example there are 3 quick fixes proposed to a problem:
- Fix the problem in the current code snippet
- Fix all such problems in the current java file
- Fix all such problems in the corresponding java project
The preferred fix would the current code snippet but it is challenging to push it at the top of the list due to Eclipse's alphabetical sorting. Either label becomes ugly and inconsistent or the order is reversed.
Currently Eclipse sorts the list of quick fixes (together with assists and refactorings) in alphabetical order with org.eclipse.jdt.ui.text.java.CompletionProposalComparator.CompletionProposalComparator
. It is not meant to sort alphabetically since the fOrderAlphabetically
is false
but it falls through to alphabetical order based on resolution labels due to the type of marker resolution object type, i.e. no "relevance" property. The "relevance" property is only available in IJavaCompletionProposal
subtypes. However, org.eclipse.lsp4e.operations.codeactions.CodeActionMarkerResolution
cannot implement IJavaCompletionProposal
because it should be independent from JDT.
What would be your thoughts on this @mickaelistria @rubenporras @angelozerr ?