diff options
| author | Nathan Whitaker <17734409+nathanwhit@users.noreply.github.com> | 2024-04-23 15:29:29 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-04-23 15:29:29 -0700 |
| commit | 5294885a5a411e6b2e9674ce9d8f951c9c011988 (patch) | |
| tree | 981ec02ca405868aaf2f7e4ae78bd3479ad01a8a /cli/tsc | |
| parent | cfa0fcd8c85803d0f5a235bb20f792eafc4b2f9c (diff) | |
fix(lsp): Fix logic for coalescing pending changes + clear script names cache when file is closed (#23517)
Diffstat (limited to 'cli/tsc')
| -rw-r--r-- | cli/tsc/99_main_compiler.js | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/cli/tsc/99_main_compiler.js b/cli/tsc/99_main_compiler.js index d09df7b0f..97378076a 100644 --- a/cli/tsc/99_main_compiler.js +++ b/cli/tsc/99_main_compiler.js @@ -1104,15 +1104,18 @@ delete Object.prototype.__proto__; projectVersionCache = newProjectVersion; let opened = false; + let closed = false; for (const { 0: script, 1: changeKind } of changedScripts) { - if (changeKind == ChangeKind.Opened) { + if (changeKind === ChangeKind.Opened) { opened = true; + } else if (changeKind === ChangeKind.Closed) { + closed = true; } scriptVersionCache.delete(script); sourceTextCache.delete(script); } - if (configChanged || opened) { + if (configChanged || opened || closed) { scriptFileNamesCache = undefined; } } |
