-
-
Notifications
You must be signed in to change notification settings - Fork 8
Description
Replace deprecated vim.lsp.client_is_stopped() with vim.lsp.get_client_by_id()
Description
I am currently switched to NVIM v0.12.0-dev-949+g5f9f706462 and got a deprecation warning as:
The plugin is using the deprecated vim.lsp.client_is_stopped() function which will be removed in Nvim 0.14. This is causing deprecation warnings during normal usage.
Error/Warning Message
⚠️ WARNING vim.lsp.client_is_stopped() is deprecated. Feature will be removed in Nvim 0.14
- ADVICE:
- use vim.lsp.get_client_by_id() instead.
Stack Trace
The deprecation warning is triggered from multiple locations in the codebase:
stack traceback:
~/.local/share/nvim/lazy/lsp-progress.nvim/lua/lsp-progress.lua:137
~/.local/share/nvim/lazy/lsp-progress.nvim/lua/lsp-progress.lua:186
~/.local/share/nvim/lazy/lsp-progress.nvim/lua/lsp-progress.lua:272
[C]:-1
/usr/local/share/nvim/runtime/lua/vim/lsp/handlers.lua:82
/usr/local/share/nvim/runtime/lua/vim/lsp/client.lua:1159
/usr/local/share/nvim/runtime/lua/vim/lsp/client.lua:445
vim/_editor.lua:0
stack traceback:
~/.local/share/nvim/lazy/lsp-progress.nvim/lua/lsp-progress.lua:137
~/.local/share/nvim/lazy/lsp-progress.nvim/lua/lsp-progress.lua:64
vim/_editor.lua:0
vim/_editor.lua:0
Expected Behavior
The plugin should use the recommended vim.lsp.get_client_by_id() function instead of the deprecated vim.lsp.client_is_stopped() to avoid deprecation warnings and ensure compatibility with future Neovim versions.
Affected Files
Based on the stack trace, the following files need to be updated:
lua/lsp-progress.lua(line 137, called from lines 64, 186, and 272)
Environment
- Neovim version: 0.10+ (with deprecation warnings enabled)
- Plugin: lsp-progress.nvim
Additional Context
This change is necessary to maintain compatibility with Neovim 0.14 when the deprecated function is removed. The migration should be straightforward as per Neovim's advice to use vim.lsp.get_client_by_id() instead.