Neovim-from-scratch icon indicating copy to clipboard operation
Neovim-from-scratch copied to clipboard

Lsp config deprecated setting regarding accessing client.resolved_capabilities setting

Open drusmanbashir opened this issue 2 years ago • 1 comments

On starting neovim 0.8, and after applying lsp related updates in your repo, I still get the following error: error

The is due to the following codeblock in lsp/handlers.lua file:

local function lsp_highlight_document(client)
  -- Set autocommands conditional on server_capabilities
  if **_client.resolved_capabilities._**document_highlight then
    vim.api.nvim_exec(
      [[
      augroup lsp_document_highlight
        autocmd! * <buffer>
        autocmd CursorHold <buffer> lua vim.lsp.buf.document_highlight()
        autocmd CursorMoved <buffer> lua vim.lsp.buf.clear_references()
      augroup END
    ]],
      false
    )
  end
end

drusmanbashir avatar May 11 '22 18:05 drusmanbashir

@drusmanbashir This commit https://github.com/LunarVim/Neovim-from-scratch/pull/144/commits/fc52e86ef482c2db5a7b75707a407730245d3a63 in PR #144 will fix the error if you want to manually edit your handlers.lua

gnmearacaun avatar May 11 '22 19:05 gnmearacaun

There's a simpler fix. Just replace with following: -- if client.resolved_capabilities.document_highlight then if client.server_capabilities.documentHighlightProvider then

Similarly, -- client.resolved_capabilities.document_formatting = false client.server_capabilities.documentFormattingProvider = false

vijayd avatar Oct 05 '22 01:10 vijayd