nvim/lua/custom/configs/lspconfig.lua

27 lines
650 B
Lua
Raw Normal View History

2024-01-08 19:53:30 +01:00
local on_attach = require("plugins.configs.lspconfig").on_attach
local capabilities = require("plugins.configs.lspconfig").capabilities
local lspconfig = require "lspconfig"
local util = require "lspconfig/util"
lspconfig.gopls.setup{
on_attach = on_attach,
capabilities = capabilities,
cmd = {"gopls"},
filetypes = {"go", "gomod", "gowork", "gotmpl"},
root_dir = util.root_pattern("go.mod", "go.work", ".git"),
settings = {
gopls = {
completeUnimported = true,
usePlaceholders = true,
staticcheck = true,
gofumpt = true,
analyses = {
unusedparams = true,
}
}
}
}
2024-01-12 19:15:02 +01:00
return lspconfig