Fork me on GitHub
#lsp
<
2022-12-25
>
ericdallo12:12:31

Thank for everyone that helped voting, really excited for 2023 challenges! clojure-lsp gratitude

šŸŽ‰ 10
geraldodev14:12:16

Hi, I have latest clojure-lsp binary on path. I'm using neovim. I have a bb project with the following bb.edn root file {:paths ["bb"]} I have a ~/.lsp/config.edn as {:project-specs [{:project-path "bb.edn" :classpath-cmd ["bb" "print-deps"]}]} :LspInfo on clojure buffer gives me 1 client(s) attached to this buffer: Client: clojure_lsp (id: 2, bufnr: [1, 6]) filetypes: clojure, edn autostart: true root directory: /home/geraldo/projetos/fgts cmd: clojure-lsp 1 active client(s) not attached to this buffer: I'm not getting documentation when I'm calling lua vim.lsp.buf.hover()

ericdallo14:12:50

@U0516053R, clojure-lsp already has good defaults for project-specs, which recognizes bb.edn by default, it should work without that config

ericdallo14:12:05

so the classpath-cmd should be ["bb" "print-deps" "--format" "classpath"] , but I'd suggest not overriding project-specs unless your projects is really that different and need that kind of customization

geraldodev14:12:03

So you are suggesting that I get rid of config.edn because my root is bb.edn already ?

ericdallo14:12:56

yes, clojure-lsp is already smart enough to find that bb.edn at the root and know how to build the classpath without any extra config

geraldodev14:12:53

I did, and the result is the same.

geraldodev14:12:49

1 active client(s) not attached to this buffer: on clojure with :LspInfo

geraldodev14:12:03

Is that relevant ?

ericdallo14:12:50

yes, that means clojure-lsp is not even starting, so not a server issue, but a client one, in this case, some misconfiguration with neovim

geraldodev14:12:55

Thank you, I'll look into it

geraldodev15:12:06

This time I'm using https://raw.githubusercontent.com/neovim/nvim-lspconfig/master/test/minimal_init.lua to troubleshoot . I'm getting : Language client log: /home/geraldo/.local/state/nvim/lsp.log Detected filetype: clojure 1 client(s) attached to this buffer: Only warn on lsplog is : [WARN][2022-12-25 12:08:42] ...lsp/handlers.lua:128 "The language server clojure_lsp triggers a registerCapability handler despite dynamicRegistration set to false. Report upstream, this warning is harmless" There are no ERR It does not show doc for (clojure.core/str)

ericdallo15:12:03

About the warn, sounds like missing checks on nvim, or maybe a outdated nvim.

ericdallo15:12:17

right, so clojure-lsp seems to be starting, now we can debug on server side via this:

geraldodev15:12:46

I'm using last nightly nvim

ericdallo15:12:42

Sorry, I'm no nvim user, so that warning I have no context. about the doc not showing, please follow the troubleshooting I linked

geraldodev15:12:20

Thank you for insights

šŸ‘ 1
ericdallo15:12:47

LMK if the server log helps you

geraldodev15:12:19

I'm trying to use lsp without conjure. Neovim is being bombarded with lua plugins. I'm trying not to use Coc and stick to lsp provided by neovim and its lua plugins...

šŸ‘ 1
ericdallo15:12:19

Sounds like a good start use few plugins and add only what you need

geraldodev20:12:18

only warns on clojure-lsp logs is 2022-12-25T20:17:55.049Z WARN [clojure-lsp.kondo:305] - Non-fatal error from clj-kondo: No configs copied., the hover action takes 9ms, no error, shows nothing I also have DEBUG [clojure-lsp.nrepl:21] - nrepl not found, skipping nrepl server start... I think this is normal because is a bb.edn root project Using clojure-lsp static binary

geraldodev20:12:47

Tryed with vscode calva. It shows no doc like in nvim.

ericdallo20:12:09

Looks correct. Could you share what clojure-lsp version is using?

ericdallo20:12:27

Even in vscode, if you hover your mouse over the string? No popup is show?

geraldodev20:12:16

same output in vscode on mouse hovering

geraldodev20:12:55

and the paste from stdin test is working from troubleshoot

geraldodev20:12:13

clojure-lsp 2022.12.09-15.51.10

ericdallo20:12:48

that's odd, Calva uses latest clojure-lsp and works out of the box, could you: ā€¢ rm .lsp/.cache ā€¢ restart and get server logs The cache removal is only to see the printed classpath during startup

geraldodev21:12:00

That's exactly what I just did, removed -rf .lsp and .clj-kondo and It started to work again. Mutability woes šŸ™‚

geraldodev21:12:09

Thank you for supporting us.

ericdallo21:12:07

Thanks! I'm not aware of any cache issue, we had some of those in the past, but it's been a long time since I didn't see any cache issues, if you find a way to repro the problem LMK so we can try to fix it :)

ericdallo21:12:13

happy coding!

geraldodev21:12:35

I want to use clojure-lsp and fireplace together. With fireplace I'm inside the matrix, with clojure-lsp I'm remotely watching it šŸ™‚

ericdallo21:12:12

I suggest you check some of the features https://clojure-lsp.io/features/, and search how to use it on nvim if you have interest in some of them. I hope to create a nvim tutorial in 2023 šŸ¤ž

geraldodev21:12:08

There are no hover information for def . defn has, def does not

ericdallo21:12:11

that is expected, def is a special symbol and kondo has no analysis for that

ericdallo21:12:28

there are only few symbols special like that, so I think it's not a big deal

geraldodev21:12:42

I suggest you use something like https://github.com/AstroNvim/AstroNvim . It's not intrusive. I've discovered it today. I've used it to troubleshoot clojure-lsp today

ericdallo21:12:13

awesome, I'll certainly try

geraldodev21:12:18

It has Mason, which is a plugin for installing lsp dependencies, just say :Mason and you'll get a nice gui

geraldodev21:12:01

I already has all bindings configured for lsp , if you want to search :Telescope and type keymaps

geraldodev21:12:24

It's a good starting point. And it keeps you from going into the intricacies of nvim configuration

ericdallo21:12:03

that's nice, I use emacs and found really confusing to understand those kind of things when I tried nvim, seems like it needs a lot of setup indeed, something doom-emacs really aim to fix it

geraldodev21:12:36

My guess is, nvim gave new birth to vim with Lua plugins revolution. It's a revolution... I've never used Lua before, It's a simple enough language. You can turn LSP on for it. Very nice one from Brasil my country šŸ™‚

ericdallo21:12:53

makes sense! BTW, I'm Brazilian too ;)

šŸ˜„ 1