()
| 123503 | return builderProgram && builderProgram.getProgramOrUndefined(); |
| 123504 | } |
| 123505 | function synchronizeProgram() { |
| 123506 | writeLog("Synchronizing program"); |
| 123507 | clearInvalidateResolutionsOfFailedLookupLocations(); |
| 123508 | var program = getCurrentBuilderProgram(); |
| 123509 | if (hasChangedCompilerOptions) { |
| 123510 | newLine = updateNewLine(); |
| 123511 | if (program && (changesAffectResolution || ts.changesAffectModuleResolution(program.getCompilerOptions(), compilerOptions))) { |
| 123512 | resolutionCache.clear(); |
| 123513 | } |
| 123514 | } |
| 123515 | // All resolutions are invalid if user provided resolutions |
| 123516 | var hasInvalidatedResolution = resolutionCache.createHasInvalidatedResolution(userProvidedResolution || changesAffectResolution); |
| 123517 | if (ts.isProgramUptoDate(getCurrentProgram(), rootFileNames, compilerOptions, getSourceVersion, fileExists, hasInvalidatedResolution, hasChangedAutomaticTypeDirectiveNames, getParsedCommandLine, projectReferences)) { |
| 123518 | if (hasChangedConfigFileParsingErrors) { |
| 123519 | if (reportFileChangeDetectedOnCreateProgram) { |
| 123520 | reportWatchDiagnostic(ts.Diagnostics.File_change_detected_Starting_incremental_compilation); |
| 123521 | } |
| 123522 | builderProgram = createProgram(/*rootNames*/ undefined, /*options*/ undefined, compilerHost, builderProgram, configFileParsingDiagnostics, projectReferences); |
| 123523 | hasChangedConfigFileParsingErrors = false; |
| 123524 | } |
| 123525 | } |
| 123526 | else { |
| 123527 | if (reportFileChangeDetectedOnCreateProgram) { |
| 123528 | reportWatchDiagnostic(ts.Diagnostics.File_change_detected_Starting_incremental_compilation); |
| 123529 | } |
| 123530 | createNewProgram(hasInvalidatedResolution); |
| 123531 | } |
| 123532 | changesAffectResolution = false; // reset for next sync |
| 123533 | reportFileChangeDetectedOnCreateProgram = false; |
| 123534 | if (host.afterProgramCreate && program !== builderProgram) { |
| 123535 | host.afterProgramCreate(builderProgram); |
| 123536 | } |
| 123537 | return builderProgram; |
| 123538 | } |
| 123539 | function createNewProgram(hasInvalidatedResolution) { |
| 123540 | // Compile the program |
| 123541 | writeLog("CreatingProgramWith::"); |
no test coverage detected
searching dependent graphs…