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.

Fix formatting

Nathan Sobo8136d8a8a681
diff --git a/crates/call/src/room.rs b/crates/call/src/room.rs
index 98917eaeb6b..47bd12e3a11 100644
--- a/crates/call/src/room.rs
+++ b/crates/call/src/room.rs
@@ -10,9 +10,7 @@ use client::{
use collections::{BTreeMap, HashMap, HashSet};
use fs::Fs;
use futures::{FutureExt, StreamExt};
-use gpui::{
- AsyncAppContext, Entity, ModelContext, ModelHandle, AppContext, Task, WeakModelHandle,
-};
+use gpui::{AppContext, AsyncAppContext, Entity, ModelContext, ModelHandle, Task, WeakModelHandle};
use language::LanguageRegistry;
use live_kit_client::{LocalTrackPublication, LocalVideoTrack, RemoteVideoTrackUpdate};
use postage::stream::Stream;
@@ -70,10 +68,7 @@ impl Entity for Room {
}
}
- fn app_will_quit(
- &mut self,
- cx: &mut AppContext,
- ) -> Option<Pin<Box<dyn Future<Output = ()>>>> {
+ fn app_will_quit(&mut self, cx: &mut AppContext) -> Option<Pin<Box<dyn Future<Output = ()>>>> {
if self.status.is_online() {
let leave = self.leave_internal(cx);
Some(
diff --git a/crates/collab_ui/src/contact_notification.rs b/crates/collab_ui/src/contact_notification.rs
index 4bbba29ce92..5badae695bf 100644
--- a/crates/collab_ui/src/contact_notification.rs
+++ b/crates/collab_ui/src/contact_notification.rs
@@ -3,8 +3,8 @@ use std::sync::Arc;
use crate::notifications::render_user_notification;
use client::{ContactEventKind, User, UserStore};
use gpui::{
- elements::*, impl_internal_actions, Entity, ModelHandle, AppContext, RenderContext,
- View, ViewContext,
+ elements::*, impl_internal_actions, AppContext, Entity, ModelHandle, RenderContext, View,
+ ViewContext,
};
use workspace::notifications::Notification;
diff --git a/crates/collab_ui/src/incoming_call_notification.rs b/crates/collab_ui/src/incoming_call_notification.rs
index 6254228a956..5917add2808 100644
--- a/crates/collab_ui/src/incoming_call_notification.rs
+++ b/crates/collab_ui/src/incoming_call_notification.rs
@@ -4,8 +4,8 @@ use futures::StreamExt;
use gpui::{
elements::*,
geometry::{rect::RectF, vector::vec2f},
- impl_internal_actions, CursorStyle, Entity, MouseButton, AppContext, RenderContext,
- View, ViewContext, WindowBounds, WindowKind, WindowOptions,
+ impl_internal_actions, AppContext, CursorStyle, Entity, MouseButton, RenderContext, View,
+ ViewContext, WindowBounds, WindowKind, WindowOptions,
};
use settings::Settings;
use util::ResultExt;
diff --git a/crates/collab_ui/src/project_shared_notification.rs b/crates/collab_ui/src/project_shared_notification.rs
index 769b89c2bc1..7e2f1e97b7e 100644
--- a/crates/collab_ui/src/project_shared_notification.rs
+++ b/crates/collab_ui/src/project_shared_notification.rs
@@ -5,8 +5,8 @@ use gpui::{
actions,
elements::*,
geometry::{rect::RectF, vector::vec2f},
- CursorStyle, Entity, MouseButton, AppContext, RenderContext, View, ViewContext,
- WindowBounds, WindowKind, WindowOptions,
+ AppContext, CursorStyle, Entity, MouseButton, RenderContext, View, ViewContext, WindowBounds,
+ WindowKind, WindowOptions,
};
use settings::Settings;
use std::sync::Arc;
diff --git a/crates/collab_ui/src/sharing_status_indicator.rs b/crates/collab_ui/src/sharing_status_indicator.rs
index cc77a593671..c9eee05b01e 100644
--- a/crates/collab_ui/src/sharing_status_indicator.rs
+++ b/crates/collab_ui/src/sharing_status_indicator.rs
@@ -2,7 +2,7 @@ use call::ActiveCall;
use gpui::{
color::Color,
elements::{MouseEventHandler, Svg},
- Appearance, Element, ElementBox, Entity, MouseButton, AppContext, RenderContext, View,
+ AppContext, Appearance, Element, ElementBox, Entity, MouseButton, RenderContext, View,
};
use settings::Settings;
diff --git a/crates/command_palette/src/command_palette.rs b/crates/command_palette/src/command_palette.rs
index a834a17ab62..bc49f4f1019 100644
--- a/crates/command_palette/src/command_palette.rs
+++ b/crates/command_palette/src/command_palette.rs
@@ -4,7 +4,7 @@ use gpui::{
actions,
elements::{ChildView, Flex, Label, ParentElement},
keymap_matcher::Keystroke,
- Action, AnyViewHandle, Element, Entity, MouseState, AppContext, RenderContext, View,
+ Action, AnyViewHandle, AppContext, Element, Entity, MouseState, RenderContext, View,
ViewContext, ViewHandle,
};
use picker::{Picker, PickerDelegate};
diff --git a/crates/copilot/src/sign_in.rs b/crates/copilot/src/sign_in.rs
index dba1a5e4d8a..b9d5305dcb2 100644
--- a/crates/copilot/src/sign_in.rs
+++ b/crates/copilot/src/sign_in.rs
@@ -1,6 +1,6 @@
use crate::{request::PromptUserDeviceFlow, Copilot, Status};
use gpui::{
- elements::*, geometry::rect::RectF, ClipboardItem, Element, Entity, AppContext, View,
+ elements::*, geometry::rect::RectF, AppContext, ClipboardItem, Element, Entity, View,
ViewContext, ViewHandle, WindowKind, WindowOptions,
};
use settings::Settings;
diff --git a/crates/diagnostics/src/items.rs b/crates/diagnostics/src/items.rs
index d96d5fd1fb0..d251d404a0c 100644
--- a/crates/diagnostics/src/items.rs
+++ b/crates/diagnostics/src/items.rs
@@ -1,8 +1,8 @@
use collections::HashSet;
use editor::{Editor, GoToDiagnostic};
use gpui::{
- elements::*, platform::CursorStyle, serde_json, Entity, ModelHandle, MouseButton,
- AppContext, RenderContext, Subscription, View, ViewContext, ViewHandle, WeakViewHandle,
+ elements::*, platform::CursorStyle, serde_json, AppContext, Entity, ModelHandle, MouseButton,
+ RenderContext, Subscription, View, ViewContext, ViewHandle, WeakViewHandle,
};
use language::Diagnostic;
use project::Project;
diff --git a/crates/editor/src/display_map/tab_map.rs b/crates/editor/src/display_map/tab_map.rs
index e44e345def7..2932994670c 100644
--- a/crates/editor/src/display_map/tab_map.rs
+++ b/crates/editor/src/display_map/tab_map.rs
@@ -640,9 +640,7 @@ mod tests {
}
#[gpui::test]
- fn test_long_lines_with_character_spanning_max_expansion_column(
- cx: &mut gpui::AppContext,
- ) {
+ fn test_long_lines_with_character_spanning_max_expansion_column(cx: &mut gpui::AppContext) {
let max_expansion_column = 8;
let input = "abcdefg⋯hij";
diff --git a/crates/editor/src/scroll.rs b/crates/editor/src/scroll.rs
index df6188d58e0..300d4c88f53 100644
--- a/crates/editor/src/scroll.rs
+++ b/crates/editor/src/scroll.rs
@@ -9,7 +9,7 @@ use std::{
use gpui::{
geometry::vector::{vec2f, Vector2F},
- Axis, AppContext, Task, ViewContext,
+ AppContext, Axis, Task, ViewContext,
};
use language::{Bias, Point};
use util::ResultExt;
diff --git a/crates/editor/src/scroll/actions.rs b/crates/editor/src/scroll/actions.rs
index 80b8c1f2610..3b73a4bcbda 100644
--- a/crates/editor/src/scroll/actions.rs
+++ b/crates/editor/src/scroll/actions.rs
@@ -1,6 +1,5 @@
use gpui::{
- actions, geometry::vector::Vector2F, impl_internal_actions, Axis, AppContext,
- ViewContext,
+ actions, geometry::vector::Vector2F, impl_internal_actions, AppContext, Axis, ViewContext,
};
use language::Bias;
diff --git a/crates/feedback/src/feedback.rs b/crates/feedback/src/feedback.rs
index 40bebb01700..378c94180d7 100644
--- a/crates/feedback/src/feedback.rs
+++ b/crates/feedback/src/feedback.rs
@@ -6,7 +6,7 @@ pub mod submit_feedback_button;
use std::sync::Arc;
mod system_specs;
-use gpui::{actions, impl_actions, ClipboardItem, AppContext, PromptLevel, ViewContext};
+use gpui::{actions, impl_actions, AppContext, ClipboardItem, PromptLevel, ViewContext};
use serde::Deserialize;
use system_specs::SystemSpecs;
use workspace::{AppState, Workspace};
diff --git a/crates/recent_projects/src/recent_projects.rs b/crates/recent_projects/src/recent_projects.rs
index 3cb94ecee7a..58369f4aa5b 100644
--- a/crates/recent_projects/src/recent_projects.rs
+++ b/crates/recent_projects/src/recent_projects.rs
@@ -4,8 +4,8 @@ use fuzzy::{StringMatch, StringMatchCandidate};
use gpui::{
actions,
elements::{ChildView, Flex, ParentElement},
- AnyViewHandle, Element, ElementBox, Entity, AppContext, RenderContext, Task, View,
- ViewContext, ViewHandle,
+ AnyViewHandle, AppContext, Element, ElementBox, Entity, RenderContext, Task, View, ViewContext,
+ ViewHandle,
};
use highlighted_workspace_location::HighlightedWorkspaceLocation;
use ordered_float::OrderedFloat;
diff --git a/crates/staff_mode/src/staff_mode.rs b/crates/staff_mode/src/staff_mode.rs
index a222aafb02a..49fadc0b2cc 100644
--- a/crates/staff_mode/src/staff_mode.rs
+++ b/crates/staff_mode/src/staff_mode.rs
@@ -13,10 +13,7 @@ impl std::ops::Deref for StaffMode {
/// Despite what the type system requires me to tell you, the init function will only be called a once
/// as soon as we know that the staff mode is enabled.
-pub fn staff_mode<F: FnMut(&mut AppContext) + 'static>(
- cx: &mut AppContext,
- mut init: F,
-) {
+pub fn staff_mode<F: FnMut(&mut AppContext) + 'static>(cx: &mut AppContext, mut init: F) {
if **cx.default_global::<StaffMode>() {
init(cx)
} else {
@@ -32,10 +29,7 @@ pub fn staff_mode<F: FnMut(&mut AppContext) + 'static>(
/// Immediately checks and runs the init function if the staff mode is not enabled.
/// This is only included for symettry with staff_mode() above
-pub fn not_staff_mode<F: FnOnce(&mut AppContext) + 'static>(
- cx: &mut AppContext,
- init: F,
-) {
+pub fn not_staff_mode<F: FnOnce(&mut AppContext) + 'static>(cx: &mut AppContext, init: F) {
if !**cx.default_global::<StaffMode>() {
init(cx)
}
diff --git a/crates/terminal_view/src/terminal_button.rs b/crates/terminal_view/src/terminal_button.rs
index 934ba4f107b..90f80f67124 100644
--- a/crates/terminal_view/src/terminal_button.rs
+++ b/crates/terminal_view/src/terminal_button.rs
@@ -1,8 +1,7 @@
use context_menu::{ContextMenu, ContextMenuItem};
use gpui::{
- elements::*, impl_internal_actions, CursorStyle, Element, ElementBox, Entity, MouseButton,
- AppContext, RenderContext, View, ViewContext, ViewHandle, WeakModelHandle,
- WeakViewHandle,
+ elements::*, impl_internal_actions, AppContext, CursorStyle, Element, ElementBox, Entity,
+ MouseButton, RenderContext, View, ViewContext, ViewHandle, WeakModelHandle, WeakViewHandle,
};
use settings::Settings;
use std::any::TypeId;
diff --git a/crates/welcome/src/base_keymap_picker.rs b/crates/welcome/src/base_keymap_picker.rs
index 01d6d41c642..8c08a63dc68 100644
--- a/crates/welcome/src/base_keymap_picker.rs
+++ b/crates/welcome/src/base_keymap_picker.rs
@@ -2,7 +2,7 @@ use fuzzy::{match_strings, StringMatch, StringMatchCandidate};
use gpui::{
actions,
elements::{ChildView, Element as _, Label},
- AnyViewHandle, Entity, AppContext, View, ViewContext, ViewHandle,
+ AnyViewHandle, AppContext, Entity, View, ViewContext, ViewHandle,
};
use picker::{Picker, PickerDelegate};
use settings::{settings_file::SettingsFile, BaseKeymap, Settings};
diff --git a/crates/welcome/src/welcome.rs b/crates/welcome/src/welcome.rs
index b5941903f4f..28b0e43c571 100644
--- a/crates/welcome/src/welcome.rs
+++ b/crates/welcome/src/welcome.rs
@@ -5,7 +5,7 @@ use std::sync::Arc;
use db::kvp::KEY_VALUE_STORE;
use gpui::{
elements::{Flex, Label, ParentElement},
- Element, ElementBox, Entity, AppContext, Subscription, View, ViewContext,
+ AppContext, Element, ElementBox, Entity, Subscription, View, ViewContext,
};
use settings::{settings_file::SettingsFile, Settings};
diff --git a/crates/workspace/src/notifications.rs b/crates/workspace/src/notifications.rs
index 337d1145c03..207d0497be8 100644
--- a/crates/workspace/src/notifications.rs
+++ b/crates/workspace/src/notifications.rs
@@ -1,7 +1,7 @@
use std::{any::TypeId, ops::DerefMut};
use collections::HashSet;
-use gpui::{AnyViewHandle, Entity, AppContext, View, ViewContext, ViewHandle};
+use gpui::{AnyViewHandle, AppContext, Entity, View, ViewContext, ViewHandle};
use crate::Workspace;
@@ -138,7 +138,7 @@ pub mod simple_message_notification {
use gpui::{
actions,
elements::{Flex, MouseEventHandler, Padding, ParentElement, Svg, Text},
- impl_actions, Action, CursorStyle, Element, Entity, MouseButton, AppContext, View,
+ impl_actions, Action, AppContext, CursorStyle, Element, Entity, MouseButton, View,
ViewContext,
};
use menu::Cancel;
diff --git a/crates/zed/src/languages/yaml.rs b/crates/zed/src/languages/yaml.rs
index 337c2c06537..fadc74b6982 100644
--- a/crates/zed/src/languages/yaml.rs
+++ b/crates/zed/src/languages/yaml.rs
@@ -99,10 +99,7 @@ impl LspAdapter for YamlLspAdapter {
.log_err()
}
- fn workspace_configuration(
- &self,
- cx: &mut AppContext,
- ) -> Option<BoxFuture<'static, Value>> {
+ fn workspace_configuration(&self, cx: &mut AppContext) -> Option<BoxFuture<'static, Value>> {
let settings = cx.global::<Settings>();
Some(
future::ready(serde_json::json!({