* Handles semantic diagnostics and dts emit for affectedFile and files, that are referencing modules that export entities from affected file * This is because even though js emit doesnt change, dts emit / type used can change resulting in need for dts emit and js change
(state, affectedFile, cancellationToken, computeHash, host)
| 120334 | * This is because even though js emit doesnt change, dts emit / type used can change resulting in need for dts emit and js change |
| 120335 | */ |
| 120336 | function handleDtsMayChangeOfAffectedFile(state, affectedFile, cancellationToken, computeHash, host) { |
| 120337 | var _a; |
| 120338 | removeSemanticDiagnosticsOf(state, affectedFile.resolvedPath); |
| 120339 | // If affected files is everything except default library, then nothing more to do |
| 120340 | if (state.allFilesExcludingDefaultLibraryFile === state.affectedFiles) { |
| 120341 | removeDiagnosticsOfLibraryFiles(state); |
| 120342 | // When a change affects the global scope, all files are considered to be affected without updating their signature |
| 120343 | // That means when affected file is handled, its signature can be out of date |
| 120344 | // To avoid this, ensure that we update the signature for any affected file in this scenario. |
| 120345 | ts.BuilderState.updateShapeSignature(state, ts.Debug.checkDefined(state.program), affectedFile, ts.Debug.checkDefined(state.currentAffectedFilesSignatures), cancellationToken, computeHash, state.currentAffectedFilesExportedModulesMap); |
| 120346 | return; |
| 120347 | } |
| 120348 | ts.Debug.assert(state.hasCalledUpdateShapeSignature.has(affectedFile.resolvedPath) || ((_a = state.currentAffectedFilesSignatures) === null || _a === void 0 ? void 0 : _a.has(affectedFile.resolvedPath)), "Signature not updated for affected file: ".concat(affectedFile.fileName)); |
| 120349 | if (state.compilerOptions.assumeChangesOnlyAffectDirectDependencies) |
| 120350 | return; |
| 120351 | handleDtsMayChangeOfReferencingExportOfAffectedFile(state, affectedFile, cancellationToken, computeHash, host); |
| 120352 | } |
| 120353 | /** |
| 120354 | * Handle the dts may change, so they need to be added to pending emit if dts emit is enabled, |
| 120355 | * Also we need to make sure signature is updated for these files |
no test coverage detected