@@ -245,6 +245,7 @@ namespace ts {
245245 getModifiedTime ( fileName : string ) : Date | undefined ;
246246 setModifiedTime ( fileName : string , date : Date ) : void ;
247247 deleteFile ( fileName : string ) : void ;
248+ getParsedCommandLine ?( fileName : string ) : ParsedCommandLine | undefined ;
248249
249250 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
250251 reportSolutionBuilderStatus : DiagnosticReporter ;
@@ -493,10 +494,17 @@ namespace ts {
493494 }
494495
495496 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+ }
500508 configFileCache . set ( configFilePath , parsed || diagnostic ! ) ;
501509 return parsed ;
502510 }
@@ -1730,6 +1738,10 @@ namespace ts {
17301738 }
17311739
17321740 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+ }
17331745 if ( reloadLevel === ConfigFileProgramReloadLevel . Full ) {
17341746 state . configFileCache . delete ( resolved ) ;
17351747 state . buildOrder = undefined ;
0 commit comments