Show error and warning indicators in tabs (#21383)

Closes #21179

Release Notes:

- Add setting to display error and warning indicators in tabs.

<img width="454" alt="demo_with_icons"
src="https://github.com/user-attachments/assets/6002b4d4-dca8-4e2a-842d-1df3e281fcd2">
<img width="454" alt="demo_without_icons"
src="https://github.com/user-attachments/assets/df4b67bd-1a6c-4354-847e-d7fea95c1b7e">
This commit is contained in:
Nils Koch 2024-12-05 15:43:04 +01:00 committed by GitHub
parent 92dea066dd
commit 6ebd6c2893
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 131 additions and 38 deletions

View file

@ -42,6 +42,7 @@ pub struct ItemSettings {
pub close_position: ClosePosition,
pub activate_on_close: ActivateOnClose,
pub file_icons: bool,
pub show_diagnostics: ShowDiagnostics,
pub always_show_close_button: bool,
}
@ -60,6 +61,15 @@ pub enum ClosePosition {
Right,
}
#[derive(Copy, Clone, Debug, Default, Serialize, Deserialize, JsonSchema, PartialEq, Eq)]
#[serde(rename_all = "snake_case")]
pub enum ShowDiagnostics {
Off,
Errors,
#[default]
All,
}
#[derive(Clone, Default, Serialize, Deserialize, JsonSchema)]
#[serde(rename_all = "lowercase")]
pub enum ActivateOnClose {
@ -86,6 +96,11 @@ pub struct ItemSettingsContent {
///
/// Default: history
pub activate_on_close: Option<ActivateOnClose>,
/// Which files containing diagnostic errors/warnings to mark in the tabs.
/// This setting can take the following three values:
///
/// Default: all
show_diagnostics: Option<ShowDiagnostics>,
/// Whether to always show the close button on tabs.
///
/// Default: false