diff --git a/crates/languages/src/c.rs b/crates/languages/src/c.rs index 5957dde04d4fbf43763647675733cc0ecab3c9ab..3351c9df033a5e4550e34b5c9dbf1d119b189f6d 100644 --- a/crates/languages/src/c.rs +++ b/crates/languages/src/c.rs @@ -98,7 +98,7 @@ impl LspInstaller for CLspAdapter { }) .await .inspect_err(|err| { - log::warn!("Unable to run {binary_path:?} asset, redownloading: {err}",) + log::warn!("Unable to run {binary_path:?} asset, redownloading: {err:#}",) }) }; if let (Some(actual_digest), Some(expected_digest)) = diff --git a/crates/languages/src/python.rs b/crates/languages/src/python.rs index 1c28a7b36a74b66efb1f66e8914b78a48db8a339..3f25a5c5ce50d0aade7b1b575443b5d681f67c63 100644 --- a/crates/languages/src/python.rs +++ b/crates/languages/src/python.rs @@ -263,7 +263,7 @@ impl LspInstaller for TyLspAdapter { }) .await .inspect_err(|err| { - log::warn!("Unable to run {server_path:?} asset, redownloading: {err}",) + log::warn!("Unable to run {server_path:?} asset, redownloading: {err:#}",) }) }; if let (Some(actual_digest), Some(expected_digest)) = @@ -2176,7 +2176,7 @@ impl LspInstaller for RuffLspAdapter { }) .await .inspect_err(|err| { - log::warn!("Unable to run {server_path:?} asset, redownloading: {err}",) + log::warn!("Unable to run {server_path:?} asset, redownloading: {err:#}",) }) }; if let (Some(actual_digest), Some(expected_digest)) = diff --git a/crates/languages/src/rust.rs b/crates/languages/src/rust.rs index 5efbf46c7b59e923c01cba165b29fceec2869504..f1b205f83a6bd3a9b26cb39da854817ebba11361 100644 --- a/crates/languages/src/rust.rs +++ b/crates/languages/src/rust.rs @@ -529,7 +529,7 @@ impl LspInstaller for RustLspAdapter { }) .await .inspect_err(|err| { - log::warn!("Unable to run {server_path:?} asset, redownloading: {err}",) + log::warn!("Unable to run {server_path:?} asset, redownloading: {err:#}",) }) }; if let (Some(actual_digest), Some(expected_digest)) = diff --git a/crates/project/src/lsp_store.rs b/crates/project/src/lsp_store.rs index 379fafd211d69f5c925f37f0b30f2edff682cdc0..50f8c6695c188b065e89b4694e004470aa997abc 100644 --- a/crates/project/src/lsp_store.rs +++ b/crates/project/src/lsp_store.rs @@ -4519,7 +4519,6 @@ impl LspStore { ) { Ok(LspParamsOrResponse::Params(lsp_params)) => lsp_params, Ok(LspParamsOrResponse::Response(response)) => return Task::ready(Ok(response)), - Err(err) => { let message = format!( "{} via {} failed: {}", @@ -4527,7 +4526,10 @@ impl LspStore { language_server.name(), err ); - log::warn!("{message}"); + // rust-analyzer likes to error with this when its still loading up + if !message.ends_with("content modified") { + log::warn!("{message}"); + } return Task::ready(Err(anyhow!(message))); } }; @@ -4585,7 +4587,10 @@ impl LspStore { language_server.name(), err ); - log::warn!("{message}"); + // rust-analyzer likes to error with this when its still loading up + if !message.ends_with("content modified") { + log::warn!("{message}"); + } anyhow::anyhow!(message) })?; @@ -6907,6 +6912,8 @@ impl LspStore { let mut responses = Vec::new(); match server_task.await { Ok(response) => responses.push((server_id, response)), + // rust-analyzer likes to error with this when its still loading up + Err(e) if format!("{e:#}").ends_with("content modified") => (), Err(e) => log::error!( "Error handling response for inlay hints request: {e:#}" ), @@ -8433,7 +8440,7 @@ impl LspStore { match response_result { Ok(response) => responses.push((server_id, response)), // rust-analyzer likes to error with this when its still loading up - Err(e) if e.to_string().ends_with("content modified") => (), + Err(e) if format!("{e:#}").ends_with("content modified") => (), Err(e) => log::error!("Error handling response for request {request:?}: {e:#}"), } } @@ -12428,7 +12435,7 @@ impl LspStore { match server_task.await { Ok(response) => responses.push((server_id, response)), // rust-analyzer likes to error with this when its still loading up - Err(e) if e.to_string().ends_with("content modified") => (), + Err(e) if format!("{e:#}").ends_with("content modified") => (), Err(e) => log::error!( "Error handling response for request {request:?}: {e:#}" ), diff --git a/crates/vim/src/state.rs b/crates/vim/src/state.rs index dc9ac7104c00a5f49758dbab219ec72d46023b27..3f4fc99584f96754afc5342d299a502eb9a3dbad 100644 --- a/crates/vim/src/state.rs +++ b/crates/vim/src/state.rs @@ -310,8 +310,8 @@ impl MarksState { fn load(&mut self, cx: &mut Context) { cx.spawn(async move |this, cx| { - let Some(workspace_id) = this.update(cx, |this, cx| this.workspace_id(cx))? else { - return Ok(()); + let Some(workspace_id) = this.update(cx, |this, cx| this.workspace_id(cx)).ok()? else { + return None; }; let (marks, paths) = cx .background_spawn(async move { @@ -319,10 +319,12 @@ impl MarksState { let paths = DB.get_global_marks_paths(workspace_id)?; anyhow::Ok((marks, paths)) }) - .await?; + .await + .log_err()?; this.update(cx, |this, cx| this.loaded(marks, paths, cx)) + .ok() }) - .detach_and_log_err(cx); + .detach(); } fn loaded(