(ctx context.Context, sourceFiles []*ast.SourceFile, concurrent bool, collect func(context.Context, *ast.SourceFile) []*ast.Diagnostic)
| 548 | } |
| 549 | |
| 550 | func (p *Program) collectDiagnosticsFromFiles(ctx context.Context, sourceFiles []*ast.SourceFile, concurrent bool, collect func(context.Context, *ast.SourceFile) []*ast.Diagnostic) [][]*ast.Diagnostic { |
| 551 | diagnostics := make([][]*ast.Diagnostic, len(sourceFiles)) |
| 552 | wg := core.NewWorkGroup(!concurrent || p.SingleThreaded()) |
| 553 | for i, file := range sourceFiles { |
| 554 | wg.Queue(func() { |
| 555 | diagnostics[i] = collect(ctx, file) |
| 556 | }) |
| 557 | } |
| 558 | wg.RunAndWait() |
| 559 | return diagnostics |
| 560 | } |
| 561 | |
| 562 | // collectCheckerDiagnostics collects diagnostics from a single file or all files, |
| 563 | // using a callback that receives the checker for each file. When the checker pool |
no test coverage detected