Shuffle code around to avoid an allocation

This commit is contained in:
Laurențiu Nicola
2021-09-13 20:58:09 +03:00
parent 8875f2c8aa
commit 4d7a3bb5c7
3 changed files with 50 additions and 60 deletions

View File

@@ -21,7 +21,7 @@ use crate::{
handlers, lsp_ext,
lsp_utils::{apply_document_changes, is_cancelled, notification_is, Progress},
mem_docs::DocumentData,
reload::{BuildDataProgress, ProjectWorkspaceProgress},
reload::{self, BuildDataProgress, ProjectWorkspaceProgress},
Result,
};
@@ -693,7 +693,9 @@ impl GlobalState {
flycheck.update();
}
if let Ok(abs_path) = from_proto::abs_path(&params.text_document.uri) {
this.maybe_refresh(&[(abs_path, ChangeKind::Modify)]);
if reload::should_refresh_for_change(&abs_path, ChangeKind::Modify) {
this.fetch_workspaces_queue.request_op();
}
}
Ok(())
})?