clojure-lsp / clojure-lsp/lsp4clj

Code actions are no longer preferred

Open
#32 2 comments 0 reactions 1 assignee Claimed by @mainej View on GitHub
Dominant language
Clojure
Stars
67
Forks
8
PR merge metrics
No merged PRs in 30d

Description

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.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.