Skip to content

x/tools/gopls: nvim with go1.22 stopped working #66743

@op

Description

@op

What did you do?

I changed go.mod in a project to use go 1.22.2 and now the LSP integration with gopls for neovim stopped working.

Running GO111MODULE=off nvim makes gopls happy again.

What did you expect to see?

References to sources. 👯

What did you see instead?

Error when executing textDocument/references : no object found for "MyStruct"

This is what trace gave me:

    13:59:33.241 end textDocument/references (+2.617523877s) method="textDocument/references" direction="in" id="#5"
        13:59:33.241 event (+2.617520418s) label= status.code="OK" 
        13:59:30.624 start queued
        13:59:33.240 end queued (+2.616936504s)
        13:59:33.241 start lsp.Server.references URI=file:///home/orion/src/github.com/[..]/file.go
        13:59:33.241 end lsp.Server.references (+206.982µs) URI=file:///home/orion/src/github.com/[..]/file.go
            13:59:33.241 start golang.references
            13:59:33.241 end golang.references (+161.379µs)
                13:59:33.241 start cache.ParseGoSrc file="/home/orion/src/github.com/[..]/file.go"
                13:59:33.241 end cache.ParseGoSrc (+50.929µs) file="/home/orion/src/github.com/[..]/file.go"
                13:59:33.241 start cache.forEachPackage packages=0
                13:59:33.241 end cache.forEachPackage (+12.649µs) packages=0

This is the trace running with GO111MODULE=off nvim:

    13:58:00.802 end textDocument/references (+2.363171265s) method="textDocument/references" direction="in" id="#5"
        13:58:00.802 event (+2.363167136s) label= status.code="OK" 
        13:57:58.439 start queued
        13:58:00.792 end queued (+2.353172048s)
        13:58:00.792 start lsp.Server.references URI=file:///home/orion/src/github.com/[..]/file.go
        13:58:00.802 end lsp.Server.references (+9.50709ms) URI=file:///home/orion/src/github.com/[..]/file.go
            13:58:00.792 start golang.references
            13:58:00.802 end golang.references (+9.473549ms)
                13:58:00.792 start cache.ParseGoSrc file="/home/orion/src/github.com/[..]/file.go"
                13:58:00.792 end cache.ParseGoSrc (+47.099µs) file="/home/orion/src/github.com/[..]/file.go"
                13:58:00.792 start cache.forEachPackage packages=0
                13:58:00.792 end cache.forEachPackage (+106.433µs) packages=0
                13:58:00.792 start cache.snapshot.References
                13:58:00.792 end cache.snapshot.References (+26.739µs)
                    13:58:00.792 start cache.forEachPackage packages=0
                    13:58:00.792 end cache.forEachPackage (+6.675µs) packages=0
                13:58:00.792 start cache.forEachPackage packages=0
                13:58:00.793 end cache.forEachPackage (+36.98µs) packages=0
                13:58:00.792 start cache.forEachPackage packages=1
                13:58:00.801 end cache.forEachPackage (+8.214685ms) packages=1
                    13:58:00.794 start cache.typeCheckBatch.checkPackage package="github.com/[..]/fleetservice.test]"
                    13:58:00.801 end cache.typeCheckBatch.checkPackage (+6.864903ms) package="github.com/[..]/fleetservice [github.com/northvolt/[..]/fleetservice.test]"
                        13:58:00.794 start cache.ParseGoSrc file="/home/orion/src/github.com/[..]/other_file.go"
                        13:58:00.794 end cache.ParseGoSrc (+183.399µs) file="/home/orion/src/github.com/[..]/other_file.go"

Build info

golang.org/x/tools/gopls v0.15.2
    golang.org/x/tools/[email protected] h1:4JKt4inO8JaFW3l/Fh9X1k/5JQn+iUOpdc4/Lpi0mOs=
    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:SernR4v+D55NyBH2QiEQrlBAnj1ECL6AGrA5+dPaMY8=
    golang.org/x/[email protected] h1:5BMeUDZ7vkXGfEr1x9B4bRcTH4lpkTkpdh0T/J+qjbQ=
    golang.org/x/[email protected] h1:vcVnuftN4J4UKLRcgetjzfU9FjjgXUUYUc3JhFplgV4=
    golang.org/x/[email protected] h1:ScX5w1eTa3QqT8oi6+ziP7dTV1S2+ALU0bI+0zXKWiQ=
    golang.org/x/[email protected] h1:No0LMXYFkp3j4oEsPdtY8LUQz33gu79Rm9DE+izMeGQ=
    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.21.1

Metadata

Metadata

Assignees

No one assigned

    Labels

    FrozenDueToAgeToolsThis label describes issues relating to any tools in the x/tools repository.WaitingForInfoIssue is not actionable because of missing required information, which needs to be provided.goplsIssues related to the Go language server, gopls.

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions