Skip to content

Conversation

@jrentlez
Copy link
Contributor

This PR fixes the calls to vim.lsp.Client.supports_method(). The : automatically passes client as the first parameter.


NOTE
Please verify that the base repository above has the intended destination!
Github by default opens Pull Requests against the parent of a forked repository.
If this is your personal fork and you didn't intend to open a PR for contribution
to the original project then adjust the base repository accordingly.


@feoh
Copy link
Collaborator

feoh commented Feb 17, 2025

Awesome thanks for the fix! Merging.

@feoh feoh merged commit db78c0b into nvim-lua:master Feb 17, 2025
1 check passed
@glaulher
Copy link

glaulher commented Feb 25, 2025

for me it gave a typing alert and null. I needed to correct it as follows:

 if client ~= nil and client.supports_method ~= nil and client:supports_method(vim.lsp.protocol.Methods.textDocument_documentHighlight) then
            local highlight_augroup = vim.api.nvim_create_augroup('kickstart-lsp-highlight', { clear = false })
            vim.api.nvim_create_autocmd({ 'CursorHold', 'CursorHoldI' }, {
              buffer = event.buf,
              group = highlight_augroup,
              callback = vim.lsp.buf.document_highlight,
            })


here too:

if client ~= nil and client.supports_method ~= nil and client:supports_method(vim.lsp.protocol.Methods.textDocument_inlayHint) then
            map('<leader>th', function()
              vim.lsp.inlay_hint.enable(not vim.lsp.inlay_hint.is_enabled { bufnr = event.buf })
            end, '[T]oggle Inlay [H]ints')
          end
        end,
      })


@moustario moustario mentioned this pull request Dec 3, 2025
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.

3 participants