Return a checker for the given file. We may have multiple checkers in concurrent scenarios and this method returns the checker that was tasked with checking the file. Note that it isn't possible to mix types obtained from different checkers, so only non-type data (such as diagnostics or string repre
(ctx context.Context, file *ast.SourceFile)
| 481 | // types obtained from different checkers, so only non-type data (such as diagnostics or string |
| 482 | // representations of types) should be obtained from checkers returned by this method. |
| 483 | func (p *Program) GetTypeCheckerForFile(ctx context.Context, file *ast.SourceFile) (*checker.Checker, func()) { |
| 484 | if p.compilerCheckerPool != nil { |
| 485 | return p.compilerCheckerPool.getCheckerForFileNonExclusive(file) |
| 486 | } |
| 487 | return p.checkerPool.GetChecker(ctx, file) |
| 488 | } |
| 489 | |
| 490 | // Return a checker for the given file, locked to the current thread to prevent data races from multiple threads |
| 491 | // accessing the same checker. The lock will be released when the `done` function is called. |
no test coverage detected