Skip to content

BUG: vim.lsp.get_active_clients() deprecated #1551

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

Closed
3 tasks done
andrevmatos opened this issue Aug 27, 2024 · 3 comments · Fixed by #1645
Closed
3 tasks done

BUG: vim.lsp.get_active_clients() deprecated #1551

andrevmatos opened this issue Aug 27, 2024 · 3 comments · Fixed by #1645
Labels
bug Something isn't working

Comments

@andrevmatos
Copy link

Did you check docs and existing issues?

  • I have read all the docs.
  • I have searched the existing issues.
  • I have searched the existing discussions.

Neovim Version (nvim -v)

v0.11.0-nightly+cf44121

Operating System / Version

NixOS unstable

Describe the Bug

vim.lsp.get_active_clients() function is deprecated in nvim v0.11 nightly and will be removed in v0.12
We should use vim.lsp.get_clients() instead.
Usage here:

for _, client in pairs(vim.lsp.get_active_clients({ bufnr = bufnr })) do

Screenshots, Traceback

vim.deprecated: require("vim.deprecated.health").check()

 ~
- WARNING vim.lsp.get_active_clients() is deprecated. Feature will be removed in Nvim 0.12
  - ADVICE:
    - use vim.lsp.get_clients() instead.
    - stack traceback:
        /nix/store/c7cmdj1s31jyljw4yacfnq8i05lxc7dp-vim-pack-dir/pack/myNeovimPackages/start/neo-tree.nvim/lua/neo-tree/sources/document_symbols/lib/symbols_utils.lua:173
        /nix/store/c7cmdj1s31jyljw4yacfnq8i05lxc7dp-vim-pack-dir/pack/myNeovimPackages/start/neo-tree.nvim/lua/neo-tree/sources/document_symbols/init.lua:67
        /nix/store/c7cmdj1s31jyljw4yacfnq8i05lxc7dp-vim-pack-dir/pack/myNeovimPackages/start/neo-tree.nvim/lua/neo-tree/sources/manager.lua:493
        /nix/store/c7cmdj1s31jyljw4yacfnq8i05lxc7dp-vim-pack-dir/pack/myNeovimPackages/start/neo-tree.nvim/lua/neo-tree/command/init.lua:204
        /nix/store/c7cmdj1s31jyljw4yacfnq8i05lxc7dp-vim-pack-dir/pack/myNeovimPackages/start/neo-tree.nvim/lua/neo-tree/command/init.lua:162
        /nix/store/c7cmdj1s31jyljw4yacfnq8i05lxc7dp-vim-pack-dir/pack/myNeovimPackages/start/neo-tree.nvim/lua/neo-tree/command/init.lua:170
        lua:1

Steps to Reproduce

  1. run neo-tree with nvim nightly and try to open a Symbols panel

Expected Behavior

It works with latest APIs

Your Configuration

no config needed
@andrevmatos andrevmatos added the bug Something isn't working label Aug 27, 2024
@Zeioth
Copy link

Zeioth commented Oct 16, 2024

@andrevmatos Was this fixed already? I don't get that warning in #1588

@andrevmatos
Copy link
Author

The message isn't being shown in the command line, but :checkhealth vim.deprecated still shows that same warning, so this is still valid on current master, although I haven't tested on that PR

@Zeioth
Copy link

Zeioth commented Oct 17, 2024

@andrevmatos are you on the latest commit? This is what I get:
#1588 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants