* Gets the binder and checker diagnostics either from cache if present, or otherwise from program and caches it * Note that it is assumed that when asked about binder and checker diagnostics, the file has been taken out of affected files/changed file set
(state, sourceFile, cancellationToken)
| 120536 | * Note that it is assumed that when asked about binder and checker diagnostics, the file has been taken out of affected files/changed file set |
| 120537 | */ |
| 120538 | function getBinderAndCheckerDiagnosticsOfFile(state, sourceFile, cancellationToken) { |
| 120539 | var path = sourceFile.resolvedPath; |
| 120540 | if (state.semanticDiagnosticsPerFile) { |
| 120541 | var cachedDiagnostics = state.semanticDiagnosticsPerFile.get(path); |
| 120542 | // Report the bind and check diagnostics from the cache if we already have those diagnostics present |
| 120543 | if (cachedDiagnostics) { |
| 120544 | return ts.filterSemanticDiagnostics(cachedDiagnostics, state.compilerOptions); |
| 120545 | } |
| 120546 | } |
| 120547 | // Diagnostics werent cached, get them from program, and cache the result |
| 120548 | var diagnostics = ts.Debug.checkDefined(state.program).getBindAndCheckDiagnostics(sourceFile, cancellationToken); |
| 120549 | if (state.semanticDiagnosticsPerFile) { |
| 120550 | state.semanticDiagnosticsPerFile.set(path, diagnostics); |
| 120551 | } |
| 120552 | return ts.filterSemanticDiagnostics(diagnostics, state.compilerOptions); |
| 120553 | } |
| 120554 | /** |
| 120555 | * Gets the program information to be emitted in buildInfo so that we can use it to create new program |
| 120556 | */ |
no test coverage detected