MCPcopy Create free account
hub / github.com/JordanCoin/codemap / dependencyContextForFile

Function dependencyContextForFile

handoff/detail.go:68–82  ·  view source on GitHub ↗
(root string, state *watch.State, path string)

Source from the content-addressed store, hash-verified

66}
67
68func dependencyContextForFile(root string, state *watch.State, path string) ([]string, []string) {
69 if state != nil && (len(state.Importers) > 0 || len(state.Imports) > 0) {
70 return append([]string{}, state.Importers[path]...), append([]string{}, state.Imports[path]...)
71 }
72
73 if state != nil && state.FileCount > limits.LargeRepoFileCount {
74 return nil, nil
75 }
76
77 fg, err := scanner.BuildFileGraph(root)
78 if err != nil {
79 return nil, nil
80 }
81 return append([]string{}, fg.Importers[path]...), append([]string{}, fg.Imports[path]...)
82}
83
84func uniqueSorted(items []string) []string {
85 if len(items) == 0 {

Callers 1

BuildFileDetailFunction · 0.85

Calls 1

BuildFileGraphFunction · 0.92

Tested by

no test coverage detected