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