[ADDED] go lang plugins BASE COPY FROM EXTRAS
This commit is contained in:
@@ -5,6 +5,7 @@ return {
|
||||
-- python = { "ruff" },
|
||||
python = { "black" },
|
||||
javascript = { "biome" },
|
||||
go = {'goimports', 'gofumpt'}
|
||||
},
|
||||
},
|
||||
dependencies = {
|
||||
|
||||
64
lua/plugins/langs/go/nvim-lspconfig.lua
Normal file
64
lua/plugins/langs/go/nvim-lspconfig.lua
Normal 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,
|
||||
},
|
||||
},
|
||||
}
|
||||
@@ -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"
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
@@ -22,7 +22,12 @@ return {
|
||||
"json",
|
||||
"html",
|
||||
--
|
||||
"ruby"
|
||||
"ruby",
|
||||
--
|
||||
"go",
|
||||
"gomod",
|
||||
"gowork",
|
||||
"gosum",
|
||||
},
|
||||
},
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user