We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
It looks like this regressed in golang/tools@12d7342#diff-33a4b83a3d750539392acd0f451849ebR164. GetImport must guard against returning a nil *pkg pointer because that results in a not-nil but panicky source.Package.
GetImport
*pkg
source.Package
/cc @stamblerre
panic: runtime error: invalid memory address or nil pointer dereference [signal SIGSEGV: segmentation violation code=0x1 addr=0x58 pc=0x1380355] goroutine 8 [running]: golang.org/x/tools/internal/lsp/cache.(*pkg).GetSyntax(0x0, 0xc0003f8b07, 0x3, 0x1755200) /Users/muir/projects/tools/internal/lsp/cache/pkg.go:141 +0x5 golang.org/x/tools/internal/lsp/source.importSpec(0x1753800, 0xc0002d8000, 0xc0004f8400, 0x1755200, 0xc00052c480, 0x1cbc5, 0x1, 0x0, 0x0) /Users/muir/projects/tools/internal/lsp/source/identifier.go:229 +0x20a golang.org/x/tools/internal/lsp/source.identifier(0x174d600, 0xc0000309c0, 0x1755b80, 0xc000266000, 0x1753800, 0xc0002d8000, 0x1cbc5, 0x0, 0x0, 0x0) /Users/muir/projects/tools/internal/lsp/source/identifier.go:71 +0x2a3 golang.org/x/tools/internal/lsp/source.Identifier(0x174d600, 0xc0000309c0, 0x1755b80, 0xc000266000, 0x1753800, 0xc0002d8000, 0x1cbc6, 0x1a, 0xc0003c4300, 0xc0001ba4c0) /Users/muir/projects/tools/internal/lsp/source/identifier.go:47 +0x117 golang.org/x/tools/internal/lsp.(*Server).hover(0xc0001703f0, 0x174d600, 0xc0000309c0, 0xc00049ed00, 0x0, 0x0, 0xc000536a00) /Users/muir/projects/tools/internal/lsp/hover.go:31 +0x243 golang.org/x/tools/internal/lsp.(*Server).Hover(0xc0001703f0, 0x174d600, 0xc0000309c0, 0xc00049ed00, 0xc00049ed00, 0x0, 0x0) /Users/muir/projects/tools/internal/lsp/server.go:170 +0x49 golang.org/x/tools/internal/lsp/protocol.serverHandler.func1(0x174d600, 0xc0000309c0, 0xc000170460, 0xc00026ffa0) /Users/muir/projects/tools/internal/lsp/protocol/tsserver.go:285 +0x1657 golang.org/x/tools/internal/jsonrpc2.(*Conn).Run.func1(0xc000092d20, 0xc000170460) /Users/muir/projects/tools/internal/jsonrpc2/jsonrpc2.go:276 +0xda created by golang.org/x/tools/internal/jsonrpc2.(*Conn).Run /Users/muir/projects/tools/internal/jsonrpc2/jsonrpc2.go:270 +0xba
The text was updated successfully, but these errors were encountered:
@muirrn: Thanks for catching this, I thought that https://go-review.googlesource.com/c/tools/+/178724 would prevent this from happening, but I didn't actually handle this case.
Sorry, something went wrong.
Change https://golang.org/cl/179919 mentions this issue: internal/lsp: fix regression from CL 179439
internal/lsp: fix regression from CL 179439
golang/tools@a4e9122
No branches or pull requests
It looks like this regressed in golang/tools@12d7342#diff-33a4b83a3d750539392acd0f451849ebR164.
GetImport
must guard against returning a nil*pkg
pointer because that results in a not-nil but panickysource.Package
./cc @stamblerre
The text was updated successfully, but these errors were encountered: