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.

Checkpoint

Antonio Scandurrae4fe9538d7d8
diff --git a/Cargo.lock b/Cargo.lock
index 5c879114915..f4294b6165d 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -3272,7 +3272,7 @@ dependencies = [
]
[[package]]
-name = "gpui3"
+name = "gpui2"
version = "0.1.0"
dependencies = [
"anyhow",
@@ -3295,7 +3295,7 @@ dependencies = [
"font-kit",
"foreign-types",
"futures 0.3.28",
- "gpui3_macros",
+ "gpui2_macros",
"gpui_macros",
"image",
"itertools 0.10.5",
@@ -3337,7 +3337,7 @@ dependencies = [
]
[[package]]
-name = "gpui3_macros"
+name = "gpui2_macros"
version = "0.1.0"
dependencies = [
"proc-macro2",
@@ -7788,7 +7788,7 @@ dependencies = [
"backtrace-on-stack-overflow",
"chrono",
"clap 4.4.4",
- "gpui3",
+ "gpui2",
"itertools 0.11.0",
"log",
"rust-embed",
@@ -9012,7 +9012,7 @@ version = "0.1.0"
dependencies = [
"anyhow",
"chrono",
- "gpui3",
+ "gpui2",
"itertools 0.11.0",
"rand 0.8.5",
"serde",
diff --git a/Cargo.toml b/Cargo.toml
index 16907100a07..cdc767dce72 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -34,8 +34,8 @@ members = [
"crates/go_to_line",
"crates/gpui",
"crates/gpui_macros",
- "crates/gpui3",
- "crates/gpui3_macros",
+ "crates/gpui2",
+ "crates/gpui2_macros",
"crates/install_cli",
"crates/journal",
"crates/language",
diff --git a/crates/gpui3/Cargo.toml b/crates/gpui2/Cargo.toml
similarity index 96%
rename from crates/gpui3/Cargo.toml
rename to crates/gpui2/Cargo.toml
index e8ba5def502..7743ebad513 100644
--- a/crates/gpui3/Cargo.toml
+++ b/crates/gpui2/Cargo.toml
@@ -1,5 +1,5 @@
[package]
-name = "gpui3"
+name = "gpui2"
version = "0.1.0"
edition = "2021"
authors = ["Nathan Sobo <[email protected]>"]
@@ -10,13 +10,13 @@ publish = false
test = ["backtrace", "dhat", "env_logger", "collections/test-support", "util/test-support"]
[lib]
-path = "src/gpui3.rs"
+path = "src/gpui2.rs"
doctest = false
[dependencies]
collections = { path = "../collections" }
gpui_macros = { path = "../gpui_macros" }
-gpui3_macros = { path = "../gpui3_macros" }
+gpui2_macros = { path = "../gpui2_macros" }
util = { path = "../util" }
sum_tree = { path = "../sum_tree" }
sqlez = { path = "../sqlez" }
diff --git a/crates/gpui3/build.rs b/crates/gpui2/build.rs
similarity index 100%
rename from crates/gpui3/build.rs
rename to crates/gpui2/build.rs
diff --git a/crates/gpui3/src/action.rs b/crates/gpui2/src/action.rs
similarity index 100%
rename from crates/gpui3/src/action.rs
rename to crates/gpui2/src/action.rs
diff --git a/crates/gpui3/src/app.rs b/crates/gpui2/src/app.rs
similarity index 100%
rename from crates/gpui3/src/app.rs
rename to crates/gpui2/src/app.rs
diff --git a/crates/gpui3/src/app/async_context.rs b/crates/gpui2/src/app/async_context.rs
similarity index 100%
rename from crates/gpui3/src/app/async_context.rs
rename to crates/gpui2/src/app/async_context.rs
diff --git a/crates/gpui3/src/app/entity_map.rs b/crates/gpui2/src/app/entity_map.rs
similarity index 100%
rename from crates/gpui3/src/app/entity_map.rs
rename to crates/gpui2/src/app/entity_map.rs
diff --git a/crates/gpui3/src/app/model_context.rs b/crates/gpui2/src/app/model_context.rs
similarity index 100%
rename from crates/gpui3/src/app/model_context.rs
rename to crates/gpui2/src/app/model_context.rs
diff --git a/crates/gpui3/src/assets.rs b/crates/gpui2/src/assets.rs
similarity index 100%
rename from crates/gpui3/src/assets.rs
rename to crates/gpui2/src/assets.rs
diff --git a/crates/gpui3/src/color.rs b/crates/gpui2/src/color.rs
similarity index 100%
rename from crates/gpui3/src/color.rs
rename to crates/gpui2/src/color.rs
diff --git a/crates/gpui3/src/element.rs b/crates/gpui2/src/element.rs
similarity index 100%
rename from crates/gpui3/src/element.rs
rename to crates/gpui2/src/element.rs
diff --git a/crates/gpui3/src/elements.rs b/crates/gpui2/src/elements.rs
similarity index 100%
rename from crates/gpui3/src/elements.rs
rename to crates/gpui2/src/elements.rs
diff --git a/crates/gpui3/src/elements/div.rs b/crates/gpui2/src/elements/div.rs
similarity index 100%
rename from crates/gpui3/src/elements/div.rs
rename to crates/gpui2/src/elements/div.rs
diff --git a/crates/gpui3/src/elements/img.rs b/crates/gpui2/src/elements/img.rs
similarity index 100%
rename from crates/gpui3/src/elements/img.rs
rename to crates/gpui2/src/elements/img.rs
diff --git a/crates/gpui3/src/elements/svg.rs b/crates/gpui2/src/elements/svg.rs
similarity index 100%
rename from crates/gpui3/src/elements/svg.rs
rename to crates/gpui2/src/elements/svg.rs
diff --git a/crates/gpui3/src/elements/text.rs b/crates/gpui2/src/elements/text.rs
similarity index 100%
rename from crates/gpui3/src/elements/text.rs
rename to crates/gpui2/src/elements/text.rs
diff --git a/crates/gpui3/src/executor.rs b/crates/gpui2/src/executor.rs
similarity index 100%
rename from crates/gpui3/src/executor.rs
rename to crates/gpui2/src/executor.rs
diff --git a/crates/gpui3/src/focusable.rs b/crates/gpui2/src/focusable.rs
similarity index 100%
rename from crates/gpui3/src/focusable.rs
rename to crates/gpui2/src/focusable.rs
diff --git a/crates/gpui3/src/geometry.rs b/crates/gpui2/src/geometry.rs
similarity index 100%
rename from crates/gpui3/src/geometry.rs
rename to crates/gpui2/src/geometry.rs
diff --git a/crates/gpui3/src/gpui3.rs b/crates/gpui2/src/gpui2.rs
similarity index 99%
rename from crates/gpui3/src/gpui3.rs
rename to crates/gpui2/src/gpui2.rs
index fcd21598f22..da1790199ec 100644
--- a/crates/gpui3/src/gpui3.rs
+++ b/crates/gpui2/src/gpui2.rs
@@ -32,7 +32,7 @@ pub use elements::*;
pub use executor::*;
pub use focusable::*;
pub use geometry::*;
-pub use gpui3_macros::*;
+pub use gpui2_macros::*;
pub use image_cache::*;
pub use interactive::*;
pub use keymap::*;
diff --git a/crates/gpui3/src/image_cache.rs b/crates/gpui2/src/image_cache.rs
similarity index 100%
rename from crates/gpui3/src/image_cache.rs
rename to crates/gpui2/src/image_cache.rs
diff --git a/crates/gpui3/src/interactive.rs b/crates/gpui2/src/interactive.rs
similarity index 100%
rename from crates/gpui3/src/interactive.rs
rename to crates/gpui2/src/interactive.rs
diff --git a/crates/gpui3/src/keymap/binding.rs b/crates/gpui2/src/keymap/binding.rs
similarity index 100%
rename from crates/gpui3/src/keymap/binding.rs
rename to crates/gpui2/src/keymap/binding.rs
diff --git a/crates/gpui3/src/keymap/keymap.rs b/crates/gpui2/src/keymap/keymap.rs
similarity index 100%
rename from crates/gpui3/src/keymap/keymap.rs
rename to crates/gpui2/src/keymap/keymap.rs
diff --git a/crates/gpui3/src/keymap/matcher.rs b/crates/gpui2/src/keymap/matcher.rs
similarity index 100%
rename from crates/gpui3/src/keymap/matcher.rs
rename to crates/gpui2/src/keymap/matcher.rs
diff --git a/crates/gpui3/src/keymap/mod.rs b/crates/gpui2/src/keymap/mod.rs
similarity index 100%
rename from crates/gpui3/src/keymap/mod.rs
rename to crates/gpui2/src/keymap/mod.rs
diff --git a/crates/gpui3/src/platform.rs b/crates/gpui2/src/platform.rs
similarity index 100%
rename from crates/gpui3/src/platform.rs
rename to crates/gpui2/src/platform.rs
diff --git a/crates/gpui3/src/platform/keystroke.rs b/crates/gpui2/src/platform/keystroke.rs
similarity index 100%
rename from crates/gpui3/src/platform/keystroke.rs
rename to crates/gpui2/src/platform/keystroke.rs
diff --git a/crates/gpui3/src/platform/mac.rs b/crates/gpui2/src/platform/mac.rs
similarity index 100%
rename from crates/gpui3/src/platform/mac.rs
rename to crates/gpui2/src/platform/mac.rs
diff --git a/crates/gpui3/src/platform/mac/dispatch.h b/crates/gpui2/src/platform/mac/dispatch.h
similarity index 100%
rename from crates/gpui3/src/platform/mac/dispatch.h
rename to crates/gpui2/src/platform/mac/dispatch.h
diff --git a/crates/gpui3/src/platform/mac/dispatcher.rs b/crates/gpui2/src/platform/mac/dispatcher.rs
similarity index 100%
rename from crates/gpui3/src/platform/mac/dispatcher.rs
rename to crates/gpui2/src/platform/mac/dispatcher.rs
diff --git a/crates/gpui3/src/platform/mac/display.rs b/crates/gpui2/src/platform/mac/display.rs
similarity index 100%
rename from crates/gpui3/src/platform/mac/display.rs
rename to crates/gpui2/src/platform/mac/display.rs
diff --git a/crates/gpui3/src/platform/mac/display_linker.rs b/crates/gpui2/src/platform/mac/display_linker.rs
similarity index 100%
rename from crates/gpui3/src/platform/mac/display_linker.rs
rename to crates/gpui2/src/platform/mac/display_linker.rs
diff --git a/crates/gpui3/src/platform/mac/events.rs b/crates/gpui2/src/platform/mac/events.rs
similarity index 100%
rename from crates/gpui3/src/platform/mac/events.rs
rename to crates/gpui2/src/platform/mac/events.rs
diff --git a/crates/gpui3/src/platform/mac/metal_atlas.rs b/crates/gpui2/src/platform/mac/metal_atlas.rs
similarity index 100%
rename from crates/gpui3/src/platform/mac/metal_atlas.rs
rename to crates/gpui2/src/platform/mac/metal_atlas.rs
diff --git a/crates/gpui3/src/platform/mac/metal_renderer.rs b/crates/gpui2/src/platform/mac/metal_renderer.rs
similarity index 100%
rename from crates/gpui3/src/platform/mac/metal_renderer.rs
rename to crates/gpui2/src/platform/mac/metal_renderer.rs
diff --git a/crates/gpui3/src/platform/mac/open_type.rs b/crates/gpui2/src/platform/mac/open_type.rs
similarity index 100%
rename from crates/gpui3/src/platform/mac/open_type.rs
rename to crates/gpui2/src/platform/mac/open_type.rs
diff --git a/crates/gpui3/src/platform/mac/platform.rs b/crates/gpui2/src/platform/mac/platform.rs
similarity index 100%
rename from crates/gpui3/src/platform/mac/platform.rs
rename to crates/gpui2/src/platform/mac/platform.rs
diff --git a/crates/gpui3/src/platform/mac/shaders.metal b/crates/gpui2/src/platform/mac/shaders.metal
similarity index 100%
rename from crates/gpui3/src/platform/mac/shaders.metal
rename to crates/gpui2/src/platform/mac/shaders.metal
diff --git a/crates/gpui3/src/platform/mac/text_system.rs b/crates/gpui2/src/platform/mac/text_system.rs
similarity index 100%
rename from crates/gpui3/src/platform/mac/text_system.rs
rename to crates/gpui2/src/platform/mac/text_system.rs
diff --git a/crates/gpui3/src/platform/mac/window.rs b/crates/gpui2/src/platform/mac/window.rs
similarity index 100%
rename from crates/gpui3/src/platform/mac/window.rs
rename to crates/gpui2/src/platform/mac/window.rs
diff --git a/crates/gpui3/src/platform/mac/window_appearence.rs b/crates/gpui2/src/platform/mac/window_appearence.rs
similarity index 100%
rename from crates/gpui3/src/platform/mac/window_appearence.rs
rename to crates/gpui2/src/platform/mac/window_appearence.rs
diff --git a/crates/gpui3/src/platform/test.rs b/crates/gpui2/src/platform/test.rs
similarity index 100%
rename from crates/gpui3/src/platform/test.rs
rename to crates/gpui2/src/platform/test.rs
diff --git a/crates/gpui3/src/scene.rs b/crates/gpui2/src/scene.rs
similarity index 100%
rename from crates/gpui3/src/scene.rs
rename to crates/gpui2/src/scene.rs
diff --git a/crates/gpui3/src/style.rs b/crates/gpui2/src/style.rs
similarity index 100%
rename from crates/gpui3/src/style.rs
rename to crates/gpui2/src/style.rs
diff --git a/crates/gpui3/src/styled.rs b/crates/gpui2/src/styled.rs
similarity index 99%
rename from crates/gpui3/src/styled.rs
rename to crates/gpui2/src/styled.rs
index 00a68753b67..54463e884bf 100644
--- a/crates/gpui3/src/styled.rs
+++ b/crates/gpui2/src/styled.rs
@@ -1,5 +1,5 @@
use crate::{
- self as gpui3, hsla, point, px, relative, rems, AlignItems, DefiniteLength, Display, Fill,
+ self as gpui2, hsla, point, px, relative, rems, AlignItems, DefiniteLength, Display, Fill,
FlexDirection, Hsla, JustifyContent, Length, Position, Rems, SharedString, StyleRefinement,
};
use crate::{BoxShadow, TextStyleRefinement};
@@ -8,7 +8,7 @@ use smallvec::smallvec;
pub trait Styled {
fn style(&mut self) -> &mut StyleRefinement;
- gpui3_macros::style_helpers!();
+ gpui2_macros::style_helpers!();
/// Sets the size of the element to the full width and height.
fn full(mut self) -> Self
diff --git a/crates/gpui3/src/subscription.rs b/crates/gpui2/src/subscription.rs
similarity index 100%
rename from crates/gpui3/src/subscription.rs
rename to crates/gpui2/src/subscription.rs
diff --git a/crates/gpui3/src/svg_renderer.rs b/crates/gpui2/src/svg_renderer.rs
similarity index 100%
rename from crates/gpui3/src/svg_renderer.rs
rename to crates/gpui2/src/svg_renderer.rs
diff --git a/crates/gpui3/src/taffy.rs b/crates/gpui2/src/taffy.rs
similarity index 100%
rename from crates/gpui3/src/taffy.rs
rename to crates/gpui2/src/taffy.rs
diff --git a/crates/gpui3/src/text_system.rs b/crates/gpui2/src/text_system.rs
similarity index 100%
rename from crates/gpui3/src/text_system.rs
rename to crates/gpui2/src/text_system.rs
diff --git a/crates/gpui3/src/text_system/font_features.rs b/crates/gpui2/src/text_system/font_features.rs
similarity index 100%
rename from crates/gpui3/src/text_system/font_features.rs
rename to crates/gpui2/src/text_system/font_features.rs
diff --git a/crates/gpui3/src/text_system/line.rs b/crates/gpui2/src/text_system/line.rs
similarity index 100%
rename from crates/gpui3/src/text_system/line.rs
rename to crates/gpui2/src/text_system/line.rs
diff --git a/crates/gpui3/src/text_system/line_layout.rs b/crates/gpui2/src/text_system/line_layout.rs
similarity index 100%
rename from crates/gpui3/src/text_system/line_layout.rs
rename to crates/gpui2/src/text_system/line_layout.rs
diff --git a/crates/gpui3/src/text_system/line_wrapper.rs b/crates/gpui2/src/text_system/line_wrapper.rs
similarity index 100%
rename from crates/gpui3/src/text_system/line_wrapper.rs
rename to crates/gpui2/src/text_system/line_wrapper.rs
diff --git a/crates/gpui3/src/util.rs b/crates/gpui2/src/util.rs
similarity index 100%
rename from crates/gpui3/src/util.rs
rename to crates/gpui2/src/util.rs
diff --git a/crates/gpui3/src/view.rs b/crates/gpui2/src/view.rs
similarity index 100%
rename from crates/gpui3/src/view.rs
rename to crates/gpui2/src/view.rs
diff --git a/crates/gpui3/src/window.rs b/crates/gpui2/src/window.rs
similarity index 100%
rename from crates/gpui3/src/window.rs
rename to crates/gpui2/src/window.rs
diff --git a/crates/gpui3_macros/Cargo.toml b/crates/gpui2_macros/Cargo.toml
similarity index 75%
rename from crates/gpui3_macros/Cargo.toml
rename to crates/gpui2_macros/Cargo.toml
index ed77023266a..eb44334095d 100644
--- a/crates/gpui3_macros/Cargo.toml
+++ b/crates/gpui2_macros/Cargo.toml
@@ -1,11 +1,11 @@
[package]
-name = "gpui3_macros"
+name = "gpui2_macros"
version = "0.1.0"
edition = "2021"
publish = false
[lib]
-path = "src/gpui3_macros.rs"
+path = "src/gpui2_macros.rs"
proc-macro = true
[dependencies]
diff --git a/crates/gpui3_macros/src/derive_element.rs b/crates/gpui2_macros/src/derive_element.rs
similarity index 78%
rename from crates/gpui3_macros/src/derive_element.rs
rename to crates/gpui2_macros/src/derive_element.rs
index 41861836ba1..3f6b053aa06 100644
--- a/crates/gpui3_macros/src/derive_element.rs
+++ b/crates/gpui2_macros/src/derive_element.rs
@@ -39,21 +39,21 @@ pub fn derive_element(input: TokenStream) -> TokenStream {
let (impl_generics, ty_generics, where_clause) = ast.generics.split_for_impl();
let gen = quote! {
- impl #impl_generics gpui3::IntoAnyElement<#state_type> for #type_name #ty_generics
+ impl #impl_generics gpui2::IntoAnyElement<#state_type> for #type_name #ty_generics
#where_clause
{
- fn into_any(self) -> gpui3::AnyElement<#state_type> {
- gpui3::AnyElement::new(self)
+ fn into_any(self) -> gpui2::AnyElement<#state_type> {
+ gpui2::AnyElement::new(self)
}
}
- impl #impl_generics gpui3::Element for #type_name #ty_generics
+ impl #impl_generics gpui2::Element for #type_name #ty_generics
#where_clause
{
type ViewState = #state_type;
- type ElementState = gpui3::AnyElement<#state_type>;
+ type ElementState = gpui2::AnyElement<#state_type>;
- fn id(&self) -> Option<gpui3::ElementId> {
+ fn id(&self) -> Option<gpui2::ElementId> {
None
}
@@ -61,9 +61,9 @@ pub fn derive_element(input: TokenStream) -> TokenStream {
&mut self,
view_state: &mut Self::ViewState,
_: Option<Self::ElementState>,
- cx: &mut gpui3::ViewContext<Self::ViewState>
+ cx: &mut gpui2::ViewContext<Self::ViewState>
) -> Self::ElementState {
- use gpui3::IntoAnyElement;
+ use gpui2::IntoAnyElement;
let mut element = self.render(view_state, cx).into_any();
element.initialize(view_state, cx);
@@ -74,17 +74,17 @@ pub fn derive_element(input: TokenStream) -> TokenStream {
&mut self,
view_state: &mut Self::ViewState,
rendered_element: &mut Self::ElementState,
- cx: &mut gpui3::ViewContext<Self::ViewState>,
- ) -> gpui3::LayoutId {
+ cx: &mut gpui2::ViewContext<Self::ViewState>,
+ ) -> gpui2::LayoutId {
rendered_element.layout(view_state, cx)
}
fn paint(
&mut self,
- bounds: gpui3::Bounds<gpui3::Pixels>,
+ bounds: gpui2::Bounds<gpui2::Pixels>,
view_state: &mut Self::ViewState,
rendered_element: &mut Self::ElementState,
- cx: &mut gpui3::ViewContext<Self::ViewState>,
+ cx: &mut gpui2::ViewContext<Self::ViewState>,
) {
rendered_element.paint(view_state, cx)
}
diff --git a/crates/gpui3_macros/src/gpui3_macros.rs b/crates/gpui2_macros/src/gpui2_macros.rs
similarity index 100%
rename from crates/gpui3_macros/src/gpui3_macros.rs
rename to crates/gpui2_macros/src/gpui2_macros.rs
diff --git a/crates/gpui3_macros/src/style_helpers.rs b/crates/gpui2_macros/src/style_helpers.rs
similarity index 99%
rename from crates/gpui3_macros/src/style_helpers.rs
rename to crates/gpui2_macros/src/style_helpers.rs
index 8a6e7b99afc..e9e061722f4 100644
--- a/crates/gpui3_macros/src/style_helpers.rs
+++ b/crates/gpui2_macros/src/style_helpers.rs
@@ -123,7 +123,7 @@ fn generate_predefined_setter(
.iter()
.map(|field_tokens| {
quote! {
- style.#field_tokens = Some((#negation_token gpui3::#length_tokens).into());
+ style.#field_tokens = Some((#negation_token gpui2::#length_tokens).into());
}
})
.collect::<Vec<_>>();
@@ -163,7 +163,7 @@ fn generate_custom_value_setter(
let method = quote! {
#[doc = #doc_string]
- fn #method_name(mut self, length: impl std::clone::Clone + Into<gpui3::#length_type>) -> Self where Self: std::marker::Sized {
+ fn #method_name(mut self, length: impl std::clone::Clone + Into<gpui2::#length_type>) -> Self where Self: std::marker::Sized {
let style = self.style();
#(#field_assignments)*
self
diff --git a/crates/storybook2/Cargo.toml b/crates/storybook2/Cargo.toml
index f51095e3548..e9e85415ca7 100644
--- a/crates/storybook2/Cargo.toml
+++ b/crates/storybook2/Cargo.toml
@@ -14,7 +14,7 @@ anyhow.workspace = true
backtrace-on-stack-overflow = "0.3.0"
clap = { version = "4.4", features = ["derive", "string"] }
chrono = "0.4"
-gpui3 = { path = "../gpui3" }
+gpui2 = { path = "../gpui2" }
itertools = "0.11.0"
log.workspace = true
rust-embed.workspace = true
@@ -28,4 +28,4 @@ ui = { package = "ui2", path = "../ui2", features = ["stories"] }
util = { path = "../util" }
[dev-dependencies]
-gpui3 = { path = "../gpui3", features = ["test"] }
+gpui2 = { path = "../gpui2", features = ["test"] }
diff --git a/crates/storybook2/src/assets.rs b/crates/storybook2/src/assets.rs
index e07ad7a7478..76e853c0aac 100644
--- a/crates/storybook2/src/assets.rs
+++ b/crates/storybook2/src/assets.rs
@@ -1,7 +1,7 @@
use std::borrow::Cow;
use anyhow::{anyhow, Result};
-use gpui3::{AssetSource, SharedString};
+use gpui2::{AssetSource, SharedString};
use rust_embed::RustEmbed;
#[derive(RustEmbed)]
diff --git a/crates/storybook2/src/stories/focus.rs b/crates/storybook2/src/stories/focus.rs
index f142663cbd4..cf9e669a2bc 100644
--- a/crates/storybook2/src/stories/focus.rs
+++ b/crates/storybook2/src/stories/focus.rs
@@ -1,5 +1,5 @@
use crate::themes::rose_pine;
-use gpui3::{
+use gpui2::{
div, view, Context, Focusable, KeyBinding, ParentElement, StatelessInteractive, Styled, View,
WindowContext,
};
diff --git a/crates/storybook2/src/stories/kitchen_sink.rs b/crates/storybook2/src/stories/kitchen_sink.rs
index 99798a6383f..e7c4e752f6f 100644
--- a/crates/storybook2/src/stories/kitchen_sink.rs
+++ b/crates/storybook2/src/stories/kitchen_sink.rs
@@ -1,4 +1,4 @@
-use gpui3::{view, Context, View};
+use gpui2::{view, Context, View};
use strum::IntoEnumIterator;
use ui::prelude::*;
diff --git a/crates/storybook2/src/stories/scroll.rs b/crates/storybook2/src/stories/scroll.rs
index 1c80a449321..c5df3bd3d31 100644
--- a/crates/storybook2/src/stories/scroll.rs
+++ b/crates/storybook2/src/stories/scroll.rs
@@ -1,5 +1,5 @@
use crate::themes::rose_pine;
-use gpui3::{
+use gpui2::{
div, px, view, Context, Element, ParentElement, SharedString, Styled, View, WindowContext,
};
use ui::ElementExt;
diff --git a/crates/storybook2/src/stories/text.rs b/crates/storybook2/src/stories/text.rs
index ebbcbc14469..d66b5ce6092 100644
--- a/crates/storybook2/src/stories/text.rs
+++ b/crates/storybook2/src/stories/text.rs
@@ -1,4 +1,4 @@
-use gpui3::{div, view, white, Context, ParentElement, Styled, View, WindowContext};
+use gpui2::{div, view, white, Context, ParentElement, Styled, View, WindowContext};
pub struct TextStory {
text: View<()>,
diff --git a/crates/storybook2/src/stories/z_index.rs b/crates/storybook2/src/stories/z_index.rs
index d729b75c2a5..9dd74b6884d 100644
--- a/crates/storybook2/src/stories/z_index.rs
+++ b/crates/storybook2/src/stories/z_index.rs
@@ -1,6 +1,6 @@
use std::marker::PhantomData;
-use gpui3::{px, rgb, Div, Hsla};
+use gpui2::{px, rgb, Div, Hsla};
use ui::prelude::*;
use crate::story::Story;
diff --git a/crates/storybook2/src/story_selector.rs b/crates/storybook2/src/story_selector.rs
index 14edce568e0..4686a2226e8 100644
--- a/crates/storybook2/src/story_selector.rs
+++ b/crates/storybook2/src/story_selector.rs
@@ -5,7 +5,7 @@ use crate::stories::*;
use anyhow::anyhow;
use clap::builder::PossibleValue;
use clap::ValueEnum;
-use gpui3::{view, AnyView, Context};
+use gpui2::{view, AnyView, Context};
use strum::{EnumIter, EnumString, IntoEnumIterator};
use ui::prelude::*;
diff --git a/crates/storybook2/src/storybook2.rs b/crates/storybook2/src/storybook2.rs
index 4beca32ca18..353e12f8c18 100644
--- a/crates/storybook2/src/storybook2.rs
+++ b/crates/storybook2/src/storybook2.rs
@@ -9,7 +9,7 @@ mod themes;
use std::sync::Arc;
use clap::Parser;
-use gpui3::{
+use gpui2::{
div, px, size, view, AnyView, BorrowAppContext, Bounds, Context, Element, ViewContext,
WindowBounds, WindowOptions,
};
@@ -53,7 +53,7 @@ fn main() {
let theme = themes::load_theme(theme_name).unwrap();
let asset_source = Arc::new(Assets);
- gpui3::App::production(asset_source).run(move |cx| {
+ gpui2::App::production(asset_source).run(move |cx| {
let selector =
story_selector.unwrap_or(StorySelector::Component(ComponentStory::Workspace));
diff --git a/crates/storybook2/src/themes.rs b/crates/storybook2/src/themes.rs
index 8a677952ed3..ade7cbea87d 100644
--- a/crates/storybook2/src/themes.rs
+++ b/crates/storybook2/src/themes.rs
@@ -3,7 +3,7 @@ mod rose_pine;
pub use rose_pine::*;
use anyhow::{Context, Result};
-use gpui3::serde_json;
+use gpui2::serde_json;
use serde::Deserialize;
use ui::Theme;
diff --git a/crates/storybook2/src/themes/rose_pine.rs b/crates/storybook2/src/themes/rose_pine.rs
index 1cb45c73ffb..a553f87d777 100644
--- a/crates/storybook2/src/themes/rose_pine.rs
+++ b/crates/storybook2/src/themes/rose_pine.rs
@@ -1,4 +1,4 @@
-use gpui3::serde_json::{self, json};
+use gpui2::serde_json::{self, json};
use ui::Theme;
pub fn rose_pine() -> Theme {
diff --git a/crates/ui2/Cargo.toml b/crates/ui2/Cargo.toml
index 3fe37da8fc2..3e9769a54c9 100644
--- a/crates/ui2/Cargo.toml
+++ b/crates/ui2/Cargo.toml
@@ -7,7 +7,7 @@ publish = false
[dependencies]
anyhow.workspace = true
chrono = "0.4"
-gpui3 = { path = "../gpui3" }
+gpui2 = { path = "../gpui2" }
itertools = { version = "0.11.0", optional = true }
serde.workspace = true
settings = { path = "../settings" }
diff --git a/crates/ui2/src/components/assistant_panel.rs b/crates/ui2/src/components/assistant_panel.rs
index 2b32f332a48..eff1c65728f 100644
--- a/crates/ui2/src/components/assistant_panel.rs
+++ b/crates/ui2/src/components/assistant_panel.rs
@@ -1,6 +1,6 @@
use std::marker::PhantomData;
-use gpui3::{rems, AbsoluteLength};
+use gpui2::{rems, AbsoluteLength};
use crate::prelude::*;
use crate::{Icon, IconButton, Label, Panel, PanelSide};
diff --git a/crates/ui2/src/components/breadcrumb.rs b/crates/ui2/src/components/breadcrumb.rs
index 23dc824006b..4a8a375bf64 100644
--- a/crates/ui2/src/components/breadcrumb.rs
+++ b/crates/ui2/src/components/breadcrumb.rs
@@ -1,7 +1,7 @@
use std::marker::PhantomData;
use std::path::PathBuf;
-use gpui3::Div;
+use gpui2::Div;
use crate::prelude::*;
use crate::{h_stack, HighlightedText};
diff --git a/crates/ui2/src/components/buffer.rs b/crates/ui2/src/components/buffer.rs
index 68c2ed5e0f4..84390653170 100644
--- a/crates/ui2/src/components/buffer.rs
+++ b/crates/ui2/src/components/buffer.rs
@@ -1,6 +1,6 @@
use std::marker::PhantomData;
-use gpui3::{Hsla, WindowContext};
+use gpui2::{Hsla, WindowContext};
use crate::prelude::*;
use crate::{h_stack, v_stack, Icon, IconElement};
@@ -238,7 +238,7 @@ pub use stories::*;
#[cfg(feature = "stories")]
mod stories {
- use gpui3::rems;
+ use gpui2::rems;
use crate::{
empty_buffer_example, hello_world_rust_buffer_example,
diff --git a/crates/ui2/src/components/buffer_search.rs b/crates/ui2/src/components/buffer_search.rs
index 06acd468cd9..56f66f932d6 100644
--- a/crates/ui2/src/components/buffer_search.rs
+++ b/crates/ui2/src/components/buffer_search.rs
@@ -1,4 +1,4 @@
-use gpui3::{view, Context, View};
+use gpui2::{view, Context, View};
use crate::prelude::*;
use crate::{h_stack, Icon, IconButton, IconColor, Input};
diff --git a/crates/ui2/src/components/collab_panel.rs b/crates/ui2/src/components/collab_panel.rs
index b88697656df..8e3c99a8332 100644
--- a/crates/ui2/src/components/collab_panel.rs
+++ b/crates/ui2/src/components/collab_panel.rs
@@ -3,7 +3,7 @@ use crate::{
static_collab_panel_channels, static_collab_panel_current_call, v_stack, Icon, List,
ListHeader, ToggleState,
};
-use gpui3::{img, svg, SharedString};
+use gpui2::{img, svg, SharedString};
use std::marker::PhantomData;
#[derive(Element)]
diff --git a/crates/ui2/src/components/editor_pane.rs b/crates/ui2/src/components/editor_pane.rs
index 770273e7d1a..4e99af1a543 100644
--- a/crates/ui2/src/components/editor_pane.rs
+++ b/crates/ui2/src/components/editor_pane.rs
@@ -1,6 +1,6 @@
use std::path::PathBuf;
-use gpui3::{view, Context, View};
+use gpui2::{view, Context, View};
use crate::prelude::*;
use crate::{
diff --git a/crates/ui2/src/components/icon_button.rs b/crates/ui2/src/components/icon_button.rs
index dd7e9457e15..36691636947 100644
--- a/crates/ui2/src/components/icon_button.rs
+++ b/crates/ui2/src/components/icon_button.rs
@@ -1,7 +1,7 @@
use std::marker::PhantomData;
use std::sync::Arc;
-use gpui3::MouseButton;
+use gpui2::MouseButton;
use crate::{h_stack, prelude::*};
use crate::{ClickHandler, Icon, IconColor, IconElement};
diff --git a/crates/ui2/src/components/list.rs b/crates/ui2/src/components/list.rs
index e2c30b6bfa3..fb5a2481620 100644
--- a/crates/ui2/src/components/list.rs
+++ b/crates/ui2/src/components/list.rs
@@ -1,6 +1,6 @@
use std::marker::PhantomData;
-use gpui3::{div, relative, Div};
+use gpui2::{div, relative, Div};
use crate::settings::user_settings;
use crate::{
diff --git a/crates/ui2/src/components/notification_toast.rs b/crates/ui2/src/components/notification_toast.rs
index 351eed7e165..2d2afec7c34 100644
--- a/crates/ui2/src/components/notification_toast.rs
+++ b/crates/ui2/src/components/notification_toast.rs
@@ -1,6 +1,6 @@
use std::marker::PhantomData;
-use gpui3::rems;
+use gpui2::rems;
use crate::{h_stack, prelude::*, Icon};
diff --git a/crates/ui2/src/components/palette.rs b/crates/ui2/src/components/palette.rs
index c931a2b4cc5..9cb8f2d9ca7 100644
--- a/crates/ui2/src/components/palette.rs
+++ b/crates/ui2/src/components/palette.rs
@@ -152,7 +152,7 @@ impl<S: 'static + Send + Sync> PaletteItem<S> {
}
}
-use gpui3::ElementId;
+use gpui2::ElementId;
#[cfg(feature = "stories")]
pub use stories::*;
diff --git a/crates/ui2/src/components/panel.rs b/crates/ui2/src/components/panel.rs
index 2ff6eb02556..5c83d98339e 100644
--- a/crates/ui2/src/components/panel.rs
+++ b/crates/ui2/src/components/panel.rs
@@ -1,6 +1,6 @@
use std::marker::PhantomData;
-use gpui3::{AbsoluteLength, AnyElement};
+use gpui2::{AbsoluteLength, AnyElement};
use smallvec::SmallVec;
use crate::prelude::*;
diff --git a/crates/ui2/src/components/panes.rs b/crates/ui2/src/components/panes.rs
index c3b9fa65b5b..4cf2e28f058 100644
--- a/crates/ui2/src/components/panes.rs
+++ b/crates/ui2/src/components/panes.rs
@@ -1,6 +1,6 @@
use std::marker::PhantomData;
-use gpui3::{hsla, AnyElement, ElementId, Hsla, Length, Size};
+use gpui2::{hsla, AnyElement, ElementId, Hsla, Length, Size};
use smallvec::SmallVec;
use crate::prelude::*;
diff --git a/crates/ui2/src/components/project_panel.rs b/crates/ui2/src/components/project_panel.rs
index 29008ea30fb..d8f5626d180 100644
--- a/crates/ui2/src/components/project_panel.rs
+++ b/crates/ui2/src/components/project_panel.rs
@@ -58,7 +58,7 @@ impl<S: 'static + Send + Sync> ProjectPanel<S> {
}
}
-use gpui3::ElementId;
+use gpui2::ElementId;
#[cfg(feature = "stories")]
pub use stories::*;
diff --git a/crates/ui2/src/components/tab.rs b/crates/ui2/src/components/tab.rs
index 1128ac368cd..2d787e6f025 100644
--- a/crates/ui2/src/components/tab.rs
+++ b/crates/ui2/src/components/tab.rs
@@ -148,7 +148,7 @@ impl<S: 'static + Send + Sync + Clone> Tab<S> {
}
}
-use gpui3::ElementId;
+use gpui2::ElementId;
#[cfg(feature = "stories")]
pub use stories::*;
diff --git a/crates/ui2/src/components/tab_bar.rs b/crates/ui2/src/components/tab_bar.rs
index 5c20bbe397b..1bd57713b02 100644
--- a/crates/ui2/src/components/tab_bar.rs
+++ b/crates/ui2/src/components/tab_bar.rs
@@ -90,7 +90,7 @@ impl<S: 'static + Send + Sync + Clone> TabBar<S> {
}
}
-use gpui3::ElementId;
+use gpui2::ElementId;
#[cfg(feature = "stories")]
pub use stories::*;
diff --git a/crates/ui2/src/components/terminal.rs b/crates/ui2/src/components/terminal.rs
index 8a68d050673..4b71584f11c 100644
--- a/crates/ui2/src/components/terminal.rs
+++ b/crates/ui2/src/components/terminal.rs
@@ -1,6 +1,6 @@
use std::marker::PhantomData;
-use gpui3::{relative, rems, Size};
+use gpui2::{relative, rems, Size};
use crate::prelude::*;
use crate::{Icon, IconButton, Pane, Tab};
diff --git a/crates/ui2/src/components/title_bar.rs b/crates/ui2/src/components/title_bar.rs
index 4c106c82d60..db33a9de856 100644
--- a/crates/ui2/src/components/title_bar.rs
+++ b/crates/ui2/src/components/title_bar.rs
@@ -1,7 +1,7 @@
use std::sync::atomic::AtomicBool;
use std::sync::Arc;
-use gpui3::{view, Context, View};
+use gpui2::{view, Context, View};
use crate::prelude::*;
use crate::settings::user_settings;
diff --git a/crates/ui2/src/components/toast.rs b/crates/ui2/src/components/toast.rs
index 66bd40f4233..7780b90d442 100644
--- a/crates/ui2/src/components/toast.rs
+++ b/crates/ui2/src/components/toast.rs
@@ -1,4 +1,4 @@
-use gpui3::AnyElement;
+use gpui2::AnyElement;
use smallvec::SmallVec;
use crate::prelude::*;
diff --git a/crates/ui2/src/components/toolbar.rs b/crates/ui2/src/components/toolbar.rs
index aeec01bc7f8..6374be4ee90 100644
--- a/crates/ui2/src/components/toolbar.rs
+++ b/crates/ui2/src/components/toolbar.rs
@@ -1,4 +1,4 @@
-use gpui3::AnyElement;
+use gpui2::AnyElement;
use smallvec::SmallVec;
use crate::prelude::*;
diff --git a/crates/ui2/src/components/workspace.rs b/crates/ui2/src/components/workspace.rs
index 39b08c3f41c..3fb83fdfb43 100644
--- a/crates/ui2/src/components/workspace.rs
+++ b/crates/ui2/src/components/workspace.rs
@@ -1,7 +1,7 @@
use std::sync::Arc;
use chrono::DateTime;
-use gpui3::{px, relative, rems, view, Context, Size, View};
+use gpui2::{px, relative, rems, view, Context, Size, View};
use crate::{prelude::*, NotificationsPanel};
use crate::{
diff --git a/crates/ui2/src/element_ext.rs b/crates/ui2/src/element_ext.rs
index a328b1e78fe..a6ad48e6296 100644
--- a/crates/ui2/src/element_ext.rs
+++ b/crates/ui2/src/element_ext.rs
@@ -1,4 +1,4 @@
-use gpui3::Element;
+use gpui2::Element;
pub trait ElementExt<S: 'static + Send + Sync>: Element<ViewState = S> {
/// Applies a given function `then` to the current element if `condition` is true.
diff --git a/crates/ui2/src/elements/avatar.rs b/crates/ui2/src/elements/avatar.rs
index f83661e84b2..518fd2b166a 100644
--- a/crates/ui2/src/elements/avatar.rs
+++ b/crates/ui2/src/elements/avatar.rs
@@ -1,6 +1,6 @@
use std::marker::PhantomData;
-use gpui3::img;
+use gpui2::img;
use crate::prelude::*;
diff --git a/crates/ui2/src/elements/button.rs b/crates/ui2/src/elements/button.rs
index ace3ada0cdd..0604f4f3e60 100644
--- a/crates/ui2/src/elements/button.rs
+++ b/crates/ui2/src/elements/button.rs
@@ -1,7 +1,7 @@
use std::marker::PhantomData;
use std::sync::Arc;
-use gpui3::{DefiniteLength, Hsla, MouseButton, WindowContext};
+use gpui2::{DefiniteLength, Hsla, MouseButton, WindowContext};
use crate::settings::user_settings;
use crate::{h_stack, Icon, IconColor, IconElement, Label, LabelColor};
@@ -227,7 +227,7 @@ pub use stories::*;
#[cfg(feature = "stories")]
mod stories {
- use gpui3::rems;
+ use gpui2::rems;
use strum::IntoEnumIterator;
use crate::{h_stack, v_stack, LabelColor, Story};
diff --git a/crates/ui2/src/elements/icon.rs b/crates/ui2/src/elements/icon.rs
index ce63d9e9d76..e89309b5e6a 100644
--- a/crates/ui2/src/elements/icon.rs
+++ b/crates/ui2/src/elements/icon.rs
@@ -1,6 +1,6 @@
use std::marker::PhantomData;
-use gpui3::{svg, Hsla};
+use gpui2::{svg, Hsla};
use strum::EnumIter;
use crate::prelude::*;
diff --git a/crates/ui2/src/elements/label.rs b/crates/ui2/src/elements/label.rs
index 5278404d2bf..c57de26dd77 100644
--- a/crates/ui2/src/elements/label.rs
+++ b/crates/ui2/src/elements/label.rs
@@ -1,6 +1,6 @@
use std::marker::PhantomData;
-use gpui3::{relative, Hsla, WindowContext};
+use gpui2::{relative, Hsla, WindowContext};
use smallvec::SmallVec;
use crate::prelude::*;
diff --git a/crates/ui2/src/elements/player.rs b/crates/ui2/src/elements/player.rs
index 2cab1c57d5d..2d1bbc1ce41 100644
--- a/crates/ui2/src/elements/player.rs
+++ b/crates/ui2/src/elements/player.rs
@@ -1,4 +1,4 @@
-use gpui3::{Hsla, ViewContext};
+use gpui2::{Hsla, ViewContext};
use crate::ThemeColor;
diff --git a/crates/ui2/src/elements/stack.rs b/crates/ui2/src/elements/stack.rs
index c69ddbf6e2c..dbd0dae9d3b 100644
--- a/crates/ui2/src/elements/stack.rs
+++ b/crates/ui2/src/elements/stack.rs
@@ -1,4 +1,4 @@
-use gpui3::{div, Div};
+use gpui2::{div, Div};
use crate::prelude::*;
diff --git a/crates/ui2/src/lib.rs b/crates/ui2/src/lib.rs
index 10419ed362b..c2d02369a1a 100644
--- a/crates/ui2/src/lib.rs
+++ b/crates/ui2/src/lib.rs
@@ -16,7 +16,7 @@ pub use static_data::*;
// This needs to be fully qualified with `crate::` otherwise we get a panic
// at:
-// thread '<unnamed>' panicked at crates/gpui3/src/platform/mac/platform.rs:66:81:
+// thread '<unnamed>' panicked at crates/gpui2/src/platform/mac/platform.rs:66:81:
// called `Option::unwrap()` on a `None` value
//
// AFAICT this is something to do with conflicting names between crates and modules that
diff --git a/crates/ui2/src/prelude.rs b/crates/ui2/src/prelude.rs
index ee238a9f8e0..bf3243f128a 100644
--- a/crates/ui2/src/prelude.rs
+++ b/crates/ui2/src/prelude.rs
@@ -1,4 +1,4 @@
-pub use gpui3::{
+pub use gpui2::{
div, Element, ElementId, IntoAnyElement, ParentElement, SharedString, StatefulInteractive,
StatelessInteractive, Styled, ViewContext, WindowContext,
};
@@ -6,7 +6,7 @@ pub use gpui3::{
use crate::settings::user_settings;
pub use crate::{theme, ButtonVariant, ElementExt, Theme};
-use gpui3::{hsla, rems, rgb, Hsla, Rems};
+use gpui2::{hsla, rems, rgb, Hsla, Rems};
use strum::EnumIter;
// TODO Remove uses in favor of ThemeColor
diff --git a/crates/ui2/src/settings.rs b/crates/ui2/src/settings.rs
index d7ace0a0838..c68e39e71c5 100644
--- a/crates/ui2/src/settings.rs
+++ b/crates/ui2/src/settings.rs
@@ -1,6 +1,6 @@
use std::ops::Deref;
-use gpui3::{
+use gpui2::{
rems, AbsoluteLength, AnyElement, BorrowAppContext, Bounds, LayoutId, Pixels, WindowContext,
};
@@ -104,7 +104,7 @@ impl<E: Element> Element for WithSettings<E> {
type ViewState = E::ViewState;
type ElementState = E::ElementState;
- fn id(&self) -> Option<gpui3::ElementId> {
+ fn id(&self) -> Option<gpui2::ElementId> {
None
}
diff --git a/crates/ui2/src/static_data.rs b/crates/ui2/src/static_data.rs
index 06473fbfa42..907353544dc 100644
--- a/crates/ui2/src/static_data.rs
+++ b/crates/ui2/src/static_data.rs
@@ -1,7 +1,7 @@
use std::path::PathBuf;
use std::str::FromStr;
-use gpui3::WindowContext;
+use gpui2::WindowContext;
use rand::Rng;
use crate::{
diff --git a/crates/ui2/src/story.rs b/crates/ui2/src/story.rs
index 2a753df4f1c..3821f11c3b9 100644
--- a/crates/ui2/src/story.rs
+++ b/crates/ui2/src/story.rs
@@ -1,4 +1,4 @@
-use gpui3::Div;
+use gpui2::Div;
use crate::prelude::*;
diff --git a/crates/ui2/src/theme.rs b/crates/ui2/src/theme.rs
index aa84e7c11f1..0054bb84be7 100644
--- a/crates/ui2/src/theme.rs
+++ b/crates/ui2/src/theme.rs
@@ -2,7 +2,7 @@ use std::collections::HashMap;
use std::fmt;
use std::sync::Arc;
-use gpui3::{
+use gpui2::{
AnyElement, BorrowAppContext, Bounds, Element, Hsla, IntoAnyElement, LayoutId, Pixels, Result,
ViewContext, WindowContext,
};
@@ -160,7 +160,7 @@ impl<E: Element> Element for Themed<E> {
type ViewState = E::ViewState;
type ElementState = E::ElementState;
- fn id(&self) -> Option<gpui3::ElementId> {
+ fn id(&self) -> Option<gpui2::ElementId> {
None
}