MCPcopy Index your code
hub / github.com/nodejs/node / synchronizeProgram

Function synchronizeProgram

test/fixtures/snapshot/typescript.js:123505–123538  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

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::");

Callers 4

createWatchProgramFunction · 0.85
updateProgramFunction · 0.85
reloadConfigFileFunction · 0.85

Calls 8

getCurrentBuilderProgramFunction · 0.85
updateNewLineFunction · 0.85
getCurrentProgramFunction · 0.85
reportWatchDiagnosticFunction · 0.85
createProgramFunction · 0.85
createNewProgramFunction · 0.85
clearMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…