From c1bd9503dd0288a3c209ca2724d2a1de9d5d122b Mon Sep 17 00:00:00 2001 From: David Sherret Date: Wed, 24 Apr 2024 15:39:26 -0400 Subject: [PATCH] chore(lsp): revert respect shouldCreateNewSourceFile (#23535) Reverts https://github.com/denoland/deno/pull/23515 but adds a comment for why this is ignored --- cli/tsc/99_main_compiler.js | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) 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;