Release Notes: - N/A
Unified · Split
| @@ -7530,6 +7530,7 @@ name = "sqlez" · 7529 unmodified lines | |||
| 7530 | version = "0.1.0" | 7530 | version = "0.1.0" |
| 7531 | dependencies = [ | 7531 | dependencies = [ |
| 7532 | "anyhow", | 7532 | "anyhow", |
| 7533 | "collections", | ||
| 7533 | "futures 0.3.28", | 7534 | "futures 0.3.28", |
| 7534 | "indoc", | 7535 | "indoc", |
| 7535 | "lazy_static", | 7536 | "lazy_static", |
| @@ -8105,6 +8106,7 @@ version = "0.1.0" · 569 unmodified lines | |||
| 8105 | dependencies = [ | 8106 | dependencies = [ |
| 8106 | "alacritty_terminal", | 8107 | "alacritty_terminal", |
| 8107 | "anyhow", | 8108 | "anyhow", |
| 8109 | "collections", | ||
| 8108 | "db", | 8110 | "db", |
| 8109 | "dirs 4.0.0", | 8111 | "dirs 4.0.0", |
| 8110 | "futures 0.3.28", | 8112 | "futures 0.3.28", |
| @@ -8200,6 +8202,7 @@ name = "theme" · 89 unmodified lines | |||
| 8200 | version = "0.1.0" | 8202 | version = "0.1.0" |
| 8201 | dependencies = [ | 8203 | dependencies = [ |
| 8202 | "anyhow", | 8204 | "anyhow", |
| 8205 | "collections", | ||
| 8203 | "color", | 8206 | "color", |
| 8204 | "derive_more", | 8207 | "derive_more", |
| 8205 | "fs", | 8208 | "fs", |
| @@ -9343,6 +9346,7 @@ version = "0.1.0" · 1137 unmodified lines | |||
| 9343 | dependencies = [ | 9346 | dependencies = [ |
| 9344 | "anyhow", | 9347 | "anyhow", |
| 9345 | "backtrace", | 9348 | "backtrace", |
| 9349 | "collections", | ||
| 9346 | "dirs 3.0.2", | 9350 | "dirs 3.0.2", |
| 9347 | "futures 0.3.28", | 9351 | "futures 0.3.28", |
| 9348 | "git2", | 9352 | "git2", |
| @@ -5,13 +5,13 @@ use client::{ · 4 unmodified lines | |||
| 5 | user::{User, UserStore}, | 5 | user::{User, UserStore}, |
| 6 | Client, Subscription, TypedEnvelope, UserId, | 6 | Client, Subscription, TypedEnvelope, UserId, |
| 7 | }; | 7 | }; |
| 8 | use collections::HashSet; | ||
| 8 | use futures::lock::Mutex; | 9 | use futures::lock::Mutex; |
| 9 | use gpui::{ | 10 | use gpui::{ |
| 10 | AppContext, AsyncAppContext, Context, EventEmitter, Model, ModelContext, Task, WeakModel, | 11 | AppContext, AsyncAppContext, Context, EventEmitter, Model, ModelContext, Task, WeakModel, |
| 11 | }; | 12 | }; |
| 12 | use rand::prelude::*; | 13 | use rand::prelude::*; |
| 13 | use std::{ | 14 | use std::{ |
| 14 | collections::HashSet, | ||
| 15 | ops::{ControlFlow, Range}, | 15 | ops::{ControlFlow, Range}, |
| 16 | sync::Arc, | 16 | sync::Arc, |
| 17 | }; | 17 | }; |
| @@ -10,6 +10,7 @@ use async_tungstenite::tungstenite::{ · 9 unmodified lines | |||
| 10 | error::Error as WebsocketError, | 10 | error::Error as WebsocketError, |
| 11 | http::{Request, StatusCode}, | 11 | http::{Request, StatusCode}, |
| 12 | }; | 12 | }; |
| 13 | use collections::HashMap; | ||
| 13 | use futures::{ | 14 | use futures::{ |
| 14 | channel::oneshot, future::LocalBoxFuture, AsyncReadExt, FutureExt, SinkExt, StreamExt, | 15 | channel::oneshot, future::LocalBoxFuture, AsyncReadExt, FutureExt, SinkExt, StreamExt, |
| 15 | TryFutureExt as _, TryStreamExt, | 16 | TryFutureExt as _, TryStreamExt, |
| @@ -29,7 +30,6 @@ use serde_json; · 13 unmodified lines | |||
| 29 | use settings::{Settings, SettingsStore}; | 30 | use settings::{Settings, SettingsStore}; |
| 30 | use std::{ | 31 | use std::{ |
| 31 | any::TypeId, | 32 | any::TypeId, |
| 32 | collections::HashMap, | ||
| 33 | convert::TryFrom, | 33 | convert::TryFrom, |
| 34 | fmt::Write as _, | 34 | fmt::Write as _, |
| 35 | future::Future, | 35 | future::Future, |
| @@ -23,7 +23,7 @@ use crate::{ · 22 unmodified lines | |||
| 23 | TextSystem, View, ViewContext, Window, WindowContext, WindowHandle, WindowId, | 23 | TextSystem, View, ViewContext, Window, WindowContext, WindowHandle, WindowId, |
| 24 | }; | 24 | }; |
| 25 | use anyhow::{anyhow, Result}; | 25 | use anyhow::{anyhow, Result}; |
| 26 | use collections::{FxHashMap, FxHashSet, VecDeque}; | 26 | use collections::{HashMap, HashSet, VecDeque}; |
| 27 | use futures::{channel::oneshot, future::LocalBoxFuture, Future}; | 27 | use futures::{channel::oneshot, future::LocalBoxFuture, Future}; |
| 28 | 28 | ||
| 29 | use slotmap::SlotMap; | 29 | use slotmap::SlotMap; |
| @@ -212,24 +212,24 @@ pub struct AppContext { · 182 unmodified lines | |||
| 212 | pending_updates: usize, | 212 | pending_updates: usize, |
| 213 | pub(crate) actions: Rc<ActionRegistry>, | 213 | pub(crate) actions: Rc<ActionRegistry>, |
| 214 | pub(crate) active_drag: Option<AnyDrag>, | 214 | pub(crate) active_drag: Option<AnyDrag>, |
| 215 | pub(crate) next_frame_callbacks: FxHashMap<DisplayId, Vec<FrameCallback>>, | 215 | pub(crate) next_frame_callbacks: HashMap<DisplayId, Vec<FrameCallback>>, |
| 216 | pub(crate) frame_consumers: FxHashMap<DisplayId, Task<()>>, | 216 | pub(crate) frame_consumers: HashMap<DisplayId, Task<()>>, |
| 217 | pub(crate) background_executor: BackgroundExecutor, | 217 | pub(crate) background_executor: BackgroundExecutor, |
| 218 | pub(crate) foreground_executor: ForegroundExecutor, | 218 | pub(crate) foreground_executor: ForegroundExecutor, |
| 219 | pub(crate) svg_renderer: SvgRenderer, | 219 | pub(crate) svg_renderer: SvgRenderer, |
| 220 | asset_source: Arc<dyn AssetSource>, | 220 | asset_source: Arc<dyn AssetSource>, |
| 221 | pub(crate) image_cache: ImageCache, | 221 | pub(crate) image_cache: ImageCache, |
| 222 | pub(crate) text_style_stack: Vec<TextStyleRefinement>, | 222 | pub(crate) text_style_stack: Vec<TextStyleRefinement>, |
| 223 | pub(crate) globals_by_type: FxHashMap<TypeId, Box<dyn Any>>, | 223 | pub(crate) globals_by_type: HashMap<TypeId, Box<dyn Any>>, |
| 224 | pub(crate) entities: EntityMap, | 224 | pub(crate) entities: EntityMap, |
| 225 | pub(crate) new_view_observers: SubscriberSet<TypeId, NewViewListener>, | 225 | pub(crate) new_view_observers: SubscriberSet<TypeId, NewViewListener>, |
| 226 | pub(crate) windows: SlotMap<WindowId, Option<Window>>, | 226 | pub(crate) windows: SlotMap<WindowId, Option<Window>>, |
| 227 | pub(crate) keymap: Rc<RefCell<Keymap>>, | 227 | pub(crate) keymap: Rc<RefCell<Keymap>>, |
| 228 | pub(crate) global_action_listeners: | 228 | pub(crate) global_action_listeners: |
| 229 | FxHashMap<TypeId, Vec<Rc<dyn Fn(&dyn Any, DispatchPhase, &mut Self)>>>, | 229 | HashMap<TypeId, Vec<Rc<dyn Fn(&dyn Any, DispatchPhase, &mut Self)>>>, |
| 230 | pending_effects: VecDeque<Effect>, | 230 | pending_effects: VecDeque<Effect>, |
| 231 | pub(crate) pending_notifications: FxHashSet<EntityId>, | 231 | pub(crate) pending_notifications: HashSet<EntityId>, |
| 232 | pub(crate) pending_global_notifications: FxHashSet<TypeId>, | 232 | pub(crate) pending_global_notifications: HashSet<TypeId>, |
| 233 | pub(crate) observers: SubscriberSet<EntityId, Handler>, | 233 | pub(crate) observers: SubscriberSet<EntityId, Handler>, |
| 234 | // TypeId is the type of the event that the listener callback expects | 234 | // TypeId is the type of the event that the listener callback expects |
| 235 | pub(crate) event_listeners: SubscriberSet<EntityId, (TypeId, Listener)>, | 235 | pub(crate) event_listeners: SubscriberSet<EntityId, (TypeId, Listener)>, |
| @@ -274,23 +274,23 @@ impl AppContext { · 38 unmodified lines | |||
| 274 | flushing_effects: false, | 274 | flushing_effects: false, |
| 275 | pending_updates: 0, | 275 | pending_updates: 0, |
| 276 | active_drag: None, | 276 | active_drag: None, |
| 277 | next_frame_callbacks: FxHashMap::default(), | 277 | next_frame_callbacks: HashMap::default(), |
| 278 | frame_consumers: FxHashMap::default(), | 278 | frame_consumers: HashMap::default(), |
| 279 | background_executor: executor, | 279 | background_executor: executor, |
| 280 | foreground_executor, | 280 | foreground_executor, |
| 281 | svg_renderer: SvgRenderer::new(asset_source.clone()), | 281 | svg_renderer: SvgRenderer::new(asset_source.clone()), |
| 282 | asset_source, | 282 | asset_source, |
| 283 | image_cache: ImageCache::new(http_client), | 283 | image_cache: ImageCache::new(http_client), |
| 284 | text_style_stack: Vec::new(), | 284 | text_style_stack: Vec::new(), |
| 285 | globals_by_type: FxHashMap::default(), | 285 | globals_by_type: HashMap::default(), |
| 286 | entities, | 286 | entities, |
| 287 | new_view_observers: SubscriberSet::new(), | 287 | new_view_observers: SubscriberSet::new(), |
| 288 | windows: SlotMap::with_key(), | 288 | windows: SlotMap::with_key(), |
| 289 | keymap: Rc::new(RefCell::new(Keymap::default())), | 289 | keymap: Rc::new(RefCell::new(Keymap::default())), |
| 290 | global_action_listeners: FxHashMap::default(), | 290 | global_action_listeners: HashMap::default(), |
| 291 | pending_effects: VecDeque::new(), | 291 | pending_effects: VecDeque::new(), |
| 292 | pending_notifications: FxHashSet::default(), | 292 | pending_notifications: HashSet::default(), |
| 293 | pending_global_notifications: FxHashSet::default(), | 293 | pending_global_notifications: HashSet::default(), |
| 294 | observers: SubscriberSet::new(), | 294 | observers: SubscriberSet::new(), |
| 295 | event_listeners: SubscriberSet::new(), | 295 | event_listeners: SubscriberSet::new(), |
| 296 | release_listeners: SubscriberSet::new(), | 296 | release_listeners: SubscriberSet::new(), |
| @@ -53,7 +53,7 @@ use crate::{ · 52 unmodified lines | |||
| 53 | Action, ActionRegistry, DispatchPhase, ElementContext, EntityId, FocusId, KeyBinding, | 53 | Action, ActionRegistry, DispatchPhase, ElementContext, EntityId, FocusId, KeyBinding, |
| 54 | KeyContext, Keymap, KeymatchResult, Keystroke, KeystrokeMatcher, WindowContext, | 54 | KeyContext, Keymap, KeymatchResult, Keystroke, KeystrokeMatcher, WindowContext, |
| 55 | }; | 55 | }; |
| 56 | use collections::FxHashMap; | 56 | use collections::HashMap; |
| 57 | use smallvec::{smallvec, SmallVec}; | 57 | use smallvec::{smallvec, SmallVec}; |
| 58 | use std::{ | 58 | use std::{ |
| 59 | any::{Any, TypeId}, | 59 | any::{Any, TypeId}, |
| @@ -69,9 +69,9 @@ pub(crate) struct DispatchTree { · 9 unmodified lines | |||
| 69 | node_stack: Vec<DispatchNodeId>, | 69 | node_stack: Vec<DispatchNodeId>, |
| 70 | pub(crate) context_stack: Vec<KeyContext>, | 70 | pub(crate) context_stack: Vec<KeyContext>, |
| 71 | nodes: Vec<DispatchNode>, | 71 | nodes: Vec<DispatchNode>, |
| 72 | focusable_node_ids: FxHashMap<FocusId, DispatchNodeId>, | 72 | focusable_node_ids: HashMap<FocusId, DispatchNodeId>, |
| 73 | view_node_ids: FxHashMap<EntityId, DispatchNodeId>, | 73 | view_node_ids: HashMap<EntityId, DispatchNodeId>, |
| 74 | keystroke_matchers: FxHashMap<SmallVec<[KeyContext; 4]>, KeystrokeMatcher>, | 74 | keystroke_matchers: HashMap<SmallVec<[KeyContext; 4]>, KeystrokeMatcher>, |
| 75 | keymap: Rc<RefCell<Keymap>>, | 75 | keymap: Rc<RefCell<Keymap>>, |
| 76 | action_registry: Rc<ActionRegistry>, | 76 | action_registry: Rc<ActionRegistry>, |
| 77 | } | 77 | } |
| @@ -100,9 +100,9 @@ impl DispatchTree { · 22 unmodified lines | |||
| 100 | node_stack: Vec::new(), | 100 | node_stack: Vec::new(), |
| 101 | context_stack: Vec::new(), | 101 | context_stack: Vec::new(), |
| 102 | nodes: Vec::new(), | 102 | nodes: Vec::new(), |
| 103 | focusable_node_ids: FxHashMap::default(), | 103 | focusable_node_ids: HashMap::default(), |
| 104 | view_node_ids: FxHashMap::default(), | 104 | view_node_ids: HashMap::default(), |
| 105 | keystroke_matchers: FxHashMap::default(), | 105 | keystroke_matchers: HashMap::default(), |
| 106 | keymap, | 106 | keymap, |
| 107 | action_registry, | 107 | action_registry, |
| 108 | } | 108 | } |
| @@ -7,12 +7,9 @@ pub use context::*; · 6 unmodified lines | |||
| 7 | pub(crate) use matcher::*; | 7 | pub(crate) use matcher::*; |
| 8 | 8 | ||
| 9 | use crate::{Action, Keystroke, NoAction}; | 9 | use crate::{Action, Keystroke, NoAction}; |
| 10 | use collections::HashSet; | 10 | use collections::{HashMap, HashSet}; |
| 11 | use smallvec::SmallVec; | 11 | use smallvec::SmallVec; |
| 12 | use std::{ | 12 | use std::any::{Any, TypeId}; |
| 13 | any::{Any, TypeId}, | ||
| 14 | collections::HashMap, | ||
| 15 | }; | ||
| 16 | 13 | ||
| 17 | /// An opaque identifier of which version of the keymap is currently active. | 14 | /// An opaque identifier of which version of the keymap is currently active. |
| 18 | /// The keymap's version is changed whenever bindings are added or removed. | 15 | /// The keymap's version is changed whenever bindings are added or removed. |
| @@ -3,7 +3,7 @@ use crate::{ · 2 unmodified lines | |||
| 3 | Point, Size, | 3 | Point, Size, |
| 4 | }; | 4 | }; |
| 5 | use anyhow::Result; | 5 | use anyhow::Result; |
| 6 | use collections::FxHashMap; | 6 | use collections::HashMap; |
| 7 | use derive_more::{Deref, DerefMut}; | 7 | use derive_more::{Deref, DerefMut}; |
| 8 | use etagere::BucketedAtlasAllocator; | 8 | use etagere::BucketedAtlasAllocator; |
| 9 | use metal::Device; | 9 | use metal::Device; |
| @@ -53,7 +53,7 @@ struct MetalAtlasState { · 43 unmodified lines | |||
| 53 | monochrome_textures: Vec<MetalAtlasTexture>, | 53 | monochrome_textures: Vec<MetalAtlasTexture>, |
| 54 | polychrome_textures: Vec<MetalAtlasTexture>, | 54 | polychrome_textures: Vec<MetalAtlasTexture>, |
| 55 | path_textures: Vec<MetalAtlasTexture>, | 55 | path_textures: Vec<MetalAtlasTexture>, |
| 56 | tiles_by_key: FxHashMap<AtlasKey, AtlasTile>, | 56 | tiles_by_key: HashMap<AtlasKey, AtlasTile>, |
| 57 | } | 57 | } |
| 58 | 58 | ||
| 59 | impl PlatformAtlas for MetalAtlas { | 59 | impl PlatformAtlas for MetalAtlas { |
| @@ -2,7 +2,7 @@ use crate::{ · 1 unmodified line | |||
| 2 | point, AtlasTextureId, AtlasTile, Bounds, ContentMask, Corners, Edges, EntityId, Hsla, Pixels, | 2 | point, AtlasTextureId, AtlasTile, Bounds, ContentMask, Corners, Edges, EntityId, Hsla, Pixels, |
| 3 | Point, ScaledPixels, StackingOrder, | 3 | Point, ScaledPixels, StackingOrder, |
| 4 | }; | 4 | }; |
| 5 | use collections::{BTreeMap, FxHashSet}; | 5 | use collections::{BTreeMap, HashSet}; |
| 6 | use std::{fmt::Debug, iter::Peekable, slice}; | 6 | use std::{fmt::Debug, iter::Peekable, slice}; |
| 7 | 7 | ||
| 8 | // Exported to metal | 8 | // Exported to metal |
| @@ -159,7 +159,7 @@ impl Scene { · 150 unmodified lines | |||
| 159 | layer_id | 159 | layer_id |
| 160 | } | 160 | } |
| 161 | 161 | ||
| 162 | pub fn reuse_views(&mut self, views: &FxHashSet<EntityId>, prev_scene: &mut Self) { | 162 | pub fn reuse_views(&mut self, views: &HashSet<EntityId>, prev_scene: &mut Self) { |
| 163 | for shadow in prev_scene.shadows.drain(..) { | 163 | for shadow in prev_scene.shadows.drain(..) { |
| 164 | if views.contains(&shadow.view_id.into()) { | 164 | if views.contains(&shadow.view_id.into()) { |
| 165 | let order = &prev_scene.orders_by_layer[&shadow.layer_id]; | 165 | let order = &prev_scene.orders_by_layer[&shadow.layer_id]; |
| @@ -2,7 +2,7 @@ use crate::{ · 1 unmodified line | |||
| 2 | AbsoluteLength, Bounds, DefiniteLength, Edges, Length, Pixels, Point, Size, Style, | 2 | AbsoluteLength, Bounds, DefiniteLength, Edges, Length, Pixels, Point, Size, Style, |
| 3 | WindowContext, | 3 | WindowContext, |
| 4 | }; | 4 | }; |
| 5 | use collections::{FxHashMap, FxHashSet}; | 5 | use collections::{HashMap, HashSet}; |
| 6 | use smallvec::SmallVec; | 6 | use smallvec::SmallVec; |
| 7 | use std::fmt::Debug; | 7 | use std::fmt::Debug; |
| 8 | use taffy::{ | 8 | use taffy::{ |
| @@ -17,11 +17,11 @@ type NodeMeasureFn = · 8 unmodified lines | |||
| 17 | 17 | ||
| 18 | pub struct TaffyLayoutEngine { | 18 | pub struct TaffyLayoutEngine { |
| 19 | taffy: Taffy, | 19 | taffy: Taffy, |
| 20 | styles: FxHashMap<LayoutId, Style>, | 20 | styles: HashMap<LayoutId, Style>, |
| 21 | children_to_parents: FxHashMap<LayoutId, LayoutId>, | 21 | children_to_parents: HashMap<LayoutId, LayoutId>, |
| 22 | absolute_layout_bounds: FxHashMap<LayoutId, Bounds<Pixels>>, | 22 | absolute_layout_bounds: HashMap<LayoutId, Bounds<Pixels>>, |
| 23 | computed_layouts: FxHashSet<LayoutId>, | 23 | computed_layouts: HashSet<LayoutId>, |
| 24 | nodes_to_measure: FxHashMap<LayoutId, NodeMeasureFn>, | 24 | nodes_to_measure: HashMap<LayoutId, NodeMeasureFn>, |
| 25 | } | 25 | } |
| 26 | 26 | ||
| 27 | static EXPECT_MESSAGE: &str = "we should avoid taffy layout errors by construction if possible"; | 27 | static EXPECT_MESSAGE: &str = "we should avoid taffy layout errors by construction if possible"; |
| @@ -30,11 +30,11 @@ impl TaffyLayoutEngine { · 2 unmodified lines | |||
| 30 | pub fn new() -> Self { | 30 | pub fn new() -> Self { |
| 31 | TaffyLayoutEngine { | 31 | TaffyLayoutEngine { |
| 32 | taffy: Taffy::new(), | 32 | taffy: Taffy::new(), |
| 33 | styles: FxHashMap::default(), | 33 | styles: HashMap::default(), |
| 34 | children_to_parents: FxHashMap::default(), | 34 | children_to_parents: HashMap::default(), |
| 35 | absolute_layout_bounds: FxHashMap::default(), | 35 | absolute_layout_bounds: HashMap::default(), |
| 36 | computed_layouts: FxHashSet::default(), | 36 | computed_layouts: HashSet::default(), |
| 37 | nodes_to_measure: FxHashMap::default(), | 37 | nodes_to_measure: HashMap::default(), |
| 38 | } | 38 | } |
| 39 | } | 39 | } |
| 40 | 40 | ||
| @@ -13,7 +13,7 @@ use crate::{ · 12 unmodified lines | |||
| 13 | SharedString, Size, UnderlineStyle, | 13 | SharedString, Size, UnderlineStyle, |
| 14 | }; | 14 | }; |
| 15 | use anyhow::anyhow; | 15 | use anyhow::anyhow; |
| 16 | use collections::{BTreeSet, FxHashMap, FxHashSet}; | 16 | use collections::{BTreeSet, HashMap, HashSet}; |
| 17 | use core::fmt; | 17 | use core::fmt; |
| 18 | use derive_more::Deref; | 18 | use derive_more::Deref; |
| 19 | use itertools::Itertools; | 19 | use itertools::Itertools; |
| @@ -42,10 +42,10 @@ pub(crate) const SUBPIXEL_VARIANTS: u8 = 4; · 22 unmodified lines | |||
| 42 | /// The GPUI text rendering sub system. | 42 | /// The GPUI text rendering sub system. |
| 43 | pub struct TextSystem { | 43 | pub struct TextSystem { |
| 44 | platform_text_system: Arc<dyn PlatformTextSystem>, | 44 | platform_text_system: Arc<dyn PlatformTextSystem>, |
| 45 | font_ids_by_font: RwLock<FxHashMap<Font, Result<FontId>>>, | 45 | font_ids_by_font: RwLock<HashMap<Font, Result<FontId>>>, |
| 46 | font_metrics: RwLock<FxHashMap<FontId, FontMetrics>>, | 46 | font_metrics: RwLock<HashMap<FontId, FontMetrics>>, |
| 47 | raster_bounds: RwLock<FxHashMap<RenderGlyphParams, Bounds<DevicePixels>>>, | 47 | raster_bounds: RwLock<HashMap<RenderGlyphParams, Bounds<DevicePixels>>>, |
| 48 | wrapper_pool: Mutex<FxHashMap<FontIdWithSize, Vec<LineWrapper>>>, | 48 | wrapper_pool: Mutex<HashMap<FontIdWithSize, Vec<LineWrapper>>>, |
| 49 | font_runs_pool: Mutex<Vec<Vec<FontRun>>>, | 49 | font_runs_pool: Mutex<Vec<Vec<FontRun>>>, |
| 50 | fallback_font_stack: SmallVec<[Font; 2]>, | 50 | fallback_font_stack: SmallVec<[Font; 2]>, |
| 51 | } | 51 | } |
| @@ -447,7 +447,7 @@ impl WindowTextSystem { · 395 unmodified lines | |||
| 447 | Ok(lines) | 447 | Ok(lines) |
| 448 | } | 448 | } |
| 449 | 449 | ||
| 450 | pub(crate) fn finish_frame(&self, reused_views: &FxHashSet<EntityId>) { | 450 | pub(crate) fn finish_frame(&self, reused_views: &HashSet<EntityId>) { |
| 451 | self.line_layout_cache.finish_frame(reused_views) | 451 | self.line_layout_cache.finish_frame(reused_views) |
| 452 | } | 452 | } |
| 453 | 453 | ||
| @@ -1,5 +1,5 @@ | |||
| 1 | use crate::{px, EntityId, FontId, GlyphId, Pixels, PlatformTextSystem, Point, Size}; | 1 | use crate::{px, EntityId, FontId, GlyphId, Pixels, PlatformTextSystem, Point, Size}; |
| 2 | use collections::{FxHashMap, FxHashSet}; | 2 | use collections::{HashMap, HashSet}; |
| 3 | use parking_lot::{Mutex, RwLock, RwLockUpgradableReadGuard}; | 3 | use parking_lot::{Mutex, RwLock, RwLockUpgradableReadGuard}; |
| 4 | use smallvec::SmallVec; | 4 | use smallvec::SmallVec; |
| 5 | use std::{ | 5 | use std::{ |
| @@ -277,10 +277,10 @@ impl WrappedLineLayout { · 271 unmodified lines | |||
| 277 | 277 | ||
| 278 | pub(crate) struct LineLayoutCache { | 278 | pub(crate) struct LineLayoutCache { |
| 279 | view_stack: Mutex<Vec<EntityId>>, | 279 | view_stack: Mutex<Vec<EntityId>>, |
| 280 | previous_frame: Mutex<FxHashMap<CacheKey, Arc<LineLayout>>>, | 280 | previous_frame: Mutex<HashMap<CacheKey, Arc<LineLayout>>>, |
| 281 | current_frame: RwLock<FxHashMap<CacheKey, Arc<LineLayout>>>, | 281 | current_frame: RwLock<HashMap<CacheKey, Arc<LineLayout>>>, |
| 282 | previous_frame_wrapped: Mutex<FxHashMap<CacheKey, Arc<WrappedLineLayout>>>, | 282 | previous_frame_wrapped: Mutex<HashMap<CacheKey, Arc<WrappedLineLayout>>>, |
| 283 | current_frame_wrapped: RwLock<FxHashMap<CacheKey, Arc<WrappedLineLayout>>>, | 283 | current_frame_wrapped: RwLock<HashMap<CacheKey, Arc<WrappedLineLayout>>>, |
| 284 | platform_text_system: Arc<dyn PlatformTextSystem>, | 284 | platform_text_system: Arc<dyn PlatformTextSystem>, |
| 285 | } | 285 | } |
| 286 | 286 | ||
| @@ -296,7 +296,7 @@ impl LineLayoutCache { · 9 unmodified lines | |||
| 296 | } | 296 | } |
| 297 | } | 297 | } |
| 298 | 298 | ||
| 299 | pub fn finish_frame(&self, reused_views: &FxHashSet<EntityId>) { | 299 | pub fn finish_frame(&self, reused_views: &HashSet<EntityId>) { |
| 300 | debug_assert_eq!(self.view_stack.lock().len(), 0); | 300 | debug_assert_eq!(self.view_stack.lock().len(), 0); |
| 301 | 301 | ||
| 302 | let mut prev_frame = self.previous_frame.lock(); | 302 | let mut prev_frame = self.previous_frame.lock(); |
| @@ -10,7 +10,7 @@ use crate::{ · 9 unmodified lines | |||
| 10 | WindowOptions, WindowTextSystem, | 10 | WindowOptions, WindowTextSystem, |
| 11 | }; | 11 | }; |
| 12 | use anyhow::{anyhow, Context as _, Result}; | 12 | use anyhow::{anyhow, Context as _, Result}; |
| 13 | use collections::FxHashSet; | 13 | use collections::HashSet; |
| 14 | use derive_more::{Deref, DerefMut}; | 14 | use derive_more::{Deref, DerefMut}; |
| 15 | use futures::{ | 15 | use futures::{ |
| 16 | channel::{mpsc, oneshot}, | 16 | channel::{mpsc, oneshot}, |
| @@ -259,7 +259,7 @@ pub struct Window { · 242 unmodified lines | |||
| 259 | pub(crate) element_id_stack: GlobalElementId, | 259 | pub(crate) element_id_stack: GlobalElementId, |
| 260 | pub(crate) rendered_frame: Frame, | 260 | pub(crate) rendered_frame: Frame, |
| 261 | pub(crate) next_frame: Frame, | 261 | pub(crate) next_frame: Frame, |
| 262 | pub(crate) dirty_views: FxHashSet<EntityId>, | 262 | pub(crate) dirty_views: HashSet<EntityId>, |
| 263 | pub(crate) focus_handles: Arc<RwLock<SlotMap<FocusId, AtomicUsize>>>, | 263 | pub(crate) focus_handles: Arc<RwLock<SlotMap<FocusId, AtomicUsize>>>, |
| 264 | focus_listeners: SubscriberSet<(), AnyWindowFocusListener>, | 264 | focus_listeners: SubscriberSet<(), AnyWindowFocusListener>, |
| 265 | focus_lost_listeners: SubscriberSet<(), AnyObserver>, | 265 | focus_lost_listeners: SubscriberSet<(), AnyObserver>, |
| @@ -428,7 +428,7 @@ impl Window { · 162 unmodified lines | |||
| 428 | element_id_stack: GlobalElementId::default(), | 428 | element_id_stack: GlobalElementId::default(), |
| 429 | rendered_frame: Frame::new(DispatchTree::new(cx.keymap.clone(), cx.actions.clone())), | 429 | rendered_frame: Frame::new(DispatchTree::new(cx.keymap.clone(), cx.actions.clone())), |
| 430 | next_frame: Frame::new(DispatchTree::new(cx.keymap.clone(), cx.actions.clone())), | 430 | next_frame: Frame::new(DispatchTree::new(cx.keymap.clone(), cx.actions.clone())), |
| 431 | dirty_views: FxHashSet::default(), | 431 | dirty_views: HashSet::default(), |
| 432 | focus_handles: Arc::new(RwLock::new(SlotMap::with_key())), | 432 | focus_handles: Arc::new(RwLock::new(SlotMap::with_key())), |
| 433 | focus_listeners: SubscriberSet::new(), | 433 | focus_listeners: SubscriberSet::new(), |
| 434 | focus_lost_listeners: SubscriberSet::new(), | 434 | focus_lost_listeners: SubscriberSet::new(), |
| @@ -21,7 +21,7 @@ use std::{ · 20 unmodified lines | |||
| 21 | }; | 21 | }; |
| 22 | 22 | ||
| 23 | use anyhow::Result; | 23 | use anyhow::Result; |
| 24 | use collections::{FxHashMap, FxHashSet}; | 24 | use collections::{HashMap, HashSet}; |
| 25 | use derive_more::{Deref, DerefMut}; | 25 | use derive_more::{Deref, DerefMut}; |
| 26 | use media::core_video::CVImageBuffer; | 26 | use media::core_video::CVImageBuffer; |
| 27 | use smallvec::SmallVec; | 27 | use smallvec::SmallVec; |
| @@ -53,8 +53,8 @@ pub(crate) struct TooltipRequest { · 25 unmodified lines | |||
| 53 | pub(crate) struct Frame { | 53 | pub(crate) struct Frame { |
| 54 | pub(crate) focus: Option<FocusId>, | 54 | pub(crate) focus: Option<FocusId>, |
| 55 | pub(crate) window_active: bool, | 55 | pub(crate) window_active: bool, |
| 56 | pub(crate) element_states: FxHashMap<GlobalElementId, ElementStateBox>, | 56 | pub(crate) element_states: HashMap<GlobalElementId, ElementStateBox>, |
| 57 | pub(crate) mouse_listeners: FxHashMap<TypeId, Vec<(StackingOrder, EntityId, AnyMouseListener)>>, | 57 | pub(crate) mouse_listeners: HashMap<TypeId, Vec<(StackingOrder, EntityId, AnyMouseListener)>>, |
| 58 | pub(crate) dispatch_tree: DispatchTree, | 58 | pub(crate) dispatch_tree: DispatchTree, |
| 59 | pub(crate) scene: Scene, | 59 | pub(crate) scene: Scene, |
| 60 | pub(crate) depth_map: Vec<(StackingOrder, EntityId, Bounds<Pixels>)>, | 60 | pub(crate) depth_map: Vec<(StackingOrder, EntityId, Bounds<Pixels>)>, |
| @@ -65,13 +65,13 @@ pub(crate) struct Frame { · 4 unmodified lines | |||
| 65 | pub(crate) element_offset_stack: Vec<Point<Pixels>>, | 65 | pub(crate) element_offset_stack: Vec<Point<Pixels>>, |
| 66 | pub(crate) requested_input_handler: Option<RequestedInputHandler>, | 66 | pub(crate) requested_input_handler: Option<RequestedInputHandler>, |
| 67 | pub(crate) tooltip_request: Option<TooltipRequest>, | 67 | pub(crate) tooltip_request: Option<TooltipRequest>, |
| 68 | pub(crate) cursor_styles: FxHashMap<EntityId, CursorStyle>, | 68 | pub(crate) cursor_styles: HashMap<EntityId, CursorStyle>, |
| 69 | pub(crate) requested_cursor_style: Option<CursorStyle>, | 69 | pub(crate) requested_cursor_style: Option<CursorStyle>, |
| 70 | pub(crate) view_stack: Vec<EntityId>, | 70 | pub(crate) view_stack: Vec<EntityId>, |
| 71 | pub(crate) reused_views: FxHashSet<EntityId>, | 71 | pub(crate) reused_views: HashSet<EntityId>, |
| 72 | 72 | ||
| 73 | #[cfg(any(test, feature = "test-support"))] | 73 | #[cfg(any(test, feature = "test-support"))] |
| 74 | pub(crate) debug_bounds: collections::FxHashMap<String, Bounds<Pixels>>, | 74 | pub(crate) debug_bounds: collections::HashMap<String, Bounds<Pixels>>, |
| 75 | } | 75 | } |
| 76 | 76 | ||
| 77 | impl Frame { | 77 | impl Frame { |
| @@ -79,8 +79,8 @@ impl Frame { · 1 unmodified line | |||
| 79 | Frame { | 79 | Frame { |
| 80 | focus: None, | 80 | focus: None, |
| 81 | window_active: false, | 81 | window_active: false, |
| 82 | element_states: FxHashMap::default(), | 82 | element_states: HashMap::default(), |
| 83 | mouse_listeners: FxHashMap::default(), | 83 | mouse_listeners: HashMap::default(), |
| 84 | dispatch_tree, | 84 | dispatch_tree, |
| 85 | scene: Scene::default(), | 85 | scene: Scene::default(), |
| 86 | depth_map: Vec::new(), | 86 | depth_map: Vec::new(), |
| @@ -91,13 +91,13 @@ impl Frame { · 4 unmodified lines | |||
| 91 | element_offset_stack: Vec::new(), | 91 | element_offset_stack: Vec::new(), |
| 92 | requested_input_handler: None, | 92 | requested_input_handler: None, |
| 93 | tooltip_request: None, | 93 | tooltip_request: None, |
| 94 | cursor_styles: FxHashMap::default(), | 94 | cursor_styles: HashMap::default(), |
| 95 | requested_cursor_style: None, | 95 | requested_cursor_style: None, |
| 96 | view_stack: Vec::new(), | 96 | view_stack: Vec::new(), |
| 97 | reused_views: FxHashSet::default(), | 97 | reused_views: HashSet::default(), |
| 98 | 98 | ||
| 99 | #[cfg(any(test, feature = "test-support"))] | 99 | #[cfg(any(test, feature = "test-support"))] |
| 100 | debug_bounds: FxHashMap::default(), | 100 | debug_bounds: HashMap::default(), |
| 101 | } | 101 | } |
| 102 | } | 102 | } |
| 103 | 103 | ||
| @@ -8,6 +8,7 @@ use editor::{actions::Cancel, scroll::Autoscroll, Editor}; · 7 unmodified lines | |||
| 8 | use file_associations::FileAssociations; | 8 | use file_associations::FileAssociations; |
| 9 | 9 | ||
| 10 | use anyhow::{anyhow, Result}; | 10 | use anyhow::{anyhow, Result}; |
| 11 | use collections::{hash_map, HashMap}; | ||
| 11 | use gpui::{ | 12 | use gpui::{ |
| 12 | actions, div, overlay, px, uniform_list, Action, AppContext, AssetSource, AsyncWindowContext, | 13 | actions, div, overlay, px, uniform_list, Action, AppContext, AssetSource, AsyncWindowContext, |
| 13 | ClipboardItem, DismissEvent, Div, EventEmitter, FocusHandle, FocusableView, InteractiveElement, | 14 | ClipboardItem, DismissEvent, Div, EventEmitter, FocusHandle, FocusableView, InteractiveElement, |
| @@ -22,14 +23,7 @@ use project::{ · 8 unmodified lines | |||
| 22 | }; | 23 | }; |
| 23 | use project_panel_settings::{ProjectPanelDockPosition, ProjectPanelSettings}; | 24 | use project_panel_settings::{ProjectPanelDockPosition, ProjectPanelSettings}; |
| 24 | use serde::{Deserialize, Serialize}; | 25 | use serde::{Deserialize, Serialize}; |
| 25 | use std::{ | 26 | use std::{cmp::Ordering, ffi::OsStr, ops::Range, path::Path, sync::Arc}; |
| 26 | cmp::Ordering, | ||
| 27 | collections::{hash_map, HashMap}, | ||
| 28 | ffi::OsStr, | ||
| 29 | ops::Range, | ||
| 30 | path::Path, | ||
| 31 | sync::Arc, | ||
| 32 | }; | ||
| 33 | use theme::ThemeSettings; | 27 | use theme::ThemeSettings; |
| 34 | use ui::{prelude::*, v_flex, ContextMenu, Icon, KeyBinding, Label, ListItem}; | 28 | use ui::{prelude::*, v_flex, ContextMenu, Icon, KeyBinding, Label, ListItem}; |
| 35 | use unicase::UniCase; | 29 | use unicase::UniCase; |
| @@ -1699,15 +1693,13 @@ impl ClipboardEntry { · 1663 unmodified lines | |||
| 1699 | #[cfg(test)] | 1693 | #[cfg(test)] |
| 1700 | mod tests { | 1694 | mod tests { |
| 1701 | use super::*; | 1695 | use super::*; |
| 1696 | use collections::HashSet; | ||
| 1702 | use gpui::{TestAppContext, View, VisualTestContext, WindowHandle}; | 1697 | use gpui::{TestAppContext, View, VisualTestContext, WindowHandle}; |
| 1703 | use pretty_assertions::assert_eq; | 1698 | use pretty_assertions::assert_eq; |
| 1704 | use project::{project_settings::ProjectSettings, FakeFs}; | 1699 | use project::{project_settings::ProjectSettings, FakeFs}; |
| 1705 | use serde_json::json; | 1700 | use serde_json::json; |
| 1706 | use settings::SettingsStore; | 1701 | use settings::SettingsStore; |
| 1707 | use std::{ | 1702 | use std::path::{Path, PathBuf}; |
| 1708 | collections::HashSet, | ||
| 1709 | path::{Path, PathBuf}, | ||
| 1710 | }; | ||
| 1711 | use workspace::AppState; | 1703 | use workspace::AppState; |
| 1712 | 1704 | ||
| 1713 | #[gpui::test] | 1705 | #[gpui::test] |
| @@ -3509,7 +3501,7 @@ mod tests { · 1795 unmodified lines | |||
| 3509 | cx: &mut VisualTestContext, | 3501 | cx: &mut VisualTestContext, |
| 3510 | ) -> Vec<String> { | 3502 | ) -> Vec<String> { |
| 3511 | let mut result = Vec::new(); | 3503 | let mut result = Vec::new(); |
| 3512 | let mut project_entries = HashSet::new(); | 3504 | let mut project_entries = HashSet::default(); |
| 3513 | let mut has_editor = false; | 3505 | let mut has_editor = false; |
| 3514 | 3506 | ||
| 3515 | panel.update(cx, |panel, cx| { | 3507 | panel.update(cx, |panel, cx| { |
| @@ -25,11 +25,11 @@ use project::{ · 24 unmodified lines | |||
| 25 | }; | 25 | }; |
| 26 | use semantic_index::{SemanticIndex, SemanticIndexStatus}; | 26 | use semantic_index::{SemanticIndex, SemanticIndexStatus}; |
| 27 | 27 | ||
| 28 | use collections::HashSet; | ||
| 28 | use settings::Settings; | 29 | use settings::Settings; |
| 29 | use smol::stream::StreamExt; | 30 | use smol::stream::StreamExt; |
| 30 | use std::{ | 31 | use std::{ |
| 31 | any::{Any, TypeId}, | 32 | any::{Any, TypeId}, |
| 32 | collections::HashSet, | ||
| 33 | mem, | 33 | mem, |
| 34 | ops::{Not, Range}, | 34 | ops::{Not, Range}, |
| 35 | path::PathBuf, | 35 | path::PathBuf, |
| @@ -955,7 +955,7 @@ impl ProjectSearchView { · 919 unmodified lines | |||
| 955 | semantic_state: None, | 955 | semantic_state: None, |
| 956 | semantic_permissioned: None, | 956 | semantic_permissioned: None, |
| 957 | search_options: options, | 957 | search_options: options, |
| 958 | panels_with_errors: HashSet::new(), | 958 | panels_with_errors: HashSet::default(), |
| 959 | active_match_index: None, | 959 | active_match_index: None, |
| 960 | query_editor_was_focused: false, | 960 | query_editor_was_focused: false, |
| 961 | included_files_editor, | 961 | included_files_editor, |
| @@ -3,6 +3,7 @@ use ai::{ · 2 unmodified lines | |||
| 3 | models::TruncationDirection, | 3 | models::TruncationDirection, |
| 4 | }; | 4 | }; |
| 5 | use anyhow::{anyhow, Result}; | 5 | use anyhow::{anyhow, Result}; |
| 6 | use collections::HashSet; | ||
| 6 | use language::{Grammar, Language}; | 7 | use language::{Grammar, Language}; |
| 7 | use rusqlite::{ | 8 | use rusqlite::{ |
| 8 | types::{FromSql, FromSqlResult, ToSqlOutput, ValueRef}, | 9 | types::{FromSql, FromSqlResult, ToSqlOutput, ValueRef}, |
| @@ -12,7 +13,6 @@ use sha1::{Digest, Sha1}; · 3 unmodified lines | |||
| 12 | use std::{ | 13 | use std::{ |
| 13 | borrow::Cow, | 14 | borrow::Cow, |
| 14 | cmp::{self, Reverse}, | 15 | cmp::{self, Reverse}, |
| 15 | collections::HashSet, | ||
| 16 | ops::Range, | 16 | ops::Range, |
| 17 | path::Path, | 17 | path::Path, |
| 18 | sync::Arc, | 18 | sync::Arc, |
| @@ -267,7 +267,7 @@ impl CodeContextRetriever { · 248 unmodified lines | |||
| 267 | 267 | ||
| 268 | let mut spans = Vec::new(); | 268 | let mut spans = Vec::new(); |
| 269 | let mut collapsed_ranges_within = Vec::new(); | 269 | let mut collapsed_ranges_within = Vec::new(); |
| 270 | let mut parsed_name_ranges = HashSet::new(); | 270 | let mut parsed_name_ranges = HashSet::default(); |
| 271 | for (i, context_match) in matches.iter().enumerate() { | 271 | for (i, context_match) in matches.iter().enumerate() { |
| 272 | // Items which are collapsible but not embeddable have no item range | 272 | // Items which are collapsible but not embeddable have no item range |
| 273 | let item_range = if let Some(item_range) = context_match.item_range.clone() { | 273 | let item_range = if let Some(item_range) = context_match.item_range.clone() { |
| @@ -7,6 +7,7 @@ license = "GPL-3.0-or-later" · 6 unmodified lines | |||
| 7 | 7 | ||
| 8 | [dependencies] | 8 | [dependencies] |
| 9 | anyhow.workspace = true | 9 | anyhow.workspace = true |
| 10 | collections.workspace = true | ||
| 10 | futures.workspace = true | 11 | futures.workspace = true |
| 11 | indoc.workspace = true | 12 | indoc.workspace = true |
| 12 | lazy_static.workspace = true | 13 | lazy_static.workspace = true |
| @@ -1,8 +1,9 @@ | |||
| 1 | use anyhow::Context; | 1 | use anyhow::Context; |
| 2 | use collections::HashMap; | ||
| 2 | use futures::{channel::oneshot, Future, FutureExt}; | 3 | use futures::{channel::oneshot, Future, FutureExt}; |
| 3 | use lazy_static::lazy_static; | 4 | use lazy_static::lazy_static; |
| 4 | use parking_lot::{Mutex, RwLock}; | 5 | use parking_lot::{Mutex, RwLock}; |
| 5 | use std::{collections::HashMap, marker::PhantomData, ops::Deref, sync::Arc, thread}; | 6 | use std::{marker::PhantomData, ops::Deref, sync::Arc, thread}; |
| 6 | use thread_local::ThreadLocal; | 7 | use thread_local::ThreadLocal; |
| 7 | 8 | ||
| 8 | use crate::{connection::Connection, domain::Migrator, util::UnboundedSyncSender}; | 9 | use crate::{connection::Connection, domain::Migrator, util::UnboundedSyncSender}; |
| @@ -13,6 +13,7 @@ doctest = false · 12 unmodified lines | |||
| 13 | [dependencies] | 13 | [dependencies] |
| 14 | alacritty_terminal = "0.22.0" | 14 | alacritty_terminal = "0.22.0" |
| 15 | anyhow.workspace = true | 15 | anyhow.workspace = true |
| 16 | collections.workspace = true | ||
| 16 | db.workspace = true | 17 | db.workspace = true |
| 17 | dirs = "4.0.0" | 18 | dirs = "4.0.0" |
| 18 | futures.workspace = true | 19 | futures.workspace = true |
| @@ -30,6 +30,7 @@ use mappings::mouse::{ · 29 unmodified lines | |||
| 30 | scroll_report, | 30 | scroll_report, |
| 31 | }; | 31 | }; |
| 32 | 32 | ||
| 33 | use collections::{HashMap, VecDeque}; | ||
| 33 | use procinfo::LocalProcessInfo; | 34 | use procinfo::LocalProcessInfo; |
| 34 | use serde::{Deserialize, Serialize}; | 35 | use serde::{Deserialize, Serialize}; |
| 35 | use settings::Settings; | 36 | use settings::Settings; |
| @@ -39,7 +40,6 @@ use util::truncate_and_trailoff; · 3 unmodified lines | |||
| 39 | 40 | ||
| 40 | use std::{ | 41 | use std::{ |
| 41 | cmp::{self, min}, | 42 | cmp::{self, min}, |
| 42 | collections::{HashMap, VecDeque}, | ||
| 43 | fmt::Display, | 43 | fmt::Display, |
| 44 | ops::{Deref, Index, RangeInclusive}, | 44 | ops::{Deref, Index, RangeInclusive}, |
| 45 | os::unix::prelude::AsRawFd, | 45 | os::unix::prelude::AsRawFd, |
| @@ -1,3 +1,4 @@ | |||
| 1 | use collections::HashMap; | ||
| 1 | use gpui::{px, AbsoluteLength, AppContext, FontFeatures, Pixels}; | 2 | use gpui::{px, AbsoluteLength, AppContext, FontFeatures, Pixels}; |
| 2 | use schemars::{ | 3 | use schemars::{ |
| 3 | gen::SchemaGenerator, | 4 | gen::SchemaGenerator, |
| @@ -7,7 +8,7 @@ use schemars::{ · 3 unmodified lines | |||
| 7 | use serde_derive::{Deserialize, Serialize}; | 8 | use serde_derive::{Deserialize, Serialize}; |
| 8 | use serde_json::Value; | 9 | use serde_json::Value; |
| 9 | use settings::SettingsJsonSchemaParams; | 10 | use settings::SettingsJsonSchemaParams; |
| 10 | use std::{collections::HashMap, path::PathBuf}; | 11 | use std::path::PathBuf; |
| 11 | 12 | ||
| 12 | #[derive(Copy, Clone, Debug, Serialize, Deserialize, JsonSchema, PartialEq, Eq)] | 13 | #[derive(Copy, Clone, Debug, Serialize, Deserialize, JsonSchema, PartialEq, Eq)] |
| 13 | #[serde(rename_all = "snake_case")] | 14 | #[serde(rename_all = "snake_case")] |
| @@ -8,11 +8,7 @@ license = "GPL-3.0-or-later" · 7 unmodified lines | |||
| 8 | [features] | 8 | [features] |
| 9 | default = [] | 9 | default = [] |
| 10 | stories = ["dep:itertools", "dep:story"] | 10 | stories = ["dep:itertools", "dep:story"] |
| 11 | test-support = [ | 11 | test-support = ["gpui/test-support", "fs/test-support", "settings/test-support"] |
| 12 | "gpui/test-support", | ||
| 13 | "fs/test-support", | ||
| 14 | "settings/test-support" | ||
| 15 | ] | ||
| 16 | 12 | ||
| 17 | [lib] | 13 | [lib] |
| 18 | path = "src/theme.rs" | 14 | path = "src/theme.rs" |
| @@ -20,6 +16,7 @@ doctest = false · 1 unmodified line | |||
| 20 | 16 | ||
| 21 | [dependencies] | 17 | [dependencies] |
| 22 | anyhow.workspace = true | 18 | anyhow.workspace = true |
| 19 | collections.workspace = true | ||
| 23 | color.workspace = true | 20 | color.workspace = true |
| 24 | derive_more.workspace = true | 21 | derive_more.workspace = true |
| 25 | fs.workspace = true | 22 | fs.workspace = true |
| @@ -1,8 +1,8 @@ | |||
| 1 | use std::collections::HashMap; | ||
| 2 | use std::path::Path; | 1 | use std::path::Path; |
| 3 | use std::sync::Arc; | 2 | use std::sync::Arc; |
| 4 | 3 | ||
| 5 | use anyhow::{anyhow, Context, Result}; | 4 | use anyhow::{anyhow, Context, Result}; |
| 5 | use collections::HashMap; | ||
| 6 | use derive_more::{Deref, DerefMut}; | 6 | use derive_more::{Deref, DerefMut}; |
| 7 | use fs::Fs; | 7 | use fs::Fs; |
| 8 | use futures::StreamExt; | 8 | use futures::StreamExt; |
| @@ -64,7 +64,7 @@ impl ThemeRegistry { · 55 unmodified lines | |||
| 64 | pub fn new(assets: Box<dyn AssetSource>) -> Self { | 64 | pub fn new(assets: Box<dyn AssetSource>) -> Self { |
| 65 | let registry = Self { | 65 | let registry = Self { |
| 66 | state: RwLock::new(ThemeRegistryState { | 66 | state: RwLock::new(ThemeRegistryState { |
| 67 | themes: HashMap::new(), | 67 | themes: HashMap::default(), |
| 68 | }), | 68 | }), |
| 69 | assets, | 69 | assets, |
| 70 | }; | 70 | }; |
| @@ -15,6 +15,7 @@ test-support = ["tempfile", "git2"] · 14 unmodified lines | |||
| 15 | [dependencies] | 15 | [dependencies] |
| 16 | anyhow.workspace = true | 16 | anyhow.workspace = true |
| 17 | backtrace = "0.3" | 17 | backtrace = "0.3" |
| 18 | collections.workspace = true | ||
| 18 | dirs = "3.0" | 19 | dirs = "3.0" |
| 19 | futures.workspace = true | 20 | futures.workspace = true |
| 20 | git2 = { workspace = true, optional = true } | 21 | git2 = { workspace = true, optional = true } |
| @@ -1,4 +1,5 @@ | |||
| 1 | use std::{cmp::Ordering, collections::HashMap, ops::Range}; | 1 | use collections::HashMap; |
| 2 | use std::{cmp::Ordering, ops::Range}; | ||
| 2 | 3 | ||
| 3 | /// Construct a string and a list of offsets within that string using a single | 4 | /// Construct a string and a list of offsets within that string using a single |
| 4 | /// string containing embedded position markers. | 5 | /// string containing embedded position markers. |
| @@ -1,6 +1,7 @@ | |||
| 1 | use anyhow::{anyhow, Context, Result}; | 1 | use anyhow::{anyhow, Context, Result}; |
| 2 | use cli::{ipc, IpcHandshake}; | 2 | use cli::{ipc, IpcHandshake}; |
| 3 | use cli::{ipc::IpcSender, CliRequest, CliResponse}; | 3 | use cli::{ipc::IpcSender, CliRequest, CliResponse}; |
| 4 | use collections::HashMap; | ||
| 4 | use editor::scroll::Autoscroll; | 5 | use editor::scroll::Autoscroll; |
| 5 | use editor::Editor; | 6 | use editor::Editor; |
| 6 | use futures::channel::mpsc::{UnboundedReceiver, UnboundedSender}; | 7 | use futures::channel::mpsc::{UnboundedReceiver, UnboundedSender}; |
| @@ -10,7 +11,6 @@ use gpui::{AppContext, AsyncAppContext, Global}; · 3 unmodified lines | |||
| 10 | use itertools::Itertools; | 11 | use itertools::Itertools; |
| 11 | use language::{Bias, Point}; | 12 | use language::{Bias, Point}; |
| 12 | use release_channel::parse_zed_link; | 13 | use release_channel::parse_zed_link; |
| 13 | use std::collections::HashMap; | ||
| 14 | use std::ffi::OsStr; | 14 | use std::ffi::OsStr; |
| 15 | use std::os::unix::prelude::OsStrExt; | 15 | use std::os::unix::prelude::OsStrExt; |
| 16 | use std::path::Path; | 16 | use std::path::Path; |
| @@ -176,7 +176,7 @@ pub async fn handle_cli_connection( · 159 unmodified lines | |||
| 176 | if let Some(request) = requests.next().await { | 176 | if let Some(request) = requests.next().await { |
| 177 | match request { | 177 | match request { |
| 178 | CliRequest::Open { paths, wait } => { | 178 | CliRequest::Open { paths, wait } => { |
| 179 | let mut caret_positions = HashMap::new(); | 179 | let mut caret_positions = HashMap::default(); |
| 180 | 180 | ||
| 181 | let paths = if paths.is_empty() { | 181 | let paths = if paths.is_empty() { |
| 182 | workspace::last_opened_workspace_paths() | 182 | workspace::last_opened_workspace_paths() |
| @@ -733,6 +733,7 @@ fn open_settings_file( · 732 unmodified lines | |||
| 733 | mod tests { | 733 | mod tests { |
| 734 | use super::*; | 734 | use super::*; |
| 735 | use assets::Assets; | 735 | use assets::Assets; |
| 736 | use collections::HashSet; | ||
| 736 | use editor::{scroll::Autoscroll, DisplayPoint, Editor}; | 737 | use editor::{scroll::Autoscroll, DisplayPoint, Editor}; |
| 737 | use gpui::{ | 738 | use gpui::{ |
| 738 | actions, Action, AnyWindowHandle, AppContext, AssetSource, Entity, TestAppContext, | 739 | actions, Action, AnyWindowHandle, AppContext, AssetSource, Entity, TestAppContext, |
| @@ -742,10 +743,7 @@ mod tests { · 3 unmodified lines | |||
| 742 | use project::{project_settings::ProjectSettings, Project, ProjectPath}; | 743 | use project::{project_settings::ProjectSettings, Project, ProjectPath}; |
| 743 | use serde_json::json; | 744 | use serde_json::json; |
| 744 | use settings::{handle_settings_file_changes, watch_config_file, SettingsStore}; | 745 | use settings::{handle_settings_file_changes, watch_config_file, SettingsStore}; |
| 745 | use std::{ | 746 | use std::path::{Path, PathBuf}; |
| 746 | collections::HashSet, | ||
| 747 | path::{Path, PathBuf}, | ||
| 748 | }; | ||
| 749 | use theme::{ThemeRegistry, ThemeSettings}; | 747 | use theme::{ThemeRegistry, ThemeSettings}; |
| 750 | use workspace::{ | 748 | use workspace::{ |
| 751 | item::{Item, ItemHandle}, | 749 | item::{Item, ItemHandle}, |