Start work on following in zed2

Co-authored-by: Nathan <nathan@zed.dev>
This commit is contained in:
Max Brunsfeld 2023-12-04 17:51:53 -08:00
parent 71a1125e88
commit eff3a72fb5
4 changed files with 245 additions and 167 deletions

View file

@ -2708,6 +2708,7 @@ pub enum ElementId {
Integer(usize),
Name(SharedString),
FocusHandle(FocusId),
NamedInteger(SharedString, usize),
}
impl ElementId {
@ -2757,3 +2758,9 @@ impl<'a> From<&'a FocusHandle> for ElementId {
ElementId::FocusHandle(handle.id)
}
}
impl From<(&'static str, EntityId)> for ElementId {
fn from((name, id): (&'static str, EntityId)) -> Self {
ElementId::NamedInteger(name.into(), id.as_u64() as usize)
}
}