nvim: lsp: Drop unnecessary if check
This commit is contained in:
parent
00403bafaa
commit
0002d02e6c
1 changed files with 23 additions and 25 deletions
|
@ -160,32 +160,30 @@ local on_attach = function(client, bufnr)
|
||||||
-- Opt out of semantic highlighting
|
-- Opt out of semantic highlighting
|
||||||
client.server_capabilities.semanticTokensProvider = nil
|
client.server_capabilities.semanticTokensProvider = nil
|
||||||
|
|
||||||
if client.server_capabilities.codeLensProvider or client.server_capabilities.documentHighlightProvider then
|
if client.server_capabilities.codeLensProvider then
|
||||||
if client.server_capabilities.codeLensProvider 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,
|
callback = vim.lsp.codelens.refresh,
|
||||||
callback = vim.lsp.codelens.refresh,
|
})
|
||||||
})
|
vim.api.nvim_create_autocmd({"CursorHold", "CursorHoldI"}, {
|
||||||
vim.api.nvim_create_autocmd({"CursorHold", "CursorHoldI"}, {
|
group = lsp_augroup_id,
|
||||||
group = lsp_augroup_id,
|
buffer = bufnr,
|
||||||
buffer = bufnr,
|
callback = lightbulb.update_lightbulb,
|
||||||
callback = lightbulb.update_lightbulb,
|
})
|
||||||
})
|
end
|
||||||
end
|
|
||||||
|
|
||||||
if client.server_capabilities.documentHighlightProvider then
|
if client.server_capabilities.documentHighlightProvider 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,
|
||||||
callback = vim.lsp.buf.document_highlight,
|
callback = vim.lsp.buf.document_highlight,
|
||||||
})
|
})
|
||||||
vim.api.nvim_create_autocmd("CursorMoved", {
|
vim.api.nvim_create_autocmd("CursorMoved", {
|
||||||
group = lsp_augroup_id,
|
group = lsp_augroup_id,
|
||||||
buffer = bufnr,
|
buffer = bufnr,
|
||||||
callback = vim.lsp.buf.clear_references,
|
callback = vim.lsp.buf.clear_references,
|
||||||
})
|
})
|
||||||
end
|
|
||||||
end
|
end
|
||||||
|
|
||||||
inlay_hint.on_attach(client, bufnr)
|
inlay_hint.on_attach(client, bufnr)
|
||||||
|
|
Loading…
Reference in a new issue