neovim: go inlay hints, codelens and stuff

This commit is contained in:
2023-11-17 19:54:54 +03:00
parent 665552ff21
commit 63d9dfb769
3 changed files with 45 additions and 14 deletions

View File

@@ -57,6 +57,10 @@ local function on_attach(client, bufnr)
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.server_capabilities.inlayHintProvider then
vim.lsp.inlay_hint.enable(bufnr, true)
end
end
vim.keymap.set("n", "<leader>ee", function()
@@ -84,21 +88,13 @@ for _, server in ipairs(servers) do
opts.filetypes = { "html", "css", "scss", "javascripreact", "typescriptreact", "astro" }
end
if server == "tsserver" then
if server == "gopls" then
-- https://github.com/golang/tools/blob/master/gopls/doc/settings.md
opts.settings = {
tsserver = {
experimental = {
enableProjectDiagnostics = true,
},
javascript = {
format = {
enable = false,
},
},
typescript = {
format = {
enable = false,
},
gopls = {
linksInHover = true,
hints = {
constantValues = true,
},
},
}