-
Notifications
You must be signed in to change notification settings - Fork 18.4k
Open
Labels
BugReportIssues describing a possible bug in the Go implementation.Issues describing a possible bug in the Go implementation.NeedsInvestigationSomeone must examine and confirm this is a valid issue and not a duplicate of an existing one.Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.ToolsThis label describes issues relating to any tools in the x/tools repository.This label describes issues relating to any tools in the x/tools repository.goplsIssues related to the Go language server, gopls.Issues related to the Go language server, gopls.gopls/telemetry-wins
Milestone
Description
#!stacks
"bug.Reportf" && "completion.(*completer).selector:+57"
Issue created by stacks.
// -- completion of symbols in unimported packages --
// use new code for unimported completions, if flag allows it
if c.snapshot.Options().ImportsSource == settings.ImportsSourceGopls {
// The user might have typed strings.TLower, so id.Name==strings, sel.Sel.Name == TLower,
// but the cursor might be inside TLower, so adjust the prefix
prefix := sel.Sel.Name
if c.surrounding != nil {
if c.surrounding.content != sel.Sel.Name {
bug.Reportf("unexpected surrounding: %q != %q", c.surrounding.content, sel.Sel.Name)
} else {
prefix = sel.Sel.Name[:c.surrounding.cursor-c.surrounding.start]
}
}
c.unimported(ctx, metadata.PackageName(id.Name), prefix)
return nil
}
Possible regression in https://go.dev/cl/667576?
This stack _bvZaw
was reported by telemetry:
gopls/bug
golang.org/x/tools/gopls/internal/util/bug.report:+35,+0x367
golang.org/x/tools/gopls/internal/util/bug.Reportf:+1,+0x27
golang.org/x/tools/gopls/internal/golang/completion.(*completer).selector:+57,+0x31b
golang.org/x/tools/gopls/internal/golang/completion.(*completer).collectCompletions:+56,+0x49b
golang.org/x/tools/gopls/internal/golang/completion.Completion:+159,+0xd67
golang.org/x/tools/gopls/internal/server.(*server).Completion:+19,+0x1ff
golang.org/x/tools/gopls/internal/protocol.serverDispatch:+193,+0x1cff
golang.org/x/tools/gopls/internal/lsprpc.(*StreamServer).ServeStream.ServerHandler.func4:+5,+0x6f
golang.org/x/tools/gopls/internal/lsprpc.(*StreamServer).ServeStream.handshaker.func5:+52,+0x637
golang.org/x/tools/gopls/internal/protocol.Handlers.MustReplyHandler.func1:+2,+0xb3
golang.org/x/tools/gopls/internal/protocol.Handlers.AsyncHandler.func2.2:+3,+0x7f
runtime.goexit:+0,+0x3
golang.org/x/tools/[email protected] go1.25.0 darwin/arm64 vscode (1)
Dups: BjtwIw 8lB0bg aoE2jw
Metadata
Metadata
Assignees
Labels
BugReportIssues describing a possible bug in the Go implementation.Issues describing a possible bug in the Go implementation.NeedsInvestigationSomeone must examine and confirm this is a valid issue and not a duplicate of an existing one.Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.ToolsThis label describes issues relating to any tools in the x/tools repository.This label describes issues relating to any tools in the x/tools repository.goplsIssues related to the Go language server, gopls.Issues related to the Go language server, gopls.gopls/telemetry-wins