nvim-neo-tree / neo-tree.nvim

Neovim plugin to manage the file system and other tree like structures.
MIT License
3.78k stars 219 forks source link

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

Open andrevmatos opened 1 month ago

andrevmatos commented 1 month ago

Did you check docs and existing issues?

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: https://github.com/nvim-neo-tree/neo-tree.nvim/blob/206241e451c12f78969ff5ae53af45616ffc9b72/lua/neo-tree/sources/document_symbols/lib/symbols_utils.lua#L173

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
Zeioth commented 5 days ago

@andrevmatos Was this fixed already? I don't get that warning in https://github.com/nvim-neo-tree/neo-tree.nvim/issues/1588

andrevmatos commented 4 days ago

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 commented 4 days ago

@andrevmatos are you on the latest commit? This is what I get: https://github.com/nvim-neo-tree/neo-tree.nvim/issues/1588#issuecomment-2416629771