Improve flycheck and build script progress reporting

This commit is contained in:
Lukas Wirth 2025-06-26 14:02:59 +02:00
parent da1888a75c
commit 4ee90e97f6
2 changed files with 12 additions and 3 deletions

View file

@ -312,7 +312,9 @@ impl WorkspaceBuildScripts {
match message {
Message::BuildScriptExecuted(mut message) => {
with_output_for(&message.package_id.repr, &mut |name, data| {
progress(format!("running build-script: {name}"));
progress(format!(
"building compile-time-deps: build script {name} run"
));
let cfgs = {
let mut acc = Vec::new();
for cfg in &message.cfgs {
@ -343,7 +345,9 @@ impl WorkspaceBuildScripts {
}
Message::CompilerArtifact(message) => {
with_output_for(&message.package_id.repr, &mut |name, data| {
progress(format!("building proc-macros: {name}"));
progress(format!(
"building compile-time-deps: proc-macro {name} built"
));
if message.target.kind.contains(&cargo_metadata::TargetKind::ProcMacro)
{
// Skip rmeta file

View file

@ -6,6 +6,7 @@ use std::{fmt, io, process::Command, time::Duration};
use cargo_metadata::PackageId;
use crossbeam_channel::{Receiver, Sender, select_biased, unbounded};
use ide_db::FxHashSet;
use itertools::Itertools;
use paths::{AbsPath, AbsPathBuf, Utf8PathBuf};
use rustc_hash::FxHashMap;
use serde::Deserialize as _;
@ -379,7 +380,11 @@ impl FlycheckActor {
package_id = msg.package_id.repr,
"artifact received"
);
self.report_progress(Progress::DidCheckCrate(msg.target.name));
self.report_progress(Progress::DidCheckCrate(format!(
"{} ({})",
msg.target.name,
msg.target.kind.iter().format_with(", ", |kind, f| f(&kind)),
)));
let package_id = Arc::new(msg.package_id);
if self.diagnostics_cleared_for.insert(package_id.clone()) {
tracing::trace!(