gpui: Add Global marker trait (#7095)
This should prevent a class of bugs where one queries the wrong type of global, which results in oddities at runtime. Release Notes: - N/A --------- Co-authored-by: Marshall <marshall@zed.dev> Co-authored-by: Marshall Bowers <elliott.codes@gmail.com>
This commit is contained in:
parent
7bfa584eb6
commit
e6ebe7974d
59 changed files with 449 additions and 237 deletions
|
@ -2,7 +2,7 @@ use std::{path::Path, str, sync::Arc};
|
|||
|
||||
use collections::HashMap;
|
||||
|
||||
use gpui::{AppContext, AssetSource};
|
||||
use gpui::{AppContext, AssetSource, Global};
|
||||
use serde_derive::Deserialize;
|
||||
use util::{maybe, paths::PathExt};
|
||||
|
||||
|
@ -17,6 +17,8 @@ pub struct FileAssociations {
|
|||
types: HashMap<String, TypeConfig>,
|
||||
}
|
||||
|
||||
impl Global for FileAssociations {}
|
||||
|
||||
const COLLAPSED_DIRECTORY_TYPE: &'static str = "collapsed_folder";
|
||||
const EXPANDED_DIRECTORY_TYPE: &'static str = "expanded_folder";
|
||||
const COLLAPSED_CHEVRON_TYPE: &'static str = "collapsed_chevron";
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue