nvim: lsp: Enable document highlight only when supported
This commit is contained in:
parent
5716ca88af
commit
b41584d996
1 changed files with 5 additions and 2 deletions
|
@ -114,8 +114,11 @@ local on_attach = function(client, bufnr)
|
|||
vim.api.nvim_command [[autocmd CursorHold,CursorHoldI,InsertLeave <buffer> lua vim.lsp.codelens.refresh()]]
|
||||
end
|
||||
|
||||
if client.resolved_capabilities.document_highlight then
|
||||
vim.api.nvim_command [[autocmd CursorHold <buffer> lua vim.lsp.buf.document_highlight()]]
|
||||
vim.api.nvim_command [[autocmd CursorMoved,InsertEnter <buffer> lua vim.lsp.buf.clear_references()]]
|
||||
vim.api.nvim_command [[autocmd CursorHoldI <buffer> lua vim.lsp.buf.document_highlight()]]
|
||||
vim.api.nvim_command [[autocmd CursorMoved <buffer> lua vim.lsp.buf.clear_references()]]
|
||||
end
|
||||
|
||||
protocol.CompletionItemKind = {
|
||||
' '; -- text
|
||||
|
|
Loading…
Reference in a new issue