Get diagnostics view almost building in the zed2 world
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
This commit is contained in:
@@ -2476,6 +2476,18 @@ pub enum ElementId {
|
||||
FocusHandle(FocusId),
|
||||
}
|
||||
|
||||
impl TryInto<SharedString> for ElementId {
|
||||
type Error = anyhow::Error;
|
||||
|
||||
fn try_into(self) -> anyhow::Result<SharedString> {
|
||||
if let ElementId::Name(name) = self {
|
||||
Ok(name)
|
||||
} else {
|
||||
Err(anyhow!("element id is not string"))
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl From<EntityId> for ElementId {
|
||||
fn from(id: EntityId) -> Self {
|
||||
ElementId::View(id)
|
||||
|
||||
Reference in New Issue
Block a user