all repos

init.lua @ 7776044d816849022d903bb49571e4d017cd5faa

my nvim config
2 files changed, 13 insertions(+), 0 deletions(-)
feat(lsp): add codelense setup
Author: Smirnov Oleksandr ss2316544@gmail.com
Committed at: 2022-10-29 22:40:32 +0300
Parent: b27e775
M lua/configs/lsp/attach.lua

@@ -11,6 +11,10 @@ common = function(client, bufnr)

vim.api.nvim_buf_set_option(bufnr, "omnifunc", "v:lua.vim.lsp.omnifunc") client.server_capabilities.documentFormattingProvider = false + if client.name == "gopls" then + vim.lsp.codelens.refresh() + end + map("K", vim.lsp.buf.hover) map("gd", "<cmd>Telescope lsp_definitions<cr>") map("gD", vim.lsp.buf.declaration)

@@ -23,6 +27,7 @@ map("<leader>la", vim.lsp.buf.code_action)

map("<leader>lr", vim.lsp.buf.rename) map("<leader>lf", "<cmd>lua vim.lsp.buf.format {async = true}<cr>") map("<leader>ls", "<cmd>Telescope lsp_document_symbols<cr>") + map("<leader>ll", vim.lsp.codelens.run) map("]d", vim.diagnostic.goto_next) map("[d", vim.diagnostic.goto_prev) end,
M lua/configs/lsp/servers.lua

@@ -5,6 +5,8 @@ settings = {

gopls = { linksInHover = false, staticcheck = true, + gofumpt = true, + usePlaceholders = true, analyses = { unusedparams = true, unreachable = true }, hints = { assignVariableTypes = true,

@@ -13,6 +15,12 @@ constantValues = true,

functionTypeParameters = true, parameterNames = true, rangeVariableTypes = true, + }, + codelenses = { + generate = false, + gc_details = true, + test = true, + tidy = true, }, }, },