Closed xuanduc987 closed 1 month ago
Thanks for the PR!
Do you have any reproducible example of when you encounter the error? Documentation of any core functions used in H.get_buf_lsp_clients()
says that it returns "list" (a.k.a. array without holes).
I am not objecting the change per se, as it is cleaner. But having reproducible example will mean the need to add a test.
I'm still on neovim 0.9.4, so H.get_buf_lsp_clients()
will call vim.lsp.buf_get_clients
(returns a map) instead of vim.lsp.get_clients
(returns a list)
I've just tried to change from vim to neovim several days before, so I still don't understand my whole lsp server setting (seems to auto configured with mason?). But I think if we attach several different lsp server for the same file type, then the bug will show up almost surely on neovim version < 0.10
Yeah, I missed that 'mini.statusline' uses vim.lsp.buf_get_clients()
which indeed returns a map.
I've merged this in a temporary branch to polish a bit.
Edit: This should now be a part of main
. Thanks for the quick noticing and fix!
H.get_buf_lsp_clients
will return a map ofclient_id:client
. So if we handle it as array, there could be hole in it, andtable.concat
will fail with "invalid value (nil) at index [i] in table for 'concat'".