Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(lsp): Fix logic for coalescing pending changes + clear script names cache when file is closed #23517

Merged
merged 3 commits into from
Apr 23, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
Clear script file names cache on close
  • Loading branch information
nathanwhit committed Apr 23, 2024
commit ee3876a0da84925802c471f124d5bbc57a20ec31
7 changes: 5 additions & 2 deletions cli/tsc/99_main_compiler.js
Original file line number Diff line number Diff line change
Expand Up @@ -1100,15 +1100,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;
}
}
Expand Down