Fork me on GitHub
#vim
<
2023-10-26
>
Martynas Maciulevičius05:10:56

When I use nvim and LSP to jump to a definition of Clojure core function then it wants to jump into a zipfile. And then I get an error that says that it can't run vim.schedule callback for "zipfile:*/*". I use nvim and deps.edn for my project. What does it mean? Screenshot (my cursor is on the re-find and I run vim.lsp.buf.definition LSP command):

Martynas Maciulevičius05:10:56

If I jump the first time (buffer isn't in memory) then It does open the buffer on the first line. If buffer is already loaded then it jumps into the proper line of the function definition. In both cases the syntax highlighting is not present. Screenshot when jumping the first time:

Martynas Maciulevičius05:10:52

If I run :filetype detect then the highlighting gets enabled for the zipfile clj buffer. But this should run by default and also the jump should be correct from the start :thinking_face:

ericdallo11:10:44

I don't know, but looks like this vim.schedule doesn't understand zipfile which is what we use for dependencies

ericdallo11:10:50

maybe #C0DF8R51A could help

Martynas Maciulevičius11:10:35

This is #vim ;D But thanks for replying 😉 I suspected that LSP has nothing to do with it so I decided not to post in LSP :thinking_face:

ericdallo11:10:30

ops, thought was LSP, sorry :)

ericdallo11:10:40

yeah. makes sense

ericdallo11:10:05

I wish we could drop zipfile for nvim... clojure-lsp only supports for nvim users but IMO it brings more issues than solutions

ericdallo11:10:35

maybe you could try: .lsp/config.edn

{:dependency-scheme "jar"} 
and see what happens

Martynas Maciulevičius11:10:57

But I get the jump. The editor jumps into the file already. It's just that autocommands don't execute for the file in the zipfile, I think :thinking_face: I'll try your proposal but I don't expect much.

ericdallo12:10:08

since we will be changing the scheme to jarfile, maybe that could play well with vi.schedule or so you know

Martynas Maciulevičius12:10:16

{:dependency-scheme "jar"} I tried it and it doesn't seem to jump into the definition at all. I get this message and later an empty buffer. I think that the scheme is correct and this is an issue with the zipfile handling. Image:

ericdallo12:10:06

yeah it's probably that. ah, I thought we just setting the dependency-scheme to jar would be enough but it seems we need more changes to make nvim understand that for find-definition works

Martynas Maciulevičius12:10:41

Additional thing that I found and didn't share. If I jump into the zipfile twice then it jumps into the line properly (using no config as in the beginning). And if I execute :filetype detect then it also enables LSP and all highlighting.

lispyclouds10:10:30

Hey Timo! Did you make any further changes on top of kickstart? something like install some more linter plugins like nvim-lint/null-ls or something?

lispyclouds10:10:48

and does this only happen with clojure files?

timo10:10:59

I can not think of anything like null-ls that I added. It only happens with clojure files.

timo10:10:12

I installed with mason

lispyclouds10:10:11

having not used mason, not sure why there are 2 clojure_lsps

timo10:10:12

in python it looks good

timo10:10:32

yeah, looks like in mason there are two messages as well

lispyclouds10:10:49

If you do :LspInfo on the clojure file, how many are attached to the buffer?

timo10:10:31

actually two 😕

lispyclouds10:10:54

well feels like some autocommnd is doing something more somewhere

timo10:10:27

alright, thanks mate. will be going through my stuff again

lispyclouds10:10:34

do you also have clojure lsp installed by yourself? if yes, what happens when you remove that?

timo10:10:55

I already removed it and it seems like no changes

lispyclouds10:10:18

gut feeling is the nvim-lspconfig is launching it and mason is doing it again maybe? not sure.

timo10:10:34

interesting, when commenting out https://github.com/TimoKramer/dotfiles/blob/stow/nvim/.config/nvim/lua/kickstart/plugins/clojure.lua it works fine. something is triggering a second start of lsp

lispyclouds10:10:48

not sure if they are needed, maybe causing the extra buffers and lsp

timo10:10:05

yeah, looks good now

timo10:10:15

thank you once again:)

lispyclouds10:10:31

nice, all gut feelings on this one 😛

lispyclouds06:10:22

@U4GEXTNGZ im doing similar things as you in my https://github.com/lispyclouds/dotfiles/blob/main/nvim/lua/plugins/lisp.lua#L7 too but without any of the requires. does the thing i want it to; not sure why the requires are needed? also i have a augroup for the autocmd which makes sure it cleans up the older autocmds with new buffers. maybe that makes any difference? like Olical said on the issue, something weird is happening

👍 1
timo10:01:44

FYI pretty sure it's got to do with my polylith monorepo setup which has multiple deps.edn files