add document_highlight autocmds only if lsp supports it
This commit is contained in:
@@ -147,11 +147,13 @@ local on_attach = function(client, bufnr)
|
|||||||
client.resolved_capabilities.document_range_formatting = false
|
client.resolved_capabilities.document_range_formatting = false
|
||||||
end
|
end
|
||||||
|
|
||||||
vim.cmd([[
|
if client.resolved_capabilities.document_highlight then
|
||||||
autocmd CursorHold <buffer> lua vim.lsp.buf.document_highlight()
|
vim.cmd([[
|
||||||
autocmd CursorHoldI <buffer> lua vim.lsp.buf.document_highlight()
|
autocmd CursorHold <buffer> lua vim.lsp.buf.document_highlight()
|
||||||
autocmd CursorMoved <buffer> lua vim.lsp.buf.clear_references()
|
autocmd CursorHoldI <buffer> lua vim.lsp.buf.document_highlight()
|
||||||
]])
|
autocmd CursorMoved <buffer> lua vim.lsp.buf.clear_references()
|
||||||
|
]])
|
||||||
|
end
|
||||||
|
|
||||||
require("lsp_signature").on_attach({
|
require("lsp_signature").on_attach({
|
||||||
bind = true,
|
bind = true,
|
||||||
|
|||||||
Reference in New Issue
Block a user