@@ -14,7 +14,6 @@ import {
14
14
CompilerHost ,
15
15
CompilerOptions ,
16
16
CompilerOptionsValue ,
17
- ConfigFileProgramReloadLevel ,
18
17
convertToRelativePath ,
19
18
copyProperties ,
20
19
createCompilerDiagnostic ,
@@ -95,6 +94,7 @@ import {
95
94
ProgramBundleEmitBuildInfo ,
96
95
ProgramHost ,
97
96
ProgramMultiFileEmitBuildInfo ,
97
+ ProgramUpdateLevel ,
98
98
readBuilderProgram ,
99
99
ReadBuildProgramHost ,
100
100
resolveConfigFileProjectName ,
@@ -287,7 +287,7 @@ export interface SolutionBuilder<T extends BuilderProgram> {
287
287
288
288
// Testing only
289
289
/** @internal */ getUpToDateStatusOfProject ( project : string ) : UpToDateStatus ;
290
- /** @internal */ invalidateProject ( configFilePath : ResolvedConfigFilePath , reloadLevel ?: ConfigFileProgramReloadLevel ) : void ;
290
+ /** @internal */ invalidateProject ( configFilePath : ResolvedConfigFilePath , updateLevel ?: ProgramUpdateLevel ) : void ;
291
291
/** @internal */ close ( ) : void ;
292
292
}
293
293
@@ -389,7 +389,7 @@ interface SolutionBuilderState<T extends BuilderProgram> extends WatchFactory<Wa
389
389
390
390
readonly builderPrograms : Map < ResolvedConfigFilePath , T > ;
391
391
readonly diagnostics : Map < ResolvedConfigFilePath , readonly Diagnostic [ ] > ;
392
- readonly projectPendingBuild : Map < ResolvedConfigFilePath , ConfigFileProgramReloadLevel > ;
392
+ readonly projectPendingBuild : Map < ResolvedConfigFilePath , ProgramUpdateLevel > ;
393
393
readonly projectErrorsReported : Map < ResolvedConfigFilePath , true > ;
394
394
395
395
readonly compilerHost : CompilerHost & ReadBuildProgramHost ;
@@ -795,13 +795,13 @@ function clearProjectStatus<T extends BuilderProgram>(state: SolutionBuilderStat
795
795
state . diagnostics . delete ( resolved ) ;
796
796
}
797
797
798
- function addProjToQueue < T extends BuilderProgram > ( { projectPendingBuild } : SolutionBuilderState < T > , proj : ResolvedConfigFilePath , reloadLevel : ConfigFileProgramReloadLevel ) {
798
+ function addProjToQueue < T extends BuilderProgram > ( { projectPendingBuild } : SolutionBuilderState < T > , proj : ResolvedConfigFilePath , updateLevel : ProgramUpdateLevel ) {
799
799
const value = projectPendingBuild . get ( proj ) ;
800
800
if ( value === undefined ) {
801
- projectPendingBuild . set ( proj , reloadLevel ) ;
801
+ projectPendingBuild . set ( proj , updateLevel ) ;
802
802
}
803
- else if ( value < reloadLevel ) {
804
- projectPendingBuild . set ( proj , reloadLevel ) ;
803
+ else if ( value < updateLevel ) {
804
+ projectPendingBuild . set ( proj , updateLevel ) ;
805
805
}
806
806
}
807
807
@@ -815,7 +815,7 @@ function setupInitialBuild<T extends BuilderProgram>(state: SolutionBuilderState
815
815
buildOrder . forEach ( configFileName =>
816
816
state . projectPendingBuild . set (
817
817
toResolvedConfigFilePath ( state , configFileName ) ,
818
- ConfigFileProgramReloadLevel . None ,
818
+ ProgramUpdateLevel . Update ,
819
819
)
820
820
) ;
821
821
@@ -1402,8 +1402,8 @@ function getNextInvalidatedProjectCreateInfo<T extends BuilderProgram>(
1402
1402
for ( let projectIndex = 0 ; projectIndex < buildOrder . length ; projectIndex ++ ) {
1403
1403
const project = buildOrder [ projectIndex ] ;
1404
1404
const projectPath = toResolvedConfigFilePath ( state , project ) ;
1405
- const reloadLevel = state . projectPendingBuild . get ( projectPath ) ;
1406
- if ( reloadLevel === undefined ) continue ;
1405
+ const updateLevel = state . projectPendingBuild . get ( projectPath ) ;
1406
+ if ( updateLevel === undefined ) continue ;
1407
1407
1408
1408
if ( reportQueue ) {
1409
1409
reportQueue = false ;
@@ -1417,14 +1417,14 @@ function getNextInvalidatedProjectCreateInfo<T extends BuilderProgram>(
1417
1417
continue ;
1418
1418
}
1419
1419
1420
- if ( reloadLevel === ConfigFileProgramReloadLevel . Full ) {
1420
+ if ( updateLevel === ProgramUpdateLevel . Full ) {
1421
1421
watchConfigFile ( state , project , projectPath , config ) ;
1422
1422
watchExtendedConfigFiles ( state , projectPath , config ) ;
1423
1423
watchWildCardDirectories ( state , project , projectPath , config ) ;
1424
1424
watchInputFiles ( state , project , projectPath , config ) ;
1425
1425
watchPackageJsonFiles ( state , project , projectPath , config ) ;
1426
1426
}
1427
- else if ( reloadLevel === ConfigFileProgramReloadLevel . Partial ) {
1427
+ else if ( updateLevel === ProgramUpdateLevel . RootNamesAndUpdate ) {
1428
1428
// Update file names
1429
1429
config . fileNames = getFileNamesFromConfigSpecs ( config . options . configFile ! . configFileSpecs ! , getDirectoryPath ( project ) , config . options , state . parseConfigFileHost ) ;
1430
1430
updateErrorForNoInputFiles ( config . fileNames , project , config . options . configFile ! . configFileSpecs ! , config . errors , canJsonReportNoInputFiles ( config . raw ) ) ;
@@ -2169,7 +2169,7 @@ function queueReferencingProjects<T extends BuilderProgram>(
2169
2169
break ;
2170
2170
}
2171
2171
}
2172
- addProjToQueue ( state , nextProjectPath , ConfigFileProgramReloadLevel . None ) ;
2172
+ addProjToQueue ( state , nextProjectPath , ProgramUpdateLevel . Update ) ;
2173
2173
break ;
2174
2174
}
2175
2175
}
@@ -2251,7 +2251,7 @@ function cleanWorker<T extends BuilderProgram>(state: SolutionBuilderState<T>, p
2251
2251
}
2252
2252
else {
2253
2253
host . deleteFile ( output ) ;
2254
- invalidateProject ( state , resolvedPath , ConfigFileProgramReloadLevel . None ) ;
2254
+ invalidateProject ( state , resolvedPath , ProgramUpdateLevel . Update ) ;
2255
2255
}
2256
2256
}
2257
2257
}
@@ -2264,24 +2264,24 @@ function cleanWorker<T extends BuilderProgram>(state: SolutionBuilderState<T>, p
2264
2264
return ExitStatus . Success ;
2265
2265
}
2266
2266
2267
- function invalidateProject < T extends BuilderProgram > ( state : SolutionBuilderState < T > , resolved : ResolvedConfigFilePath , reloadLevel : ConfigFileProgramReloadLevel ) {
2267
+ function invalidateProject < T extends BuilderProgram > ( state : SolutionBuilderState < T > , resolved : ResolvedConfigFilePath , updateLevel : ProgramUpdateLevel ) {
2268
2268
// If host implements getParsedCommandLine, we cant get list of files from parseConfigFileHost
2269
- if ( state . host . getParsedCommandLine && reloadLevel === ConfigFileProgramReloadLevel . Partial ) {
2270
- reloadLevel = ConfigFileProgramReloadLevel . Full ;
2269
+ if ( state . host . getParsedCommandLine && updateLevel === ProgramUpdateLevel . RootNamesAndUpdate ) {
2270
+ updateLevel = ProgramUpdateLevel . Full ;
2271
2271
}
2272
- if ( reloadLevel === ConfigFileProgramReloadLevel . Full ) {
2272
+ if ( updateLevel === ProgramUpdateLevel . Full ) {
2273
2273
state . configFileCache . delete ( resolved ) ;
2274
2274
state . buildOrder = undefined ;
2275
2275
}
2276
2276
state . needsSummary = true ;
2277
2277
clearProjectStatus ( state , resolved ) ;
2278
- addProjToQueue ( state , resolved , reloadLevel ) ;
2278
+ addProjToQueue ( state , resolved , updateLevel ) ;
2279
2279
enableCache ( state ) ;
2280
2280
}
2281
2281
2282
- function invalidateProjectAndScheduleBuilds < T extends BuilderProgram > ( state : SolutionBuilderState < T > , resolvedPath : ResolvedConfigFilePath , reloadLevel : ConfigFileProgramReloadLevel ) {
2282
+ function invalidateProjectAndScheduleBuilds < T extends BuilderProgram > ( state : SolutionBuilderState < T > , resolvedPath : ResolvedConfigFilePath , updateLevel : ProgramUpdateLevel ) {
2283
2283
state . reportFileChangeDetected = true ;
2284
- invalidateProject ( state , resolvedPath , reloadLevel ) ;
2284
+ invalidateProject ( state , resolvedPath , updateLevel ) ;
2285
2285
scheduleBuildInvalidatedProject ( state , 250 , /*changeDetected*/ true ) ;
2286
2286
}
2287
2287
@@ -2344,7 +2344,7 @@ function watchConfigFile<T extends BuilderProgram>(state: SolutionBuilderState<T
2344
2344
watchFile (
2345
2345
state ,
2346
2346
resolved ,
2347
- ( ) => invalidateProjectAndScheduleBuilds ( state , resolvedPath , ConfigFileProgramReloadLevel . Full ) ,
2347
+ ( ) => invalidateProjectAndScheduleBuilds ( state , resolvedPath , ProgramUpdateLevel . Full ) ,
2348
2348
PollingInterval . High ,
2349
2349
parsed ?. watchOptions ,
2350
2350
WatchType . ConfigFile ,
@@ -2362,7 +2362,7 @@ function watchExtendedConfigFiles<T extends BuilderProgram>(state: SolutionBuild
2362
2362
watchFile (
2363
2363
state ,
2364
2364
extendedConfigFileName ,
2365
- ( ) => state . allWatchedExtendedConfigFiles . get ( extendedConfigFilePath ) ?. projects . forEach ( projectConfigFilePath => invalidateProjectAndScheduleBuilds ( state , projectConfigFilePath , ConfigFileProgramReloadLevel . Full ) ) ,
2365
+ ( ) => state . allWatchedExtendedConfigFiles . get ( extendedConfigFilePath ) ?. projects . forEach ( projectConfigFilePath => invalidateProjectAndScheduleBuilds ( state , projectConfigFilePath , ProgramUpdateLevel . Full ) ) ,
2366
2366
PollingInterval . High ,
2367
2367
parsed ?. watchOptions ,
2368
2368
WatchType . ExtendedConfigFile ,
@@ -2395,7 +2395,7 @@ function watchWildCardDirectories<T extends BuilderProgram>(state: SolutionBuild
2395
2395
} )
2396
2396
) return ;
2397
2397
2398
- invalidateProjectAndScheduleBuilds ( state , resolvedPath , ConfigFileProgramReloadLevel . Partial ) ;
2398
+ invalidateProjectAndScheduleBuilds ( state , resolvedPath , ProgramUpdateLevel . RootNamesAndUpdate ) ;
2399
2399
} ,
2400
2400
flags ,
2401
2401
parsed ?. watchOptions ,
@@ -2415,7 +2415,7 @@ function watchInputFiles<T extends BuilderProgram>(state: SolutionBuilderState<T
2415
2415
watchFile (
2416
2416
state ,
2417
2417
input ,
2418
- ( ) => invalidateProjectAndScheduleBuilds ( state , resolvedPath , ConfigFileProgramReloadLevel . None ) ,
2418
+ ( ) => invalidateProjectAndScheduleBuilds ( state , resolvedPath , ProgramUpdateLevel . Update ) ,
2419
2419
PollingInterval . Low ,
2420
2420
parsed ?. watchOptions ,
2421
2421
WatchType . SourceFile ,
@@ -2436,7 +2436,7 @@ function watchPackageJsonFiles<T extends BuilderProgram>(state: SolutionBuilderS
2436
2436
watchFile (
2437
2437
state ,
2438
2438
path ,
2439
- ( ) => invalidateProjectAndScheduleBuilds ( state , resolvedPath , ConfigFileProgramReloadLevel . None ) ,
2439
+ ( ) => invalidateProjectAndScheduleBuilds ( state , resolvedPath , ProgramUpdateLevel . Update ) ,
2440
2440
PollingInterval . High ,
2441
2441
parsed ?. watchOptions ,
2442
2442
WatchType . PackageJson ,
@@ -2503,7 +2503,7 @@ function createSolutionBuilderWorker<T extends BuilderProgram>(watch: boolean, h
2503
2503
const configFilePath = toResolvedConfigFilePath ( state , configFileName ) ;
2504
2504
return getUpToDateStatus ( state , parseConfigFile ( state , configFileName , configFilePath ) , configFilePath ) ;
2505
2505
} ,
2506
- invalidateProject : ( configFilePath , reloadLevel ) => invalidateProject ( state , configFilePath , reloadLevel || ConfigFileProgramReloadLevel . None ) ,
2506
+ invalidateProject : ( configFilePath , updateLevel ) => invalidateProject ( state , configFilePath , updateLevel || ProgramUpdateLevel . Update ) ,
2507
2507
close : ( ) => stopWatching ( state ) ,
2508
2508
} ;
2509
2509
}
0 commit comments