BuildFileGraph analyzes a project and returns file-level dependencies Uses ast-grep for multi-language support with universal fuzzy resolution
(root string)
| 30 | // BuildFileGraph analyzes a project and returns file-level dependencies |
| 31 | // Uses ast-grep for multi-language support with universal fuzzy resolution |
| 32 | func BuildFileGraph(root string) (*FileGraph, error) { |
| 33 | // Use ast-grep to extract imports for all languages. |
| 34 | analyses, err := ScanForDeps(root) |
| 35 | if err != nil { |
| 36 | return nil, err |
| 37 | } |
| 38 | return BuildFileGraphFromAnalyses(root, analyses) |
| 39 | } |
| 40 | |
| 41 | // BuildFileGraphFromAnalyses builds the file graph from a pre-computed ast-grep |
| 42 | // scan, letting callers that already hold the analyses avoid a redundant |