Checkpoint

This commit is contained in:
Antonio Scandurra 2023-10-21 16:01:47 +02:00
parent f3979a9f28
commit e4fe9538d7
107 changed files with 81 additions and 81 deletions

10
Cargo.lock generated
View File

@ -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",

View File

@ -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",

View File

@ -1,5 +1,5 @@
[package]
name = "gpui3"
name = "gpui2"
version = "0.1.0"
edition = "2021"
authors = ["Nathan Sobo <nathan@zed.dev>"]
@ -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" }

View File

@ -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::*;

View File

@ -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

View File

@ -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]

View File

@ -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)
}

View File

@ -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

View File

@ -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"] }

View File

@ -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)]

View File

@ -1,5 +1,5 @@
use crate::themes::rose_pine;
use gpui3::{
use gpui2::{
div, view, Context, Focusable, KeyBinding, ParentElement, StatelessInteractive, Styled, View,
WindowContext,
};

View File

@ -1,4 +1,4 @@
use gpui3::{view, Context, View};
use gpui2::{view, Context, View};
use strum::IntoEnumIterator;
use ui::prelude::*;

View File

@ -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;

View File

@ -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<()>,

View File

@ -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;

View File

@ -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::*;

View File

@ -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));

View File

@ -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;

View File

@ -1,4 +1,4 @@
use gpui3::serde_json::{self, json};
use gpui2::serde_json::{self, json};
use ui::Theme;
pub fn rose_pine() -> Theme {

View File

@ -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" }

View File

@ -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};

View File

@ -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};

View File

@ -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,

View File

@ -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};

View File

@ -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)]

View File

@ -1,6 +1,6 @@
use std::path::PathBuf;
use gpui3::{view, Context, View};
use gpui2::{view, Context, View};
use crate::prelude::*;
use crate::{

View File

@ -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};

View File

@ -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::{

View File

@ -1,6 +1,6 @@
use std::marker::PhantomData;
use gpui3::rems;
use gpui2::rems;
use crate::{h_stack, prelude::*, Icon};

View File

@ -152,7 +152,7 @@ impl<S: 'static + Send + Sync> PaletteItem<S> {
}
}
use gpui3::ElementId;
use gpui2::ElementId;
#[cfg(feature = "stories")]
pub use stories::*;

View File

@ -1,6 +1,6 @@
use std::marker::PhantomData;
use gpui3::{AbsoluteLength, AnyElement};
use gpui2::{AbsoluteLength, AnyElement};
use smallvec::SmallVec;
use crate::prelude::*;

View File

@ -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::*;

View File

@ -58,7 +58,7 @@ impl<S: 'static + Send + Sync> ProjectPanel<S> {
}
}
use gpui3::ElementId;
use gpui2::ElementId;
#[cfg(feature = "stories")]
pub use stories::*;

View File

@ -148,7 +148,7 @@ impl<S: 'static + Send + Sync + Clone> Tab<S> {
}
}
use gpui3::ElementId;
use gpui2::ElementId;
#[cfg(feature = "stories")]
pub use stories::*;

View File

@ -90,7 +90,7 @@ impl<S: 'static + Send + Sync + Clone> TabBar<S> {
}
}
use gpui3::ElementId;
use gpui2::ElementId;
#[cfg(feature = "stories")]
pub use stories::*;

View File

@ -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};

View File

@ -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;

View File

@ -1,4 +1,4 @@
use gpui3::AnyElement;
use gpui2::AnyElement;
use smallvec::SmallVec;
use crate::prelude::*;

View File

@ -1,4 +1,4 @@
use gpui3::AnyElement;
use gpui2::AnyElement;
use smallvec::SmallVec;
use crate::prelude::*;

View File

@ -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::{

View File

@ -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.

View File

@ -1,6 +1,6 @@
use std::marker::PhantomData;
use gpui3::img;
use gpui2::img;
use crate::prelude::*;

View File

@ -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};

View File

@ -1,6 +1,6 @@
use std::marker::PhantomData;
use gpui3::{svg, Hsla};
use gpui2::{svg, Hsla};
use strum::EnumIter;
use crate::prelude::*;

View File

@ -1,6 +1,6 @@
use std::marker::PhantomData;
use gpui3::{relative, Hsla, WindowContext};
use gpui2::{relative, Hsla, WindowContext};
use smallvec::SmallVec;
use crate::prelude::*;

View File

@ -1,4 +1,4 @@
use gpui3::{Hsla, ViewContext};
use gpui2::{Hsla, ViewContext};
use crate::ThemeColor;

Some files were not shown because too many files have changed in this diff Show More