Skip to content
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

fix: specify buffer manually #445

Closed
wants to merge 3 commits into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion lua/go/codelens.lua
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ function M.refresh()
if _GO_NVIM_CFG.lsp_codelens == true then
local found = false
if not found then
for _, lsp in pairs(vim.lsp.get_active_clients()) do
for _, lsp in pairs(vim.lsp.buf_get_clients(0)) do
Copy link
Owner

@ray-x ray-x Mar 25, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

buf_get_clients is deprecated since nvim 0.9.x
You can add a filter to get_active_clients

get_active_clients({filter})                    *vim.lsp.get_active_clients()*
    Get active clients.

    Parameters:  
      • {filter}  (table|nil) A table with key-value pairs used to filter the
                  returned clients. The available keys are:
                  • id (number): Only return clients with the given id
                  • bufnr (number): Only return clients attached to this
                    buffer
                  • name (string): Only return clients with the given name

if lsp.name == 'gopls' then
found = true
break
Expand Down
Loading