-
Notifications
You must be signed in to change notification settings - Fork 55
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support isPreferred
from CodeAction
#829
Comments
This seems to be the case for LSP4E integrated in JDT; is it the same in the generic editor (eg using eclipseide-jdtls) ? Does the generic editor sort the code actions? |
@mickaelistria I think you're right about the sorting done for marker resolutions in Java editor only. Thanks for pointing this out as it seemed to push me in the right direction to address the sorting on our end.
The only thing i don't like in my solution is warnings about extending non-API classes... I'm not sure which part of this could be moved to LSP4E... Perhaps, move |
If this seems generic enough to you, you could start by moving as much as possible of this into the org.eclipse.lsp4e.jdt bundle, so it becomes independent from the Boot type; and then, in a next step, we can more easily discuss what can go in org.eclipse.lsp4e directly to serve other cases than Java one. |
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:
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 thefOrderAlphabetically
isfalse
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 inIJavaCompletionProposal
subtypes. However,org.eclipse.lsp4e.operations.codeactions.CodeActionMarkerResolution
cannot implementIJavaCompletionProposal
because it should be independent from JDT.What would be your thoughts on this @mickaelistria @rubenporras @angelozerr ?
The text was updated successfully, but these errors were encountered: