Fork me on GitHub
#lsp
<
2023-04-06
>
fuad11:04:18

Hi folks! I know clojure-lsp understands potemkin's import-var and provides proper completion and go-to-definition. But I'm experiencing something a bit weird when it comes to docstring/arity info. When I use hover it shows the correct info, but the completion only shows the function name and the source file. For context: I'm on neovim using the builtin lsp client and cmp for completion. I'm also using https://github.com/hrsh7th/cmp-nvim-lsp-signature-help which shows the signature help as I'm typing the params and this one also shows the proper information, which makes me thing the problem is scoped to the lsp completion source in cmp.

ericdallo11:04:46

Could you share a print of what you are seeing on completion and what you expect to see?

fuad11:04:59

Sure 1 second

fuad11:04:16

I'll create a minimal example for reproduction

fuad11:04:21

This is what I see when in the cmp completion dialog which uses the lsp completioin source. The source file is the file where I used import-vars.

fuad11:04:05

This is what I see when I used the plugin I mentioned above. I haven't checked where exactly they get this info from, I'll take a look.

fuad11:04:38

Here's what I see on hover . The source file is the file where the var os original def'd.

fuad11:04:19

In the completion (first screenshot) I would expect seeing the docstring and arity information.

ericdallo11:04:17

Thanks for the detailed info, yeah, could be something on server on client, kinda hard to tell, but if you manage to make a simple repro project with that I can try and confirm where is the bug

fuad12:04:14

Sure, I'll do that. Btw, the plugin apparently - as the name suggest - simply https://github.com/hrsh7th/cmp-nvim-lsp-signature-help/blob/3d8912ebeb56e5ae08ef0906e3a54de1c66b92f1/lua/cmp_nvim_lsp_signature_help/init.lua#L62-L75, so clojure-lsp is definitely making the info available there. The question now is whether the completion problem is server or client as you mentioned.

ericdallo12:04:06

Hum, yeah, fut from what you are seeing the completion popup I'd guess it's server's fault

fuad09:04:06

better late than never!

mpenet12:04:04

I have a weird bug with eglot + clojure-lsp (clangd seems ok) -> https://github.com/joaotavora/eglot/discussions/1202#discussioncomment-5542912

mpenet12:04:32

I am not sure what's the culprit, if I remove markdown mode from the picture it works (no error, but I get no doc popup), but it could just be a side-effect

mpenet12:04:50

it's with eglot 1.14 only 1.13 works

ericdallo12:04:59

Sorry, I don't have context o about eglot, but I use company-quickhelp with clojure-lsp and works all the time, so it's probably a eglot thing indeed I think

mpenet12:04:30

I was wondering if it could be related to the server response maybe, but I ll wait on eglot maintainer to look at it more

ericdallo12:04:57

I don't think it's server response otherwise we could probably repro in other packages/editors, but you can can confirm checking the <https://clojure-lsp.io/troubleshooting/#client-server-log%7Cclient&lt;-&gt;server logs>, and check what server returns after you trigger the completion

mpenet14:04:13

it's an eglot bug 🙂

ericdallo14:04:03

Glad you found it :)