chore: Bump Rust edition to 2024 (#27800)
Follow-up to https://github.com/zed-industries/zed/pull/27791 Release Notes: - N/A
This commit is contained in:
parent
d50905e000
commit
dc64ec9cc8
802 changed files with 3775 additions and 3662 deletions
|
@ -1,22 +1,22 @@
|
|||
mod registrar;
|
||||
|
||||
use crate::{
|
||||
search_bar::render_nav_button, FocusSearch, NextHistoryQuery, PreviousHistoryQuery, ReplaceAll,
|
||||
ReplaceNext, SearchOptions, SelectAllMatches, SelectNextMatch, SelectPreviousMatch,
|
||||
ToggleCaseSensitive, ToggleRegex, ToggleReplace, ToggleSelection, ToggleWholeWord,
|
||||
FocusSearch, NextHistoryQuery, PreviousHistoryQuery, ReplaceAll, ReplaceNext, SearchOptions,
|
||||
SelectAllMatches, SelectNextMatch, SelectPreviousMatch, ToggleCaseSensitive, ToggleRegex,
|
||||
ToggleReplace, ToggleSelection, ToggleWholeWord, search_bar::render_nav_button,
|
||||
};
|
||||
use any_vec::AnyVec;
|
||||
use anyhow::Context as _;
|
||||
use collections::HashMap;
|
||||
use editor::{
|
||||
actions::{Backtab, Tab},
|
||||
DisplayPoint, Editor, EditorElement, EditorSettings, EditorStyle,
|
||||
actions::{Backtab, Tab},
|
||||
};
|
||||
use futures::channel::oneshot;
|
||||
use gpui::{
|
||||
actions, div, impl_actions, Action, App, ClickEvent, Context, Entity, EventEmitter,
|
||||
FocusHandle, Focusable, InteractiveElement as _, IntoElement, KeyContext, ParentElement as _,
|
||||
Render, ScrollHandle, Styled, Subscription, Task, TextStyle, Window,
|
||||
Action, App, ClickEvent, Context, Entity, EventEmitter, FocusHandle, Focusable,
|
||||
InteractiveElement as _, IntoElement, KeyContext, ParentElement as _, Render, ScrollHandle,
|
||||
Styled, Subscription, Task, TextStyle, Window, actions, div, impl_actions,
|
||||
};
|
||||
use language::{Language, LanguageRegistry};
|
||||
use project::{
|
||||
|
@ -31,14 +31,14 @@ use theme::ThemeSettings;
|
|||
use zed_actions::outline::ToggleOutline;
|
||||
|
||||
use ui::{
|
||||
h_flex, prelude::*, utils::SearchInputWidth, IconButton, IconButtonShape, IconName, Tooltip,
|
||||
BASE_REM_SIZE_IN_PX,
|
||||
BASE_REM_SIZE_IN_PX, IconButton, IconButtonShape, IconName, Tooltip, h_flex, prelude::*,
|
||||
utils::SearchInputWidth,
|
||||
};
|
||||
use util::ResultExt;
|
||||
use workspace::{
|
||||
ToolbarItemEvent, ToolbarItemLocation, ToolbarItemView, Workspace,
|
||||
item::ItemHandle,
|
||||
searchable::{Direction, SearchEvent, SearchableItemHandle, WeakSearchableItemHandle},
|
||||
ToolbarItemEvent, ToolbarItemLocation, ToolbarItemView, Workspace,
|
||||
};
|
||||
|
||||
pub use registrar::DivRegistrar;
|
||||
|
@ -1521,7 +1521,7 @@ mod tests {
|
|||
use std::ops::Range;
|
||||
|
||||
use super::*;
|
||||
use editor::{display_map::DisplayRow, DisplayPoint, Editor, MultiBuffer, SearchSettings};
|
||||
use editor::{DisplayPoint, Editor, MultiBuffer, SearchSettings, display_map::DisplayRow};
|
||||
use gpui::{Hsla, TestAppContext, UpdateGlobal, VisualTestContext};
|
||||
use language::{Buffer, Point};
|
||||
use project::Project;
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
use gpui::{div, Action, Context, Div, Entity, InteractiveElement, Window};
|
||||
use gpui::{Action, Context, Div, Entity, InteractiveElement, Window, div};
|
||||
use workspace::Workspace;
|
||||
|
||||
use crate::BufferSearchBar;
|
||||
|
|
|
@ -1,27 +1,27 @@
|
|||
use crate::{
|
||||
buffer_search::Deploy, BufferSearchBar, FocusSearch, NextHistoryQuery, PreviousHistoryQuery,
|
||||
ReplaceAll, ReplaceNext, SearchOptions, SelectNextMatch, SelectPreviousMatch,
|
||||
ToggleCaseSensitive, ToggleIncludeIgnored, ToggleRegex, ToggleReplace, ToggleWholeWord,
|
||||
BufferSearchBar, FocusSearch, NextHistoryQuery, PreviousHistoryQuery, ReplaceAll, ReplaceNext,
|
||||
SearchOptions, SelectNextMatch, SelectPreviousMatch, ToggleCaseSensitive, ToggleIncludeIgnored,
|
||||
ToggleRegex, ToggleReplace, ToggleWholeWord, buffer_search::Deploy,
|
||||
};
|
||||
use anyhow::Context as _;
|
||||
use collections::{HashMap, HashSet};
|
||||
use editor::{
|
||||
actions::SelectAll, items::active_match_index, scroll::Autoscroll, Anchor, Editor,
|
||||
EditorElement, EditorEvent, EditorSettings, EditorStyle, MultiBuffer, MAX_TAB_TITLE_LEN,
|
||||
Anchor, Editor, EditorElement, EditorEvent, EditorSettings, EditorStyle, MAX_TAB_TITLE_LEN,
|
||||
MultiBuffer, actions::SelectAll, items::active_match_index, scroll::Autoscroll,
|
||||
};
|
||||
use futures::StreamExt;
|
||||
use gpui::{
|
||||
actions, div, Action, AnyElement, AnyView, App, Axis, Context, Entity, EntityId, EventEmitter,
|
||||
FocusHandle, Focusable, Global, Hsla, InteractiveElement, IntoElement, KeyContext,
|
||||
ParentElement, Point, Render, SharedString, Styled, Subscription, Task, TextStyle,
|
||||
UpdateGlobal, WeakEntity, Window,
|
||||
Action, AnyElement, AnyView, App, Axis, Context, Entity, EntityId, EventEmitter, FocusHandle,
|
||||
Focusable, Global, Hsla, InteractiveElement, IntoElement, KeyContext, ParentElement, Point,
|
||||
Render, SharedString, Styled, Subscription, Task, TextStyle, UpdateGlobal, WeakEntity, Window,
|
||||
actions, div,
|
||||
};
|
||||
use language::{Buffer, Language};
|
||||
use menu::Confirm;
|
||||
use project::{
|
||||
Project, ProjectPath,
|
||||
search::{SearchInputKind, SearchQuery},
|
||||
search_history::SearchHistoryCursor,
|
||||
Project, ProjectPath,
|
||||
};
|
||||
use settings::Settings;
|
||||
use std::{
|
||||
|
@ -34,15 +34,15 @@ use std::{
|
|||
};
|
||||
use theme::ThemeSettings;
|
||||
use ui::{
|
||||
h_flex, prelude::*, utils::SearchInputWidth, v_flex, Icon, IconButton, IconButtonShape,
|
||||
IconName, KeyBinding, Label, LabelCommon, LabelSize, Toggleable, Tooltip,
|
||||
Icon, IconButton, IconButtonShape, IconName, KeyBinding, Label, LabelCommon, LabelSize,
|
||||
Toggleable, Tooltip, h_flex, prelude::*, utils::SearchInputWidth, v_flex,
|
||||
};
|
||||
use util::paths::PathMatcher;
|
||||
use workspace::{
|
||||
item::{BreadcrumbText, Item, ItemEvent, ItemHandle},
|
||||
searchable::{Direction, SearchableItem, SearchableItemHandle},
|
||||
DeploySearch, ItemNavHistory, NewSearch, ToolbarItemEvent, ToolbarItemLocation,
|
||||
ToolbarItemView, Workspace, WorkspaceId,
|
||||
item::{BreadcrumbText, Item, ItemEvent, ItemHandle},
|
||||
searchable::{Direction, SearchableItem, SearchableItemHandle},
|
||||
};
|
||||
|
||||
actions!(
|
||||
|
@ -943,11 +943,7 @@ impl ProjectSearchView {
|
|||
|
||||
let editor = item.act_as::<Editor>(cx)?;
|
||||
let query = editor.query_suggestion(window, cx);
|
||||
if query.is_empty() {
|
||||
None
|
||||
} else {
|
||||
Some(query)
|
||||
}
|
||||
if query.is_empty() { None } else { Some(query) }
|
||||
});
|
||||
|
||||
let search = if let Some(existing) = existing {
|
||||
|
@ -2235,7 +2231,7 @@ pub mod tests {
|
|||
use std::{ops::Deref as _, sync::Arc};
|
||||
|
||||
use super::*;
|
||||
use editor::{display_map::DisplayRow, DisplayPoint};
|
||||
use editor::{DisplayPoint, display_map::DisplayRow};
|
||||
use gpui::{Action, TestAppContext, VisualTestContext, WindowHandle};
|
||||
use project::FakeFs;
|
||||
use serde_json::json;
|
||||
|
@ -3633,11 +3629,13 @@ pub mod tests {
|
|||
.unwrap()
|
||||
.unwrap();
|
||||
assert_eq!(cx.update(|cx| second_pane.read(cx).items_len()), 1);
|
||||
assert!(window
|
||||
.update(cx, |_, window, cx| second_pane
|
||||
.focus_handle(cx)
|
||||
.contains_focused(window, cx))
|
||||
.unwrap());
|
||||
assert!(
|
||||
window
|
||||
.update(cx, |_, window, cx| second_pane
|
||||
.focus_handle(cx)
|
||||
.contains_focused(window, cx))
|
||||
.unwrap()
|
||||
);
|
||||
let search_bar = window.build_entity(cx, |_, _| ProjectSearchBar::new());
|
||||
window
|
||||
.update(cx, {
|
||||
|
@ -3726,11 +3724,12 @@ pub mod tests {
|
|||
window
|
||||
.update(cx, |_workspace, _, cx| {
|
||||
second_pane.update(cx, |pane, _cx| {
|
||||
assert!(pane
|
||||
.active_item()
|
||||
.unwrap()
|
||||
.downcast::<ProjectSearchView>()
|
||||
.is_some());
|
||||
assert!(
|
||||
pane.active_item()
|
||||
.unwrap()
|
||||
.downcast::<ProjectSearchView>()
|
||||
.is_some()
|
||||
);
|
||||
|
||||
assert_eq!(pane.items_len(), 2);
|
||||
});
|
||||
|
|
|
@ -1,11 +1,11 @@
|
|||
use bitflags::bitflags;
|
||||
pub use buffer_search::BufferSearchBar;
|
||||
use editor::SearchSettings;
|
||||
use gpui::{actions, Action, App, FocusHandle, IntoElement};
|
||||
use gpui::{Action, App, FocusHandle, IntoElement, actions};
|
||||
use project::search::SearchQuery;
|
||||
pub use project_search::ProjectSearchView;
|
||||
use ui::{prelude::*, Tooltip};
|
||||
use ui::{ButtonStyle, IconButton, IconButtonShape};
|
||||
use ui::{Tooltip, prelude::*};
|
||||
use workspace::notifications::NotificationId;
|
||||
use workspace::{Toast, Workspace};
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
use gpui::{Action, FocusHandle, IntoElement};
|
||||
use ui::{prelude::*, Tooltip};
|
||||
use ui::{IconButton, IconButtonShape};
|
||||
use ui::{Tooltip, prelude::*};
|
||||
|
||||
pub(super) fn render_nav_button(
|
||||
icon: ui::IconName,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue