activity indicator: Reset formatting failure on click (#20029)
Release Notes: - N/A
This commit is contained in:
parent
293e080f03
commit
5b6401519b
3 changed files with 13 additions and 1 deletions
|
@ -352,7 +352,10 @@ impl ActivityIndicator {
|
||||||
.into_any_element(),
|
.into_any_element(),
|
||||||
),
|
),
|
||||||
message: format!("Formatting failed: {}. Click to see logs.", failure),
|
message: format!("Formatting failed: {}. Click to see logs.", failure),
|
||||||
on_click: Some(Arc::new(|_, cx| {
|
on_click: Some(Arc::new(|indicator, cx| {
|
||||||
|
indicator.project.update(cx, |project, cx| {
|
||||||
|
project.reset_last_formatting_failure(cx);
|
||||||
|
});
|
||||||
cx.dispatch_action(Box::new(workspace::OpenLog));
|
cx.dispatch_action(Box::new(workspace::OpenLog));
|
||||||
})),
|
})),
|
||||||
});
|
});
|
||||||
|
|
|
@ -5270,6 +5270,10 @@ impl LspStore {
|
||||||
self.last_formatting_failure.as_deref()
|
self.last_formatting_failure.as_deref()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
pub fn reset_last_formatting_failure(&mut self) {
|
||||||
|
self.last_formatting_failure = None;
|
||||||
|
}
|
||||||
|
|
||||||
pub fn environment_for_buffer(
|
pub fn environment_for_buffer(
|
||||||
&self,
|
&self,
|
||||||
buffer: &Model<Buffer>,
|
buffer: &Model<Buffer>,
|
||||||
|
|
|
@ -2414,6 +2414,11 @@ impl Project {
|
||||||
self.lsp_store.read(cx).last_formatting_failure()
|
self.lsp_store.read(cx).last_formatting_failure()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
pub fn reset_last_formatting_failure(&self, cx: &mut AppContext) {
|
||||||
|
self.lsp_store
|
||||||
|
.update(cx, |store, _| store.reset_last_formatting_failure());
|
||||||
|
}
|
||||||
|
|
||||||
pub fn update_diagnostics(
|
pub fn update_diagnostics(
|
||||||
&mut self,
|
&mut self,
|
||||||
language_server_id: LanguageServerId,
|
language_server_id: LanguageServerId,
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue