diff --git a/init.lua b/init.lua index b637b540..e796eb69 100644 --- a/init.lua +++ b/init.lua @@ -650,7 +650,41 @@ require('lazy').setup({ -- For example, to see the options for `lua_ls`, you could go to: https://luals.github.io/wiki/settings/ local servers = { -- clangd = {}, - -- gopls = {}, + gopls = { + settings = { + gopls = { + gofumpt = true, + codelenses = { + gc_details = false, + generate = true, + regenerate_cgo = true, + test = true, + tidy = true, + upgrade_dependency = true, + vendor = true, + }, + hints = { + assignVariableTypes = true, + compositeLiteralFields = true, + constantValues = true, + functionTypeParameters = true, + parameterNames = true, + rangeVariableTypes = true, + }, + analyses = { + fieldalignment = true, + nilness = true, + unusedparams = true, + unusedwrite = true, + useany = true, + }, + usePlaceholders = true, + completeUnimported = true, + staticcheck = true, + directoryFilters = { '-.git', '-.vscode', '-.idea', '-.vscode-test', '-node_modules' }, + }, + }, + }, -- pyright = {}, -- rust_analyzer = {}, -- ... etc. See `:help lspconfig-all` for a list of all the pre-configured LSPs @@ -832,6 +866,25 @@ require('lazy').setup({ -- By default, you may press `` to show the documentation. -- Optionally, set `auto_show = true` to show the documentation after a delay. documentation = { auto_show = false, auto_show_delay_ms = 500 }, + menu = { + draw = { + -- Define the columns to show in the completion menu + columns = { + { 'kind_icon' }, + { 'label', 'label_description', gap = 1 }, + { 'source_name' }, + }, + components = { + source_name = { + width = { max = 20 }, + text = function(ctx) + return ctx.source_name or '' + end, + highlight = 'BlinkCmpSource', + }, + }, + }, + }, }, sources = {