feat(workspace): show git status on editor tabs

This commit is contained in:
Alex Viscreanu 2023-07-17 18:48:57 +02:00
parent 10a1df3faa
commit 6793d4b6b8
No known key found for this signature in database
6 changed files with 74 additions and 7 deletions

View file

@ -10,6 +10,9 @@ use gpui::{
ViewContext, ViewHandle, WeakViewHandle, WindowContext,
};
use project::{Project, ProjectEntryId, ProjectPath};
use schemars::JsonSchema;
use serde_derive::{Deserialize, Serialize};
use settings::Setting;
use smallvec::SmallVec;
use std::{
any::{Any, TypeId},
@ -27,6 +30,30 @@ use std::{
};
use theme::Theme;
#[derive(Deserialize)]
pub struct ItemSettings {
pub git_status: bool,
}
#[derive(Clone, Default, Serialize, Deserialize, JsonSchema)]
pub struct ItemSettingsContent {
git_status: Option<bool>,
}
impl Setting for ItemSettings {
const KEY: Option<&'static str> = Some("tabs");
type FileContent = ItemSettingsContent;
fn load(
default_value: &Self::FileContent,
user_values: &[&Self::FileContent],
_: &gpui::AppContext,
) -> anyhow::Result<Self> {
Self::load_via_json_merge(default_value, user_values)
}
}
#[derive(Eq, PartialEq, Hash, Debug)]
pub enum ItemEvent {
CloseItem,