(root string, state *watch.State, path string)
| 66 | } |
| 67 | |
| 68 | func 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 | |
| 84 | func uniqueSorted(items []string) []string { |
| 85 | if len(items) == 0 { |
no test coverage detected