fixed deprecated resolved_capabilities

This commit is contained in:
Oliver Hartmann 2022-06-26 13:15:47 +02:00
parent 37b7a68c45
commit 3a0e386252

View File

@ -61,15 +61,15 @@ local on_attach = function(client, bufnr)
vim.cmd([[autocmd CursorHold <buffer> lua OpenDiagFloat()]])
-- Set some keybinds conditional on server capabilities
if client.resolved_capabilities.document_formatting then
if client.server_capabilities.documentFormattingProvider then
buf_set_keymap('n', '<space>f', '<cmd>lua vim.lsp.buf.formatting()<CR>', opts)
end
if client.resolved_capabilities.document_range_formatting then
if client.server_capabilities.documentRangeFormattingProvider then
buf_set_keymap('v', '<space>f', '<esc><cmd>lua vim.lsp.buf.range_formatting()<CR>', opts)
end
-- Set autocommands conditional on server_capabilities
if client.resolved_capabilities.document_highlight then
if client.server_capabilities.document_highlight then
vim.api.nvim_exec(
[[
hi LspReferenceRead cterm=bold ctermbg=red guibg=DarkGreen