Fork me on GitHub
#calva
<
2024-01-27
>
chromalchemy01:01:47

Are all the Clojure-LSP commands covered in Calva? I see many in the command menu, but not all..? https://clojure-lsp.io/features/#clojure-lsp-extra-commands

ericdallo02:01:27

IIRC those commands are manually coded in Calva, so I guess someone need to update that, otherwise you will only access some of them via LSP code actions

pez11:01:56

Issue welcome. Here’s where we do this https://github.com/BetterThanTomorrow/calva/blob/dev/src/lsp/commands/lsp-commands.ts#L151-251 It has untapped dynamic potential. If clojure-lsp has a way to discover the functions we could do it that way instead and not have to keep the list in sync.

ericdallo12:01:33

Those are available in the initialize request, but some of them expect custom args, I think makes sense to provide them in server-info request

chromalchemy18:01:39

It’s not as many as I might have thought. Based on manual diff… The calva code has these names I dont see in clojure-lsp reference: • move-coll-entry-down • move-coll-entry-up • sort-map • supress-diagnostic The clojure-lsp reference has these names I dont see in Calva code: • replace-refer-all-with-refer • replace-refer-all-with-alias So If I understand right. For lsp refactor commands I don’t see in vscode command menu, but are represented in the Calva code, they are likely mapped to default vscode hotkeys? Ex: extract-to-def

ericdallo20:01:44

They probably are accessed via code actions(the 💡 icon), so all code actions are commands in the way but not every command could be a code action( clojure server-info for example)

ericdallo20:01:11

Sort map is available via code actions and command, but I think it was renamed to sort clauses

chromalchemy02:01:13

Ok thanks for context