Skip to content

armgit / zed

Public Imported from GitHub
0

Code at the speed of thought – Zed is a high-performance, multiplayer code editor from the creators of Atom and Tree-sitter.

WIP

Nathan Sobo5dad97779afa
diff --git a/Cargo.lock b/Cargo.lock
index 775e1d2b8e3..6cf5d23d579 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -7378,6 +7378,7 @@ dependencies = [
"anyhow",
"gpui2",
"log",
+ "refineable",
"rust-embed",
"serde",
"settings",
diff --git a/crates/gpui2/src/style.rs b/crates/gpui2/src/style.rs
index e3e0f5b0c46..7cd497e85c4 100644
--- a/crates/gpui2/src/style.rs
+++ b/crates/gpui2/src/style.rs
@@ -22,6 +22,8 @@ use gpui2_macros::styleable_helpers;
use refineable::{Refineable, RefinementCascade};
use std::sync::Arc;
+pub type StyleCascade = RefinementCascade<Style>;
+
#[derive(Clone, Refineable, Debug)]
#[refineable(debug)]
pub struct Style {
diff --git a/crates/refineable/src/refineable.rs b/crates/refineable/src/refineable.rs
index 1223622f3c1..1ce42f9f176 100644
--- a/crates/refineable/src/refineable.rs
+++ b/crates/refineable/src/refineable.rs
@@ -17,6 +17,12 @@ pub trait Refineable: Clone {
{
Self::default().refined(refinement)
}
+ fn from_cascade(cascade: &RefinementCascade<Self>) -> Self
+ where
+ Self: Default + Sized,
+ {
+ Self::default().refined(&cascade.merged())
+ }
}
pub struct RefinementCascade<S: Refineable>(Vec<Option<S::Refinement>>);
diff --git a/crates/storybook/Cargo.toml b/crates/storybook/Cargo.toml
index f634ea4eca1..53b05100ef3 100644
--- a/crates/storybook/Cargo.toml
+++ b/crates/storybook/Cargo.toml
@@ -12,6 +12,7 @@ path = "src/storybook.rs"
gpui2 = { path = "../gpui2" }
anyhow.workspace = true
log.workspace = true
+refineable = { path = "../refineable" }
rust-embed.workspace = true
serde.workspace = true
settings = { path = "../settings" }
diff --git a/crates/storybook/build.rs b/crates/storybook/build.rs
new file mode 100644
index 00000000000..94602ec073d
--- /dev/null
+++ b/crates/storybook/build.rs
@@ -0,0 +1,5 @@
+fn main() {
+ // Find WebRTC.framework as a sibling of the executable when running outside of an application bundle.
+ // TODO: We shouldn't depend on WebRTC in editor
+ println!("cargo:rustc-link-arg=-Wl,-rpath,@executable_path");
+}