Skip to content

Conversation

leeguooooo
Copy link

@leeguooooo leeguooooo commented Jun 17, 2025

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() with client:supports_method()
  • Replace client.request() with client:request()
  • Replace client.request_sync() with client:request_sync()

Backwards Compatibility ✅

This change is fully backwards compatible and requires no version checks:

  • Lua syntax sugar: client:method() is identical to client.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

  • All existing functionality remains unchanged
  • No more deprecation warnings in Neovim 0.11+
  • All modified files verified to use new syntax consistently
  • Backwards compatibility verified on Neovim 0.11.1

Closes #1543

@leeguooooo leeguooooo force-pushed the fix-client-method-deprecations branch 2 times, most recently from 57c0a13 to 4fecd20 Compare June 17, 2025 06:12
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
@leeguooooo leeguooooo force-pushed the fix-client-method-deprecations branch from 4fecd20 to 62efbee Compare June 17, 2025 06:21
@HendrikPetertje
Copy link
Contributor

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

@Ghasak
Copy link

Ghasak commented Aug 8, 2025

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

@HendrikPetertje
Copy link
Contributor

turning off deprecations warnings, defeats the entire purpose of running with neovim:master builds.

Copy link

@kellerben kellerben left a 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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

client.supports_method is deprecated

4 participants