Call out language server logs specifically in status bar

This commit is contained in:
Lukas Wirth 2025-08-15 10:57:42 +02:00
parent a6b199c1a8
commit 0ac01467cd
3 changed files with 5 additions and 5 deletions

View file

@ -319,7 +319,7 @@ impl WorkspaceBuildScripts {
}
fn run_command(
cmd: Command,
mut cmd: Command,
// ideally this would be something like:
// with_output_for: impl FnMut(&str, dyn FnOnce(&mut BuildScriptOutput)),
// but owned trait objects aren't a thing
@ -335,7 +335,7 @@ impl WorkspaceBuildScripts {
tracing::info!("Running build scripts: {:?}", cmd);
let output = stdx::process::spawn_with_streaming_output(
cmd,
&mut cmd,
&mut |line| {
// Copy-pasted from existing cargo_metadata. It seems like we
// should be using serde_stacker here?
@ -418,7 +418,7 @@ impl WorkspaceBuildScripts {
let errors = if !output.status.success() {
let errors = errors.into_inner();
Some(if errors.is_empty() { "cargo check failed".to_owned() } else { errors })
Some(if errors.is_empty() { format!("`{cmd:?}` failed") } else { errors })
} else {
None
};

View file

@ -152,7 +152,7 @@ impl GlobalState {
if self.fetch_build_data_error().is_err() {
status.health |= lsp_ext::Health::Warning;
message.push_str("Failed to run build scripts of some packages.\n\n");
message.push_str("Please refer to the logs for more details on the errors.");
message.push_str("Please refer to the language server logs for more details.");
}
if let Some(err) = &self.config_errors {
status.health |= lsp_ext::Health::Warning;

View file

@ -58,7 +58,7 @@ pub fn streaming_output(
///
/// Panics if `cmd` is not configured to have `stdout` and `stderr` as `piped`.
pub fn spawn_with_streaming_output(
mut cmd: Command,
cmd: &mut Command,
on_stdout_line: &mut dyn FnMut(&str),
on_stderr_line: &mut dyn FnMut(&str),
) -> io::Result<Output> {