Skip to content

CodeGraph does not index call edges from anonymous/lambda functions #693

@Cyclone1070

Description

@Cyclone1070

The call graph indexer misses call edges originating from anonymous/lambda function bodies. Functions called only from inline closures (e.g., cobra RunE handlers, goroutine literals, callback closures) appear to have zero callers in the graph.

Steps to Reproduce

Given a codebase like:

// cmd/factory.go
func Wire() (*Deps, error) { ... }

// cmd/root.go
var rootCmd = &cobra.Command{
    RunE: func(cmd *cobra.Command, args []string) error {
        deps, err := Wire()  // <-- call from anonymous closure
        ...
    },
}

codegraph_callers("cmd.Wire") → returns "No callers found"

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions