-
Notifications
You must be signed in to change notification settings - Fork 17.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
x/tools/gopls: InvalidRangeExpr when using GOEXPERIMENT=rangefunc on iter.Seq #65667
Comments
It works for me. In your I just did:
I'm using coc.nvim, but wouldn't expect neovim native LSP to behave differently. |
When I try to set it as environment variables, I get
I had previously tried to use the environment variable to add the configuration of I have tried it again, but I run into the same error: lspconfig.gopls.setup({
capabilities = addCmpCapabilities(lspconfig.gopls.capabilities),
settings = {
gopls = {
allowModfileModifications = false,
gofumpt = true,
codelenses = {
generate = true,
tidy = true,
upgrade_dependency = true,
vendor = true,
},
buildFlags = { "-tags", "goexperiment.rangefunc" },
directoryFilters = { "-**/node_modules", "-**/.git" },
env = {
GOEXPERIMENT = "rangefunc",
},
},
},
}) |
Hmm, do you have multiple versions of go installed? Is it possible that the go your neovim sees is not go 1.22? |
So I updated my
However, the InvalidRangeExpr error is still reported despite adding
|
Could you share gopls logs from a short session that demonstrates the problem? That would help us investigate why it isn't working in your session. |
My bad. I was using Mason on Neovim, which installs its own
|
@stephenafamo hi, did you solve this problem? |
@RunThem The solution is to update gopls in Mason:
|
gopls version
golang.org/x/tools/gopls v0.15.0-pre.2
golang.org/x/tools/[email protected] h1:A48ndEGf3pvzJ0k22HneSU7msCaggzcpg56ELTEuapQ=
github.com/BurntSushi/[email protected] h1:9F2/+DoOYIOksmaJFPw1tGFy1eDnIJXg+UHjuD8lTak=
github.com/google/[email protected] h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI=
golang.org/x/exp/[email protected] h1:2O2DON6y3XMJiQRAS1UWU+54aec2uopH3x7MAiqGW6Y=
golang.org/x/[email protected] h1:dGoOF9QVLYng8IHTm7BAyWqCqSheQ5pYWGhzW00YJr0=
golang.org/x/[email protected] h1:5BMeUDZ7vkXGfEr1x9B4bRcTH4lpkTkpdh0T/J+qjbQ=
golang.org/x/[email protected] h1:Nr7eTQpQZ/ytesxDJpQgaf0t4sdLnnDtAbmtViTrSUo=
golang.org/x/[email protected] h1:ScX5w1eTa3QqT8oi6+ziP7dTV1S2+ALU0bI+0zXKWiQ=
golang.org/x/[email protected] h1:WL/PnseOKWuDtRbgfYKDpuAmMpy3OrX84rv7uQFZJK4=
golang.org/x/[email protected] h1:KUas02EjQK5LTuIx1OylBQdKKZ9jeugs+HiqO5HormU=
honnef.co/go/[email protected] h1:oFEHCKeID7to/3autwsWfnuv69j3NsfcXbvJKuIcep8=
mvdan.cc/[email protected] h1:G3QvahNDmpD+Aek/bNOLrFR2XC6ZAdo62dZu65gmwGo=
mvdan.cc/xurls/[email protected] h1:lyBNOm8Wo71UknhUs4QTFUNNMyxy2JEIaKKo0RWOh+8=
go: go1.22.0
go env
What did you do?
https://go.dev/play/p/rMbWTBEtveQ
What did you see happen?
gopls indicates an error even if it should be considered valid when
GOEXPERIMENT=rangefunc
is setWhat did you expect to see?
No error shown
Editor and settings
Neovim with the following
gopls
configurationLogs
No response
The text was updated successfully, but these errors were encountered: