summaryrefslogtreecommitdiff
path: root/cli/tsc/99_main_compiler.js
diff options
context:
space:
mode:
authorDavid Sherret <dsherret@users.noreply.github.com>2024-04-23 18:16:26 -0400
committerGitHub <noreply@github.com>2024-04-23 22:16:26 +0000
commitcfa0fcd8c85803d0f5a235bb20f792eafc4b2f9c (patch)
treede991c2b005048c6b354225e9b831f050130d764 /cli/tsc/99_main_compiler.js
parent90a167a1a2bb52017a412897381b114db595afad (diff)
chore(lsp): respect shouldCreateNewSourceFile parameter (#23515)
Diffstat (limited to 'cli/tsc/99_main_compiler.js')
-rw-r--r--cli/tsc/99_main_compiler.js6
1 files changed, 5 insertions, 1 deletions
diff --git a/cli/tsc/99_main_compiler.js b/cli/tsc/99_main_compiler.js
index 59fa75d77..d09df7b0f 100644
--- a/cli/tsc/99_main_compiler.js
+++ b/cli/tsc/99_main_compiler.js
@@ -609,7 +609,7 @@ delete Object.prototype.__proto__;
specifier,
languageVersion,
_onError,
- _shouldCreateNewSourceFile,
+ shouldCreateNewSourceFile,
) {
if (logDebug) {
debug(
@@ -624,6 +624,10 @@ 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;