Fork me on GitHub
#vim
<
2022-02-02
>
herald16:02:00

I recently switched from coc to using nvim's lspconfig and cmp for completion. Does anyone have working docstrings and jump-to-definition with this? Neither work for me.

Noah Bogart16:02:23

can you see the input/output of the lsp and nvim?

Noah Bogart16:02:31

that should tell you if it’s sending the right info back and forth

herald16:02:42

how do I see that?

herald16:02:53

:LspInfo shows it to be attached Client: clojure_lsp (id: 1, pid: 62243, bufnr: [1, 20])

herald16:02:25

and vim.lsp.buf.references() seems to work

Noah Bogart16:02:02

i don’t know anything about neovim’s lsp stuff, so i can’t help you there

Noah Bogart16:02:51

but with coc, i can set verbose: true in clojure-lsp’s settings and that’ll get sent on initialization, which then logs to some place that clojure-lsp uses (which you can also change with ~/.lsp/config.edn i think)

herald16:02:18

I found some logging commands in the lspconfig readme, so I'll try that later

herald16:02:10

also I should clarify: jump to definition works for local definitions, just not for libraries

Noah Bogart17:02:54

yeah i can’t get that to work with coc either, so i don’t know lol

ericdallo17:02:13

I think @rafaeldelboni use neovim with clojure-lsp, maybe he knows something

👋 1
rafaeldelboni17:02:21

yeah I have the same problem, just the first go to definition works, when I'm inside a lib I need to use #conjure go to definition (nrepl)

ericdallo17:02:51

Calva had just the exact same issue which was fixed on latest clojure-lsp

herald17:02:44

@nbtheduke I had it working with coc, you have to add 'jar' and 'zipfile' to languageserver.clojure-lsp.additionalSchemes I think

😮 2
Noah Bogart18:02:06

Woah! Holy crap, okay, I gotta try this

rafaeldelboni19:02:56

You do this in the coc config? Or in the .lsp/config?

herald20:02:19

The coc JSON config

herald17:02:29

@rafaeldelboni do docstrings work for you?

rafaeldelboni19:02:26

Inside lib? Never tried

rafaeldelboni19:02:32

But otherwise yes

herald09:02:03

I'm not getting docstrings for clojure.core stuff. Is your dotfiles public or are you passing anything special to clojure_lsp.setup?

herald09:02:08

Nevermind. It works for a different clojure project, so my config isn’t the issue.

rafaeldelboni11:02:11

Anyway my dotfiles are public if you want to check it out haha https://github.com/rafaeldelboni/dotfiles/tree/master/config/nvim

herald17:02:43

that's what bothers me the most. it works for locally defined functions, but not for clojure.core stuff

herald17:02:43

both things work with python and pyright, so it's definitely clojure-lsp or neovim's integration with it

ericdallo17:02:30

I suspect clojure-lsp is not running on those buffers neovim open when finding a external dep

ericdallo17:02:40

emacs (lsp-mode) does a tricky for this to work as well

ericdallo17:02:46

probably missing this on neovim