Skip to content

Commit 19990c1

Browse files
Follow breaking change for neovim 0.8
Ref: neovim/neovim#17814
1 parent 27cb3e5 commit 19990c1

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

lua/kornicameister/plugins/lsp.lua

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ local on_attach = function(client, bufnr)
3737

3838
-- Conditional capabilities
3939
-- ref: https://github.com/tjdevries/config_manager/blob/0ebe4c3232b61674aad0e4708228797b681fa2a7/xdg_config/nvim/lua/tj/lsp/init.lua#L100
40-
if client.resolved_capabilities.document_highlight then
40+
if client.server_capabilities.documentHighlightProvider then
4141
vim.api.nvim_exec(
4242
[[
4343
augroup lsp_document_highlight
@@ -54,20 +54,20 @@ local on_attach = function(client, bufnr)
5454
local opts = { noremap = true, silent = true }
5555

5656
-- general
57-
if client.resolved_capabilities.rename then
57+
if client.server_capabilities.renameProvider then
5858
buf_set_keymap("n", "<S-r>", "<cmd>lua vim.lsp.buf.rename()<CR>", opts)
5959
end
60-
if client.resolved_capabilities.hover then
60+
if client.server_capabilities.hoverProvider then
6161
buf_set_keymap("n", "?", "<Cmd>lua vim.lsp.buf.hover()<CR>", opts)
6262
end
63-
if client.resolved_capabilities.document_formatting then
63+
if client.server_capabilities.documentFormattingProvider then
6464
if not vim.tbl_contains(vim.tbl_keys(efm_config), client.name) then
6565
print("Using efm instead of " .. client.name .. " for formatting")
66-
client.resolved_capabilities.document_formatting = false
66+
client.server_capabilities.documentFormattingProvider = false
6767
else
6868
end
69-
buf_set_keymap("n", "<S-f>", "<cmd>lua vim.lsp.buf.formatting()<CR>", opts)
70-
vim.cmd("autocmd BufWritePost <buffer> lua vim.lsp.buf.formatting()")
69+
buf_set_keymap("n", "<S-f>", "<cmd>lua vim.lsp.buf.format({async = true}))<CR>", opts)
70+
vim.cmd("autocmd BufWritePost <buffer> lua vim.lsp.buf.format({async = true})")
7171
end
7272

7373
-- issues navigation

0 commit comments

Comments
 (0)