Skip to content

Commit c626db0

Browse files
committed
Auto merge of #16883 - Veykril:progress-report, r=Veykril
minor: Do progress reporting for crate-graph construction Also fixes #16828
2 parents 4de0204 + 232125b commit c626db0

File tree

2 files changed

+17
-3
lines changed

2 files changed

+17
-3
lines changed

crates/rust-analyzer/src/main_loop.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -653,7 +653,7 @@ impl GlobalState {
653653
};
654654

655655
if let Some(state) = state {
656-
self.report_progress("Building", state, msg, None, None);
656+
self.report_progress("Building build-artifacts", state, msg, None, None);
657657
}
658658
}
659659
Task::LoadProcMacros(progress) => {
@@ -669,7 +669,7 @@ impl GlobalState {
669669
};
670670

671671
if let Some(state) = state {
672-
self.report_progress("Loading", state, msg, None, None);
672+
self.report_progress("Loading proc-macros", state, msg, None, None);
673673
}
674674
}
675675
Task::BuildDepsHaveChanged => self.build_deps_changed = true,
@@ -861,7 +861,7 @@ impl GlobalState {
861861
let title = if self.flycheck.len() == 1 {
862862
format!("{}", self.config.flycheck())
863863
} else {
864-
format!("cargo check (#{})", id + 1)
864+
format!("{} (#{})", self.config.flycheck(), id + 1)
865865
};
866866
self.report_progress(
867867
&title,

crates/rust-analyzer/src/reload.rs

+14
Original file line numberDiff line numberDiff line change
@@ -526,6 +526,13 @@ impl GlobalState {
526526
// crate graph construction relies on these paths, record them so when one of them gets
527527
// deleted or created we trigger a reconstruction of the crate graph
528528
let mut crate_graph_file_dependencies = FxHashSet::default();
529+
self.report_progress(
530+
"Building CrateGraph",
531+
crate::lsp::utils::Progress::Begin,
532+
None,
533+
None,
534+
None,
535+
);
529536

530537
let (crate_graph, proc_macro_paths, layouts, toolchains) = {
531538
// Create crate graph from all the workspaces
@@ -564,6 +571,13 @@ impl GlobalState {
564571
change.set_toolchains(toolchains);
565572
self.analysis_host.apply_change(change);
566573
self.crate_graph_file_dependencies = crate_graph_file_dependencies;
574+
self.report_progress(
575+
"Building CrateGraph",
576+
crate::lsp::utils::Progress::End,
577+
None,
578+
None,
579+
None,
580+
);
567581

568582
self.process_changes();
569583
self.reload_flycheck();

0 commit comments

Comments
 (0)