Skip to content

Commit f78b909

Browse files
author
zhengbli
committed
CR feedback
1 parent 0f1585f commit f78b909

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/services/services.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3090,7 +3090,7 @@ namespace ts {
30903090

30913091
const oldSettings = program && program.getCompilerOptions();
30923092
const newSettings = hostCache.compilationSettings();
3093-
const changesInCompilationSettingsAffectSyntax = oldSettings &&
3093+
const shouldCreateNewSourceFiles = oldSettings &&
30943094
(oldSettings.target !== newSettings.target ||
30953095
oldSettings.module !== newSettings.module ||
30963096
oldSettings.moduleResolution !== newSettings.moduleResolution ||
@@ -3151,7 +3151,7 @@ namespace ts {
31513151
const oldSourceFiles = program.getSourceFiles();
31523152
const oldSettingsKey = documentRegistry.getKeyForCompilationSettings(oldSettings);
31533153
for (const oldSourceFile of oldSourceFiles) {
3154-
if (!newProgram.getSourceFile(oldSourceFile.fileName) || changesInCompilationSettingsAffectSyntax) {
3154+
if (!newProgram.getSourceFile(oldSourceFile.fileName) || shouldCreateNewSourceFiles) {
31553155
documentRegistry.releaseDocumentWithKey(oldSourceFile.path, oldSettingsKey);
31563156
}
31573157
}
@@ -3185,7 +3185,7 @@ namespace ts {
31853185
// Check if the language version has changed since we last created a program; if they are the same,
31863186
// it is safe to reuse the sourceFiles; if not, then the shape of the AST can change, and the oldSourceFile
31873187
// can not be reused. we have to dump all syntax trees and create new ones.
3188-
if (!changesInCompilationSettingsAffectSyntax) {
3188+
if (!shouldCreateNewSourceFiles) {
31893189
// Check if the old program had this file already
31903190
const oldSourceFile = program && program.getSourceFileByPath(path);
31913191
if (oldSourceFile) {

0 commit comments

Comments
 (0)