-
-
Notifications
You must be signed in to change notification settings - Fork 298
fix: replace deprecated LSP client method calls with colon syntax #1546
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
fix: replace deprecated LSP client method calls with colon syntax #1546
Conversation
4fecd20 to
62efbee
Compare
|
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 -- 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. |
kellerben
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks good and should be merged to upstream
|
why hasn't this been merged? |
Replaces deprecated dot notation with colon notation for LSP client methods: - client.supports_method() → client:supports_method() - client.request() → client:request() - client.request_sync() → client:request_sync() This addresses deprecation warnings in Neovim 0.11+ as documented in :help deprecated.txt Backwards compatible: Colon syntax is just Lua syntactic sugar supported since Neovim 0.5+. No functionality changes, only modernized syntax. Fixes: nvimdev#1543
62efbee to
4173557
Compare
Update
Key implementationlocal function client_method_wrapper(client, name, ...)
if vim.version().minor >= 11 then
return client[name](client, ...)
end
return client[name](...)
endTouched areas
|
|
why support 0.10 at all? Neovim stable which is available through package managers, cached repos and the likes sits at 0.11.5. |
|
lint fix and only support 0.11 should be fine . |
Summary
This PR fixes deprecation warnings in Neovim 0.11+ by replacing deprecated LSP client method calls with the new colon syntax.
Changes
client.supports_method()withclient:supports_method()client.request()withclient:request()client.request_sync()withclient:request_sync()Backwards Compatibility ✅
This change is fully backwards compatible and requires no version checks:
client:method()is identical toclient.method(client, ...)- just cleaner syntaxFiles Modified
lua/lspsaga/codeaction/lightbulb.lualua/lspsaga/symbol/head.lualua/lspsaga/symbol/init.lualua/lspsaga/util.lualua/lspsaga/typehierarchy.lualua/lspsaga/codeaction/init.lualua/lspsaga/callhierarchy.lualua/lspsaga/implement/init.luaBackground
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:
Test Plan
Closes #1543