@@ -3090,7 +3090,7 @@ namespace ts {
3090
3090
3091
3091
const oldSettings = program && program . getCompilerOptions ( ) ;
3092
3092
const newSettings = hostCache . compilationSettings ( ) ;
3093
- const changesInCompilationSettingsAffectSyntax = oldSettings &&
3093
+ const shouldCreateNewSourceFiles = oldSettings &&
3094
3094
( oldSettings . target !== newSettings . target ||
3095
3095
oldSettings . module !== newSettings . module ||
3096
3096
oldSettings . moduleResolution !== newSettings . moduleResolution ||
@@ -3151,7 +3151,7 @@ namespace ts {
3151
3151
const oldSourceFiles = program . getSourceFiles ( ) ;
3152
3152
const oldSettingsKey = documentRegistry . getKeyForCompilationSettings ( oldSettings ) ;
3153
3153
for ( const oldSourceFile of oldSourceFiles ) {
3154
- if ( ! newProgram . getSourceFile ( oldSourceFile . fileName ) || changesInCompilationSettingsAffectSyntax ) {
3154
+ if ( ! newProgram . getSourceFile ( oldSourceFile . fileName ) || shouldCreateNewSourceFiles ) {
3155
3155
documentRegistry . releaseDocumentWithKey ( oldSourceFile . path , oldSettingsKey ) ;
3156
3156
}
3157
3157
}
@@ -3185,7 +3185,7 @@ namespace ts {
3185
3185
// Check if the language version has changed since we last created a program; if they are the same,
3186
3186
// it is safe to reuse the sourceFiles; if not, then the shape of the AST can change, and the oldSourceFile
3187
3187
// can not be reused. we have to dump all syntax trees and create new ones.
3188
- if ( ! changesInCompilationSettingsAffectSyntax ) {
3188
+ if ( ! shouldCreateNewSourceFiles ) {
3189
3189
// Check if the old program had this file already
3190
3190
const oldSourceFile = program && program . getSourceFileByPath ( path ) ;
3191
3191
if ( oldSourceFile ) {
0 commit comments