We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
getScriptFileNames
1 parent 8687940 commit 8002369Copy full SHA for 8002369
1 file changed
src/services/services.ts
@@ -1283,7 +1283,10 @@ namespace ts {
1283
lastTypesRootVersion = typeRootsVersion;
1284
}
1285
1286
- const rootFileNames = host.getScriptFileNames();
+ // This array is retained by the program and will be used to determine if the program is up to date,
1287
+ // so we need to make a copy in case the host mutates the underlying array - otherwise it would look
1288
+ // like every program always has the host's current list of root files.
1289
+ const rootFileNames = host.getScriptFileNames().slice();
1290
1291
// Get a fresh cache of the host information
1292
const newSettings = host.getCompilationSettings() || getDefaultCompilerOptions();
0 commit comments