Fork me on GitHub
#lsp
<
2022-10-20
>
bringe03:10:29

I’ve noticed if I download clojure-lsp from https://github.com/clojure-lsp/clojure-lsp/releases/download/2022.10.05-16.39.51/clojure-lsp-native-macos-aarch64.zip and get the version using that executable (`--version`), I get:

clojure-lsp 2022.10.05-16.48.26-nightly
clj-kondo 2022.10.05
This isn’t a nightly build though. Is the version that it’s reporting incorrect?

borkdude06:10:11

This is a know issue. It’s still the right one but was uploaded later

bringe15:10:20

Ah, thanks

mpenet06:10:49

just wondering: was it considered to put lsp-rename as an action? I use that all the time, I bet I am not alone

1
ericdallo10:10:55

We would need to create a command to rename while the rename is a LSP feature, it'd need some double check if would be possible

jacob.maine15:10:57

I'm not sure rename is a good candidate for the action menu. That command needs to know the new name, which the user has to enter. But unfortunately, I don't think it's possible to ask a user for information like that in the middle of executing an action. You can ask ask a user to make a selection from a menu of choices in the middle of an action, but not to enter arbitrary data. I see this as a deficiency in the LSP spec. If it were possible, we could make use of it in to name new things in Create Function, Extract Function, Promote function, Extract def, etc., instead of falling back to a default new-function or element. It would be useful in other scenarios besides assigning a name too.

☝️ 1
jacob.maine15:10:35

The reason that lsp-rename exists as a separate function is so that the editor has a chance to ask the user for a new name before calling the server

ericdallo15:10:29

Exactly, well remembered @U07M2C8TT, I'd be so nice to have a LSP way to ask user for something presenting a custom field for response

J20:10:04

Hi guys! Any specific config to run clojure-lsp on a polylith repo with emacs? I see that clojure-lsp support polylith since 2021 but I didn’t know why lsp don’t work properly

ericdallo20:10:26

no config, it should work OOTB unless there is anything new since that time I'm not aware

ericdallo20:10:51

clojure-lsp by default will run clj -A:dev:test -Spath by default, are these the aliases that contain your submodules?

J20:10:05

Nothing new since your update. This is the deps.edn

J20:10:07

I reload the editor, clean some files and now it works

ericdallo20:10:44

:man-shrugging:

ericdallo20:10:51

yeah, with that deps.edn it should work

ericdallo20:10:56

BTW, make sure you have latest clojure-lsp

ericdallo20:10:03

clojure-lsp --version

J20:10:16

Yep latest version. Sorry for the inconvenience. By the way, clojure-lsp rocks!!!

ericdallo21:10:10

No problem, glad it's still working! Thank you!!

Drew Verlee22:10:13

feature request idea "map <-> vars"

{:a 1} => (def a 1)
If it seems cool, im happy to add a feature request, then make it myself as soon as there is time. Posting here for quick feedback.

Drew Verlee22:10:27

i guess this could easily be a macro?

Drew Verlee22:10:57

well in like 3 hours i'm going to try and write some clojure code to do this. you can join me in #C04547H53TK for a huddle if anyone is interested in joining me.

ericdallo10:10:02

Is that that common?

Drew Verlee14:10:03

Hasn't been for me, but i need it, so i was going to try and build it.

ericdallo14:10:43

Are you gonna try on clojure-mode or clojure-lsp? because I'm not sure if we should support and maintain it on clojure-lsp if it's not that common to do that

Drew Verlee14:10:59

I don't expect you to build or support it, how would i go about extending things to do it myself? I'll check the docs first and get back to you with specific questions if i have any.

ericdallo14:10:50

I don't think we have a way to have custom code actions, it's not that easy, the protocol doesn't support that flexibility, but it'd be nice though

Drew Verlee14:10:26

It would probably be nice, Alternatively, is it possible make to get the list of lsp actions, cider refactor actions, and other (my stuff), and display them all together?

ericdallo15:10:16

via some elisp custom function probably

👍 1