neovim: enable codelens if lsp client supports it
This commit is contained in:
@@ -54,6 +54,11 @@ vim.api.nvim_create_autocmd("LspAttach", {
|
||||
if not vim.lsp.buf.range_code_action == nil then
|
||||
vim.keymap.set("v", "<leader>.", vim.lsp.buf.range_code_action, opts)
|
||||
end
|
||||
|
||||
if client and client:supports_method("textDocument/codeLens") then
|
||||
vim.lsp.codelens.enable(true, { bufnr = ev.buf })
|
||||
vim.keymap.set("n", "<leader>c", vim.lsp.codelens.run, opts)
|
||||
end
|
||||
end,
|
||||
})
|
||||
|
||||
|
||||
@@ -7,6 +7,9 @@ vim.lsp.config.gopls = {
|
||||
root_markers = root_markers,
|
||||
settings = {
|
||||
gopls = {
|
||||
codelenses = {
|
||||
test = true,
|
||||
},
|
||||
linksInHover = true,
|
||||
usePlaceholders = false, -- just to ensure it's off, incase in the future go team decides to toggle it on by default
|
||||
completeUnimported = true,
|
||||
|
||||
Reference in New Issue
Block a user