@@ -245,6 +245,7 @@ namespace ts {
245
245
getModifiedTime ( fileName : string ) : Date | undefined ;
246
246
setModifiedTime ( fileName : string , date : Date ) : void ;
247
247
deleteFile ( fileName : string ) : void ;
248
+ getParsedCommandLine ?( fileName : string ) : ParsedCommandLine | undefined ;
248
249
249
250
reportDiagnostic : DiagnosticReporter ; // Technically we want to move it out and allow steps of actions on Solution, but for now just merge stuff in build host here
250
251
reportSolutionBuilderStatus : DiagnosticReporter ;
@@ -493,10 +494,17 @@ namespace ts {
493
494
}
494
495
495
496
let diagnostic : Diagnostic | undefined ;
496
- const { parseConfigFileHost, baseCompilerOptions, extendedConfigCache } = state ;
497
- parseConfigFileHost . onUnRecoverableConfigFileDiagnostic = d => diagnostic = d ;
498
- const parsed = getParsedCommandLineOfConfigFile ( configFileName , baseCompilerOptions , parseConfigFileHost , extendedConfigCache ) ;
499
- parseConfigFileHost . onUnRecoverableConfigFileDiagnostic = noop ;
497
+ const { parseConfigFileHost, baseCompilerOptions, extendedConfigCache, host } = state ;
498
+ let parsed : ParsedCommandLine | undefined ;
499
+ if ( host . getParsedCommandLine ) {
500
+ parsed = host . getParsedCommandLine ( configFileName ) ;
501
+ if ( ! parsed ) diagnostic = createCompilerDiagnostic ( Diagnostics . File_0_not_found , configFileName ) ;
502
+ }
503
+ else {
504
+ parseConfigFileHost . onUnRecoverableConfigFileDiagnostic = d => diagnostic = d ;
505
+ parsed = getParsedCommandLineOfConfigFile ( configFileName , baseCompilerOptions , parseConfigFileHost , extendedConfigCache ) ;
506
+ parseConfigFileHost . onUnRecoverableConfigFileDiagnostic = noop ;
507
+ }
500
508
configFileCache . set ( configFilePath , parsed || diagnostic ! ) ;
501
509
return parsed ;
502
510
}
@@ -1730,6 +1738,10 @@ namespace ts {
1730
1738
}
1731
1739
1732
1740
function invalidateProject ( state : SolutionBuilderState , resolved : ResolvedConfigFilePath , reloadLevel : ConfigFileProgramReloadLevel ) {
1741
+ // If host implements getParsedCommandLine, we cant get list of files from parseConfigFileHost
1742
+ if ( state . host . getParsedCommandLine && reloadLevel === ConfigFileProgramReloadLevel . Partial ) {
1743
+ reloadLevel = ConfigFileProgramReloadLevel . Full ;
1744
+ }
1733
1745
if ( reloadLevel === ConfigFileProgramReloadLevel . Full ) {
1734
1746
state . configFileCache . delete ( resolved ) ;
1735
1747
state . buildOrder = undefined ;
0 commit comments