vim

Martynas Maciulevičius 2023-10-26T05:02:56.012589Z

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čius 2023-10-26T05:08:56.717599Z

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čius 2023-10-26T05:17:52.778549Z

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 🤔

ericdallo 2023-10-26T11:55:44.200609Z

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

ericdallo 2023-10-26T11:55:50.703909Z

maybe #vim could help

Martynas Maciulevičius 2023-10-26T11:56:35.878399Z

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 🤔

ericdallo 2023-10-26T11:57:30.728869Z

ops, thought was LSP, sorry :)

ericdallo 2023-10-26T11:57:40.569449Z

yeah. makes sense

ericdallo 2023-10-26T11:58:05.466499Z

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

ericdallo 2023-10-26T11:58:35.275239Z

maybe you could try: .lsp/config.edn

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

Martynas Maciulevičius 2023-10-26T11:59:57.093069Z

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 🤔 I'll try your proposal but I don't expect much.

ericdallo 2023-10-26T12:03:08.281709Z

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

Martynas Maciulevičius 2023-10-26T12:04:16.416739Z

{: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:

ericdallo 2023-10-26T12:06:06.903209Z

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čius 2023-10-26T12:06:41.206179Z

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.

Martynas Maciulevičius 2023-10-26T12:28:43.799169Z

I created this: https://github.com/neovim/neovim/issues/25786

👍 1
timo 2023-10-26T09:54:25.205609Z

timo 2024-01-19T10:52:44.336859Z

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

lispyclouds 2023-10-26T10:03:30.934639Z

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?

lispyclouds 2023-10-26T10:05:48.985029Z

and does this only happen with clojure files?

timo 2023-10-26T10:08:59.925509Z

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

timo 2023-10-26T10:09:12.910979Z

I installed with mason

lispyclouds 2023-10-26T10:10:11.003699Z

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

timo 2023-10-26T10:10:12.365129Z

in python it looks good

timo 2023-10-26T10:10:32.654109Z

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

lispyclouds 2023-10-26T10:10:49.137189Z

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

timo 2023-10-26T10:11:31.179429Z

actually two 😕

lispyclouds 2023-10-26T10:11:54.470779Z

well feels like some autocommnd is doing something more somewhere

timo 2023-10-26T10:12:27.962289Z

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

lispyclouds 2023-10-26T10:13:34.437929Z

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

timo 2023-10-26T10:13:55.487619Z

I already removed it and it seems like no changes

lispyclouds 2023-10-26T10:15:18.864529Z

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

timo 2023-10-26T10:22:34.523099Z

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

lispyclouds 2023-10-26T10:28:58.493669Z

not sure if these could be the thing: https://github.com/TimoKramer/dotfiles/blob/stow/nvim/.config/nvim/lua/kickstart/plugins/clojure.lua#L24-L25

lispyclouds 2023-10-26T10:29:48.057769Z

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

timo 2023-10-26T10:30:05.463889Z

yeah, looks good now

timo 2023-10-26T10:30:15.934089Z

thank you once again:)

lispyclouds 2023-10-26T10:30:31.535029Z

nice, all gut feelings on this one 😛

timo 2023-10-26T10:30:36.889319Z

haha

borkdude 2023-10-26T10:33:02.085279Z

🎉

lispyclouds 2023-10-27T06:46:22.510019Z

@timok 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