Skip to content

x/tools/gopls: MCP: nil panic in summarizeDiagnostics (CodeAction without WorkspaceEdit) #75489

@adonovan

Description

@adonovan
#!stacks
"sigpanic" && "mcp.summarizeDiagnostics:+6"

Issue created by stacks.

func summarizeDiagnostics(ctx context.Context, snapshot *cache.Snapshot, w io.Writer, diagnostics []*cache.Diagnostic, fixes map[*cache.Diagnostic]*protocol.CodeAction) error {
	for _, d := range diagnostics {
...		fix, ok := fixes[d]
		if ok {
			diff, err := toUnifiedDiff(ctx, snapshot, fix.Edit.DocumentChanges) <----- SEGV

This stack HZxbeA was reported by telemetry:

golang.org/x/tools/[email protected] go1.24.5 darwin/arm64 other,vscode (1)

Dups: p2z9Zg

Metadata

Metadata

Assignees

No one assigned

    Labels

    BugReportIssues 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.ToolsThis label describes issues relating to any tools in the x/tools repository.goplsIssues related to the Go language server, gopls.gopls/telemetry-wins

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions