Skip to content

Commit 5e22c4c

Browse files
committed
chore: show error message if command execution fails
1 parent 139f215 commit 5e22c4c

File tree

1 file changed

+10
-4
lines changed

1 file changed

+10
-4
lines changed

src/app/lsp_server.rs

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -279,10 +279,16 @@ where
279279
.map(|_| None),
280280
};
281281

282-
result.map_err(|mut e: Error| {
283-
e.message = format!("error calling command: '{command}': {e}").into();
284-
e
285-
})
282+
match result {
283+
Ok(_) => result,
284+
Err(mut e) => {
285+
self.command_executor
286+
.show_message(MessageType::ERROR, e.to_string().as_str())
287+
.await;
288+
e.message = format!("error calling command: '{command}': {e}").into();
289+
Err(e)
290+
}
291+
}
286292
}
287293

288294
async fn shutdown(&self) -> Result<()> {

0 commit comments

Comments
 (0)