nvim: lsp: Non-method client functions are deprecated
We have no idea what non method client functions are or imply in the context of Lua but who cares.
This commit is contained in:
parent
66b7b0ae89
commit
65df9845f7
1 changed files with 6 additions and 6 deletions
|
@ -161,12 +161,12 @@ local on_attach = function(client_id, client, bufnr)
|
||||||
|
|
||||||
for _, mappings in pairs(lsp_key_mappings) do
|
for _, mappings in pairs(lsp_key_mappings) do
|
||||||
local capability, mode, lhs, rhs = unpack(mappings)
|
local capability, mode, lhs, rhs = unpack(mappings)
|
||||||
if client.supports_method(capability) then
|
if client:supports_method(capability) then
|
||||||
vim.api.nvim_buf_set_keymap(bufnr, mode, lhs, rhs, opts)
|
vim.api.nvim_buf_set_keymap(bufnr, mode, lhs, rhs, opts)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
if client.supports_method('textDocument/codeLens') then
|
if client:supports_method('textDocument/codeLens') then
|
||||||
vim.api.nvim_create_autocmd({"CursorHold", "CursorHoldI", "InsertLeave"}, {
|
vim.api.nvim_create_autocmd({"CursorHold", "CursorHoldI", "InsertLeave"}, {
|
||||||
group = lsp_augroup_id,
|
group = lsp_augroup_id,
|
||||||
buffer = bufnr,
|
buffer = bufnr,
|
||||||
|
@ -174,7 +174,7 @@ local on_attach = function(client_id, client, bufnr)
|
||||||
})
|
})
|
||||||
end
|
end
|
||||||
|
|
||||||
if client.supports_method('textDocument/documentHighlight') then
|
if client:supports_method('textDocument/documentHighlight') then
|
||||||
vim.api.nvim_create_autocmd("CursorHold", {
|
vim.api.nvim_create_autocmd("CursorHold", {
|
||||||
group = lsp_augroup_id,
|
group = lsp_augroup_id,
|
||||||
buffer = bufnr,
|
buffer = bufnr,
|
||||||
|
@ -187,7 +187,7 @@ local on_attach = function(client_id, client, bufnr)
|
||||||
})
|
})
|
||||||
end
|
end
|
||||||
|
|
||||||
if client.supports_method('textDocument/inlayHint') then
|
if client:supports_method('textDocument/inlayHint') then
|
||||||
vim.lsp.inlay_hint.enable(false)
|
vim.lsp.inlay_hint.enable(false)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
@ -210,7 +210,7 @@ vim.api.nvim_create_autocmd("LspAttach", {
|
||||||
|
|
||||||
for _, mappings in pairs(lsp_key_mappings) do
|
for _, mappings in pairs(lsp_key_mappings) do
|
||||||
local capability, mode, lhs, rhs = unpack(mappings)
|
local capability, mode, lhs, rhs = unpack(mappings)
|
||||||
if client.supports_method(capability) then
|
if client:supports_method(capability) then
|
||||||
vim.api.nvim_buf_set_keymap(bufnr, mode, lhs, rhs, opts)
|
vim.api.nvim_buf_set_keymap(bufnr, mode, lhs, rhs, opts)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
@ -236,7 +236,7 @@ vim.api.nvim_create_autocmd("LspDetach", {
|
||||||
|
|
||||||
for _, mappings in pairs(lsp_key_mappings) do
|
for _, mappings in pairs(lsp_key_mappings) do
|
||||||
local capability, mode, lhs, _ = unpack(mappings)
|
local capability, mode, lhs, _ = unpack(mappings)
|
||||||
if client.supports_method(capability) then
|
if client:supports_method(capability) then
|
||||||
vim.api.nvim_buf_del_keymap(bufnr, mode, lhs)
|
vim.api.nvim_buf_del_keymap(bufnr, mode, lhs)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in a new issue