freddiehaddad / feline.nvim

A minimal, stylish and customizable statusline, statuscolumn, and winbar for Neovim
GNU General Public License v3.0
310 stars 10 forks source link

bug: Deprecation of `vim.lsp.get_active_clients()` in NVIM 0.11.0-dev #88

Closed ArvinSKushwaha closed 5 months ago

ArvinSKushwaha commented 5 months ago

Did you check docs and existing issues?

Neovim version (nvim -v)

NVIM v0.11.0-dev-164+g3a1515bfee

Operating system/version

Arch Linux

Describe the bug

Deprecation of vim.lsp.get_active_clients(). The fix is just one line, swapping the get_active_clients function for get_clients and leaving the parameters unchanged, it seems.

Steps To Reproduce

  1. Open neovim
  2. Observe warning (as elaborated on below)
vim.lsp.get_active_clients() is deprecated. Run ":checkhealth vim.deprecated" for more information

Which leads to the following:


 ~
- 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:
        /home/<user_name>/.local/share/nvim/lazy/catppuccin/lua/catppuccin/groups/integrations/feline.lua:415
        /home/<user_name>/.local/share/nvim/lazy/feline.nvim/lua/feline/generator.lua:301
        /home/<user_name>/.local/share/nvim/lazy/feline.nvim/lua/feline/generator.lua:447
        [C]:-1
        /home/<user_name>/.local/share/nvim/lazy/feline.nvim/lua/feline/generator.lua:498
        /home/<user_name>/.local/share/nvim/lazy/feline.nvim/lua/feline/generator.lua:615
    - stack traceback:
        /home/<user_name>/.local/share/nvim/lazy/catppuccin/lua/catppuccin/groups/integrations/feline.lua:415
        /home/<user_name>/.local/share/nvim/lazy/feline.nvim/lua/feline/generator.lua:301
        /home/<user_name>/.local/share/nvim/lazy/feline.nvim/lua/feline/generator.lua:447
        [C]:-1
        /home/<user_name>/.local/share/nvim/lazy/feline.nvim/lua/feline/generator.lua:498
        /home/<user_name>/.local/share/nvim/lazy/feline.nvim/lua/feline/generator.lua:615
        [C]:-1
        /usr/share/nvim/runtime/lua/vim/health.lua:353
        nvim>:1

Expected Behavior

  1. Open neovim
  2. No warning

Repro

No response

freddiehaddad commented 5 months ago

@ArvinSKushwaha Are you certain you're using the latest version of feline? I'm not getting this error.

There's a check in the code:


    if vim.fn.has('nvim-0.10') > 0 then
        return next(lsp.get_clients { bufnr = 0 }) ~= nil
    else
        ---@diagnostic disable-next-line: deprecated
        return next(lsp.get_active_clients { bufnr = 0 }) ~= nil
    end
``
ArvinSKushwaha commented 5 months ago

Haha, I just realized the error is in the Catppuccin plugin, sorry!