Notify users instead of logging generic lsp errors

This commit is contained in:
Dennis Dang 2024-12-09 03:37:04 -05:00
parent 1b83020dc8
commit 1e697cae78

View file

@ -3486,6 +3486,7 @@ impl LspStore {
let lsp_request = language_server.request::<R::LspRequest>(lsp_params);
let id = lsp_request.id();
let _cleanup = if status.is_some() {
cx.update(|cx| {
this.update(cx, |this, cx| {
@ -3525,11 +3526,19 @@ impl LspStore {
let result = lsp_request.await;
let response = result.map_err(|err| {
cx.update(|cx| {
this.update(cx, |_, cx| {
cx.emit(LspStoreEvent::Notification(err.to_string()));
})
})
.log_err();
log::warn!(
"Generic lsp request to {} failed: {}",
language_server.name(),
err
);
err
})?;