Skip to content
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

Code actions are no longer preferred #32

Open
mainej opened this issue Oct 25, 2022 · 2 comments
Open

Code actions are no longer preferred #32

mainej opened this issue Oct 25, 2022 · 2 comments
Assignees

Comments

@mainej
Copy link
Contributor

mainej commented Oct 25, 2022

In the migration away from lsp4j and the associated refactoring of the coercer, I missed something. The coercer checks code actions for a key :preferred, which is put in the json as "preferred". This key used to be translated into "isPreferred" which is what the LSP spec defines.

This explains why clients no longer sort preferred code actions at the top.

Rather than fix the issue here in lsp4clj, I'd rather fix the problem in the language servers. I don't like using the coercer to create a slightly different format than the LSP spec. We do that some, but I don't want to do it any more. So, I propose that we find the usages of :preferred in each language server, and convert them to :is-preferred. When that's done, we can change lsp4clj to check for that key.

I have access to clojure-lsp and the language server that my company works on, so I can take care of this in both. I'm opening this issue so that anyone else who uses lsp4clj can make the same changes on their end.

@mainej mainej self-assigned this Oct 25, 2022
@mainej
Copy link
Contributor Author

mainej commented Oct 25, 2022

I've applied this fix locally and unfortunately Emacs still doesn't sort the Add require commands first, so there may be something else wrong on the lsp-mode end.

@ericdallo
Copy link
Member

ericdallo commented Oct 29, 2022

It seems it's only checked on the modeling to show the icon differently @mainej: https://github.com/emacs-lsp/lsp-mode/blob/master/lsp-modeline.el#L113
We should make lsp-code-actions.el consider it too If I'm not mistaken c/c @yyoncho

@ericdallo ericdallo reopened this Oct 29, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants