diff --git a/cli/tsc/99_main_compiler.js b/cli/tsc/99_main_compiler.js index 97378076ac..e5b51cab0b 100644 --- a/cli/tsc/99_main_compiler.js +++ b/cli/tsc/99_main_compiler.js @@ -609,7 +609,9 @@ delete Object.prototype.__proto__; specifier, languageVersion, _onError, - shouldCreateNewSourceFile, + // this is not used by the lsp because source + // files are created in the document registry + _shouldCreateNewSourceFile, ) { if (logDebug) { debug( @@ -624,10 +626,6 @@ delete Object.prototype.__proto__; // Needs the original specifier specifier = normalizedToOriginalMap.get(specifier) ?? specifier; - if (shouldCreateNewSourceFile) { - sourceFileCache.delete(specifier); - } - let sourceFile = sourceFileCache.get(specifier); if (sourceFile) { return sourceFile;