Open edte opened 3 months ago
Is the gopls enabled? the latest will use gopls to fillstruct. I donot see the issue from my side
https://github.com/ray-x/go.nvim/assets/1681295/5ff4c299-ee48-4bb2-8e8c-39e8d250fbda
gopls has enabled
and version
$ gopls version
golang.org/x/tools/gopls v0.13.2
golang.org/x/tools/gopls@v0.13.2 h1:Pyvx6MKvatbX3zzZmdGiFRfQZl0ohPlt2sFxO/5j6Ro=
Update go to the latest version
$ go version
go version go1.22.1 darwin/arm64
gopls downloaded by mason
$ /Users/edte/.local/share/lvim/mason/bin/gopls version
golang.org/x/tools/gopls v0.14.2
golang.org/x/tools/gopls@v0.14.2 h1:sIw6vjZiuQ9S7s0auUUkHlWgsCkKZFWDHmrge8LYsnc=
same question
Did you try with minium vimrc, you can use this one: https://github.com/ray-x/go.nvim/blob/master/playground/init_lazy.lua
You can run nvim -u init_lazy.lua your_go_file.go
and try GoFillStruct
I just want to rule out the possibility that other plugin/tools/autocmd have been used.
Also, FYI, the GoFillStruct
command will be tested by github action for each commit into branch & master. I have not seen any issues so far.
I'm also noticing this, GoFillStruct stopped working for me
My gopls version: golang.org/x/tools/gopls v0.15.2
Also : https://github.com/golang/go/issues/64297 seems it is upstream issue
My gopls is the same version as well. This is my config if I log before start.
{
capabilities = {
textDocument = {
completion = {
completionItem = {
commitCharactersSupport = true,
deprecatedSupport = true,
documentationFormat = { "markdown", "plaintext" },
insertReplaceSupport = true,
labelDetailsSupport = true,
preselectSupport = true,
resolveSupport = {
properties = { "documentation", "details", "additionalTextEdits" }
},
snippetSupport = true
},
contextSupport = true,
dynamicRegistration = true
}
}
},
cmd = { "gopls", "-remote=auto" },
filetypes = { "go", "gomod", "gosum", "gotmpl", "gohtmltmpl", "gotexttmpl" },
flags = {
allow_incremental_sync = true,
debounce_text_changes = 500
},
message_level = 1,
on_attach = <function 1>,
root_dir = <function 2>,
settings = {
gopls = {
analyses = {
ST1003 = true,
fieldalignment = false,
fillreturns = true,
nilness = true,
nonewvars = true,
shadow = true,
undeclaredname = true,
unreachable = true,
unusedparams = true,
unusedwrite = true,
useany = true
},
buildFlags = { "-tags", "integration" },
codelenses = {
gc_details = true,
generate = true,
regenerate_cgo = true,
test = true,
tidy = true,
upgrade_dependency = true,
vendor = true
},
completeUnimported = true,
diagnosticsDelay = "500ms",
gofumpt = false,
hints = {
assignVariableTypes = true,
compositeLiteralFields = true,
compositeLiteralTypes = true,
constantValues = true,
functionTypeParameters = true,
parameterNames = true,
rangeVariableTypes = true
},
["local"] = "...",
matcher = "Fuzzy",
semanticTokens = true,
staticcheck = true,
symbolMatcher = "fuzzy",
usePlaceholders = true
}
}
}
go.nvim
config
neovim version
path
fill struct by cmd https://github.com/ray-x/go.nvim/assets/50194671/899ece7e-bfc2-4239-abfc-d656e4cb03d2
fill succ by lsp action
https://github.com/ray-x/go.nvim/assets/50194671/998c5d72-bef7-444a-a064-b97e65940480
checkhealth