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

Method GetTypeCheckerForFile

internal/compiler/program.go:483–488  ·  view source on GitHub ↗

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)

Source from the content-addressed store, hash-verified

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.
483func (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.

Calls 2

GetCheckerMethod · 0.65

Tested by

no test coverage detected