nvim: lsp: Enable code lens support

Relevant PR
https://github.com/neovim/neovim/pull/13165
This commit is contained in:
Sanchayan Maity 2021-06-15 09:40:18 +05:30
parent 2fcdea1cb2
commit 7fb370f824
1 changed files with 5 additions and 0 deletions

View File

@ -89,6 +89,11 @@ local on_attach = function(client, bufnr)
vim.api.nvim_buf_set_keymap(bufnr, 'n', 'gq', '<cmd>lua vim.lsp.buf.formatting()<CR>', opts)
end
if client.resolved_capabilities.code_lens then
vim.api.nvim_buf_set_keymap(bufnr, "n", "gl", "<cmd>lua vim.lsp.codelens.run()<CR>", opts)
vim.api.nvim_command [[autocmd CursorHold,CursorHoldI,InsertLeave <buffer> lua vim.lsp.codelens.refresh()]]
end
protocol.CompletionItemKind = {
''; -- text
''; -- method