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

perf(lsp): fix redundant file reads #20802

Merged
merged 3 commits into from
Oct 12, 2023
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
Prev Previous commit
review
  • Loading branch information
nayeemrmn committed Oct 12, 2023
commit a4fbbbbde74b25e59c551b7ab100daffda3763cd
5 changes: 3 additions & 2 deletions cli/lsp/documents.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1012,10 +1012,11 @@ impl Documents {
}

pub fn save(&mut self, specifier: &ModuleSpecifier) {
let Some(doc) = self.open_docs.get(specifier).cloned().or_else(|| {
let doc = self.open_docs.get(specifier).cloned().or_else(|| {
let mut file_system_docs = self.file_system_docs.lock();
file_system_docs.docs.remove(specifier)
}) else {
});
let Some(doc) = doc else {
return;
};
self.dirty = true;
Expand Down