kosayoda / nvim-lightbulb

VSCode 💡 for neovim's built-in LSP.
MIT License
769 stars 24 forks source link

get_active_clients is deprecated in nvim 0.10 #65

Open seocamo opened 3 months ago

seocamo commented 3 months ago

NeoVim Version NVIM v0.11.0-dev-45+g879d17ea8 Build type: RelWithDebInfo LuaJIT 2.1.1713484068 Run "nvim -V1 -v" for more info

Describe the bug get_activeclients is deprecated in version 0.10 and will be remove in 0.12, so it call notify and make popups. the problem is on line 237 `for , client in pairs(vim.lsp.get_active_clients({ bufnr = bufnr })) do` in init.lua

have to fix replace vim.lsp.get_active_clients with (nvim.lsp.get_clients or vim.lsp.get_active_clients) with the () is important as it will pick the new get_clients if found ellers fall back on the old get_active_clients for old versions.

so the line should look like this for _, client in pairs((nvim.lsp.get_clients or vim.lsp.get_active_clients)({ bufnr = bufnr })) do for init.lua:237 and for _, client in pairs((nvim.lsp.get_clients or vim.lsp.get_active_clients)({ bufnr = bufnr })) do for init.lua:346

thanks for a great plugin.

aarondill commented 3 months ago

62 (and it's duplicate #64) is an already submitted patch to fix this. It seems that we're just waiting for the maintainer to merge it.