MCPcopy Create free account
hub / github.com/microsoft/typescript-go / collectDiagnosticsFromFiles

Method collectDiagnosticsFromFiles

internal/compiler/program.go:550–560  ·  view source on GitHub ↗
(ctx context.Context, sourceFiles []*ast.SourceFile, concurrent bool, collect func(context.Context, *ast.SourceFile) []*ast.Diagnostic)

Source from the content-addressed store, hash-verified

548}
549
550func (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

Callers 1

collectDiagnosticsMethod · 0.95

Calls 6

SingleThreadedMethod · 0.95
QueueMethod · 0.95
RunAndWaitMethod · 0.95
NewWorkGroupFunction · 0.92
lenFunction · 0.85
makeFunction · 0.50

Tested by

no test coverage detected