[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

@@ -19,6 +19,7 @@ require("lazy").setup({
{ "LazyVim/LazyVim", import = "lazyvim.plugins" }, { "LazyVim/LazyVim", import = "lazyvim.plugins" },
{ import = "plugins" }, { import = "plugins" },
{ import = "plugins.langs.python" }, { import = "plugins.langs.python" },
{ import = "plugins.langs.go" },
}, },
defaults = { defaults = {
-- By default, only LazyVim plugins will be lazy-loaded. Your custom plugins will load during startup. -- By default, only LazyVim plugins will be lazy-loaded. Your custom plugins will load during startup.

View File

@@ -5,6 +5,7 @@ return {
-- python = { "ruff" }, -- python = { "ruff" },
python = { "black" }, python = { "black" },
javascript = { "biome" }, javascript = { "biome" },
go = {'goimports', 'gofumpt'}
}, },
}, },
dependencies = { 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", "williamboman/mason.nvim",
opts = { opts = {
ensure_installed = { ensure_installed = {
-- python
"basedpyright", "basedpyright",
"biome",
"black",
"lemminx",
"lua-language-server",
"ruby-lsp",
"ruff", "ruff",
"shfmt", -- js, json, xml, all front end stuff
"black",
"biome",
"lemminx",
-- lua
"stylua", "stylua",
"lua-language-server",
--ruby
"ruby-lsp",
-- bash
"shfmt",
-- go
"goimports",
"gofumpt"
}, },
}, },
} }

View File

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