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
|
if not vim.lsp.buf.range_code_action == nil then
|
||||||
vim.keymap.set("v", "<leader>.", vim.lsp.buf.range_code_action, opts)
|
vim.keymap.set("v", "<leader>.", vim.lsp.buf.range_code_action, opts)
|
||||||
end
|
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,
|
end,
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|||||||
@@ -7,6 +7,9 @@ vim.lsp.config.gopls = {
|
|||||||
root_markers = root_markers,
|
root_markers = root_markers,
|
||||||
settings = {
|
settings = {
|
||||||
gopls = {
|
gopls = {
|
||||||
|
codelenses = {
|
||||||
|
test = true,
|
||||||
|
},
|
||||||
linksInHover = true,
|
linksInHover = true,
|
||||||
usePlaceholders = false, -- just to ensure it's off, incase in the future go team decides to toggle it on by default
|
usePlaceholders = false, -- just to ensure it's off, incase in the future go team decides to toggle it on by default
|
||||||
completeUnimported = true,
|
completeUnimported = true,
|
||||||
|
|||||||
Reference in New Issue
Block a user