[ADDED] go lang plugins BASE COPY FROM EXTRAS

This commit is contained in:
Daveanand Mannie
2025-05-08 12:58:10 -04:00
parent 25fe9692ab
commit 17ac18ff29
5 changed files with 86 additions and 7 deletions

View File

@@ -5,6 +5,7 @@ return {
-- python = { "ruff" },
python = { "black" },
javascript = { "biome" },
go = {'goimports', 'gofumpt'}
},
},
dependencies = {

View File

@@ -0,0 +1,64 @@
return {
"neovim/nvim-lspconfig",
opts = {
servers = {
gopls = {
settings = {
gopls = {
gofumpt = true,
codelenses = {
gc_details = false,
generate = true,
regenerate_cgo = true,
run_govulncheck = true,
test = true,
tidy = true,
upgrade_dependency = true,
vendor = true,
},
hints = {
assignVariableTypes = true,
compositeLiteralFields = true,
compositeLiteralTypes = true,
constantValues = true,
functionTypeParameters = true,
parameterNames = true,
rangeVariableTypes = true,
},
analyses = {
nilness = true,
unusedparams = true,
unusedwrite = true,
useany = true,
},
usePlaceholders = true,
completeUnimported = true,
staticcheck = true,
directoryFilters = { "-.git", "-.vscode", "-.idea", "-.vscode-test", "-node_modules" },
semanticTokens = true,
},
},
},
},
setup = {
gopls = function(_, opts)
-- workaround for gopls not supporting semanticTokensProvider
-- https://github.com/golang/go/issues/54531#issuecomment-1464982242
LazyVim.lsp.on_attach(function(client, _)
if not client.server_capabilities.semanticTokensProvider then
local semantic = client.config.capabilities.textDocument.semanticTokens
client.server_capabilities.semanticTokensProvider = {
full = true,
legend = {
tokenTypes = semantic.tokenTypes,
tokenModifiers = semantic.tokenModifiers,
},
range = true,
}
end
end, "gopls")
-- end workaround
end,
},
},
}

View File

@@ -2,15 +2,23 @@ return {
"williamboman/mason.nvim",
opts = {
ensure_installed = {
-- python
"basedpyright",
"biome",
"black",
"lemminx",
"lua-language-server",
"ruby-lsp",
"ruff",
"shfmt",
-- js, json, xml, all front end stuff
"black",
"biome",
"lemminx",
-- lua
"stylua",
"lua-language-server",
--ruby
"ruby-lsp",
-- bash
"shfmt",
-- go
"goimports",
"gofumpt"
},
},
}

View File

@@ -22,7 +22,12 @@ return {
"json",
"html",
--
"ruby"
"ruby",
--
"go",
"gomod",
"gowork",
"gosum",
},
},
},