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:
Piotr Osiewicz 2025-03-31 20:55:27 +02:00 committed by GitHub
parent d50905e000
commit dc64ec9cc8
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
802 changed files with 3775 additions and 3662 deletions

View file

@ -1,9 +1,9 @@
use editor::{
display_map::ToDisplayPoint, movement, scroll::Autoscroll, Anchor, Bias, Direction, Editor,
Anchor, Bias, Direction, Editor, display_map::ToDisplayPoint, movement, scroll::Autoscroll,
};
use gpui::{actions, Context, Window};
use gpui::{Context, Window, actions};
use crate::{state::Mode, Vim};
use crate::{Vim, state::Mode};
actions!(vim, [ChangeListOlder, ChangeListNewer]);

View file

@ -1,13 +1,13 @@
use anyhow::{anyhow, Result};
use anyhow::{Result, anyhow};
use collections::HashMap;
use command_palette_hooks::CommandInterceptResult;
use editor::{
Bias, Editor, ToPoint,
actions::{SortLinesCaseInsensitive, SortLinesCaseSensitive},
display_map::ToDisplayPoint,
scroll::Autoscroll,
Bias, Editor, ToPoint,
};
use gpui::{actions, impl_internal_actions, Action, App, AppContext as _, Context, Global, Window};
use gpui::{Action, App, AppContext as _, Context, Global, Window, actions, impl_internal_actions};
use itertools::Itertools;
use language::Point;
use multi_buffer::MultiBufferRow;
@ -27,19 +27,19 @@ use std::{
use task::{HideStrategy, RevealStrategy, SpawnInTerminal, TaskId};
use ui::ActiveTheme;
use util::ResultExt;
use workspace::{notifications::NotifyResultExt, SaveIntent};
use workspace::{SaveIntent, notifications::NotifyResultExt};
use zed_actions::RevealTarget;
use crate::{
ToggleMarksView, ToggleRegistersView, Vim,
motion::{EndOfDocument, Motion, MotionKind, StartOfDocument},
normal::{
search::{FindCommand, ReplaceCommand, Replacement},
JoinLines,
search::{FindCommand, ReplaceCommand, Replacement},
},
object::Object,
state::{Mark, Mode},
visual::VisualDeleteLine,
ToggleMarksView, ToggleRegistersView, Vim,
};
#[derive(Clone, Debug, PartialEq)]

View file

@ -2,13 +2,13 @@ use std::sync::Arc;
use collections::HashMap;
use editor::Editor;
use gpui::{impl_actions, App, Context, Keystroke, KeystrokeEvent, Window};
use gpui::{App, Context, Keystroke, KeystrokeEvent, Window, impl_actions};
use schemars::JsonSchema;
use serde::Deserialize;
use settings::Settings;
use std::sync::LazyLock;
use crate::{state::Operator, Vim, VimSettings};
use crate::{Vim, VimSettings, state::Operator};
mod default;
@ -229,9 +229,9 @@ mod test {
use settings::SettingsStore;
use crate::{
VimSettings,
state::Mode,
test::{NeovimBackedTestContext, VimTestContext},
VimSettings,
};
#[gpui::test]

View file

@ -1,10 +1,10 @@
use editor::{movement, scroll::Autoscroll, DisplayPoint, Editor};
use gpui::{actions, Action};
use editor::{DisplayPoint, Editor, movement, scroll::Autoscroll};
use gpui::{Action, actions};
use gpui::{Context, Window};
use language::{CharClassifier, CharKind};
use crate::motion::MotionKind;
use crate::{motion::Motion, state::Mode, Vim};
use crate::{Vim, motion::Motion, state::Mode};
actions!(vim, [HelixNormalAfter, HelixDelete]);

View file

@ -1,6 +1,6 @@
use crate::{motion::Motion, object::Object, state::Mode, Vim};
use crate::{Vim, motion::Motion, object::Object, state::Mode};
use collections::HashMap;
use editor::{display_map::ToDisplayPoint, Bias, Editor};
use editor::{Bias, Editor, display_map::ToDisplayPoint};
use gpui::actions;
use gpui::{Context, Window};
use language::SelectionGoal;

View file

@ -1,6 +1,6 @@
use crate::{state::Mode, Vim};
use editor::{scroll::Autoscroll, Bias, Editor};
use gpui::{actions, Action, Context, Window};
use crate::{Vim, state::Mode};
use editor::{Bias, Editor, scroll::Autoscroll};
use gpui::{Action, Context, Window, actions};
use language::SelectionGoal;
actions!(vim, [NormalBefore, TemporaryNormal]);

View file

@ -1,6 +1,6 @@
use gpui::{div, Context, Element, Entity, Render, Subscription, WeakEntity, Window};
use gpui::{Context, Element, Entity, Render, Subscription, WeakEntity, Window, div};
use ui::text_for_keystrokes;
use workspace::{item::ItemHandle, ui::prelude::*, StatusItemView};
use workspace::{StatusItemView, item::ItemHandle, ui::prelude::*};
use crate::{Vim, VimEvent, VimGlobals};

View file

@ -1,12 +1,12 @@
use editor::{
Anchor, Bias, DisplayPoint, Editor, RowExt, ToOffset, ToPoint,
display_map::{DisplayRow, DisplaySnapshot, FoldPoint, ToDisplayPoint},
movement::{
self, find_boundary, find_preceding_boundary_display_point, FindRange, TextLayoutDetails,
self, FindRange, TextLayoutDetails, find_boundary, find_preceding_boundary_display_point,
},
scroll::Autoscroll,
Anchor, Bias, DisplayPoint, Editor, RowExt, ToOffset, ToPoint,
};
use gpui::{action_with_deprecated_aliases, actions, impl_actions, px, Context, Window};
use gpui::{Context, Window, action_with_deprecated_aliases, actions, impl_actions, px};
use language::{CharKind, Point, Selection, SelectionGoal};
use multi_buffer::MultiBufferRow;
use schemars::JsonSchema;
@ -15,10 +15,10 @@ use std::ops::Range;
use workspace::searchable::Direction;
use crate::{
Vim,
normal::mark,
state::{Mode, Operator},
surrounds::SurroundsType,
Vim,
};
#[derive(Clone, Copy, Debug, PartialEq, Eq)]

View file

@ -15,21 +15,21 @@ use std::collections::HashMap;
use std::sync::Arc;
use crate::{
Vim,
indent::IndentDirection,
motion::{self, first_non_whitespace, next_line_end, right, Motion},
motion::{self, Motion, first_non_whitespace, next_line_end, right},
object::Object,
state::{Mark, Mode, Operator},
surrounds::SurroundsType,
Vim,
};
use case::CaseTarget;
use collections::BTreeSet;
use editor::scroll::Autoscroll;
use editor::Anchor;
use editor::Bias;
use editor::Editor;
use editor::scroll::Autoscroll;
use editor::{display_map::ToDisplayPoint, movement};
use gpui::{actions, Context, Window};
use gpui::{Context, Window, actions};
use language::{Point, SelectionGoal, ToPoint};
use log::error;
use multi_buffer::MultiBufferRow;
@ -630,10 +630,9 @@ mod test {
use settings::SettingsStore;
use crate::{
motion,
VimSettings, motion,
state::Mode::{self},
test::{NeovimBackedTestContext, VimTestContext},
VimSettings,
};
#[gpui::test]

View file

@ -5,11 +5,11 @@ use language::{Bias, Point, SelectionGoal};
use multi_buffer::MultiBufferRow;
use crate::{
Vim,
motion::Motion,
normal::{ChangeCase, ConvertToLowerCase, ConvertToUpperCase},
object::Object,
state::Mode,
Vim,
};
pub enum CaseTarget {

View file

@ -1,14 +1,14 @@
use crate::{
Vim,
motion::{self, Motion, MotionKind},
object::Object,
state::Mode,
Vim,
};
use editor::{
Bias, DisplayPoint,
display_map::{DisplaySnapshot, ToDisplayPoint},
movement::TextLayoutDetails,
scroll::Autoscroll,
Bias, DisplayPoint,
};
use gpui::{Context, Window};
use language::Selection;

View file

@ -1,13 +1,13 @@
use crate::{
Vim,
motion::{Motion, MotionKind},
object::Object,
Vim,
};
use collections::{HashMap, HashSet};
use editor::{
Bias, DisplayPoint,
display_map::{DisplaySnapshot, ToDisplayPoint},
scroll::Autoscroll,
Bias, DisplayPoint,
};
use gpui::{Context, Window};
use language::{Point, Selection};

View file

@ -1,11 +1,11 @@
use editor::{scroll::Autoscroll, Editor, MultiBufferSnapshot, ToOffset, ToPoint};
use gpui::{impl_actions, Context, Window};
use editor::{Editor, MultiBufferSnapshot, ToOffset, ToPoint, scroll::Autoscroll};
use gpui::{Context, Window, impl_actions};
use language::{Bias, Point};
use schemars::JsonSchema;
use serde::Deserialize;
use std::ops::Range;
use crate::{state::Mode, Vim};
use crate::{Vim, state::Mode};
const BOOLEAN_PAIRS: &[(&str, &str)] = &[("true", "false"), ("yes", "no"), ("on", "off")];

View file

@ -1,10 +1,10 @@
use std::{ops::Range, path::Path, sync::Arc};
use editor::{
Anchor, Bias, DisplayPoint, Editor, MultiBuffer,
display_map::{DisplaySnapshot, ToDisplayPoint},
movement,
scroll::Autoscroll,
Anchor, Bias, DisplayPoint, Editor, MultiBuffer,
};
use gpui::{Context, Entity, EntityId, UpdateGlobal, Window};
use language::SelectionGoal;
@ -13,9 +13,9 @@ use ui::App;
use workspace::OpenOptions;
use crate::{
Vim,
motion::{self, Motion},
state::{Mark, Mode, VimGlobals},
Vim,
};
impl Vim {

View file

@ -1,15 +1,15 @@
use editor::{display_map::ToDisplayPoint, movement, scroll::Autoscroll, DisplayPoint, RowExt};
use gpui::{impl_actions, Context, Window};
use editor::{DisplayPoint, RowExt, display_map::ToDisplayPoint, movement, scroll::Autoscroll};
use gpui::{Context, Window, impl_actions};
use language::{Bias, SelectionGoal};
use schemars::JsonSchema;
use serde::Deserialize;
use std::cmp;
use crate::{
Vim,
motion::{Motion, MotionKind},
object::Object,
state::{Mode, Register},
Vim,
};
#[derive(Clone, Deserialize, JsonSchema, PartialEq)]
@ -283,15 +283,15 @@ impl Vim {
#[cfg(test)]
mod test {
use crate::{
UseSystemClipboard, VimSettings,
state::{Mode, Register},
test::{NeovimBackedTestContext, VimTestContext},
UseSystemClipboard, VimSettings,
};
use gpui::ClipboardItem;
use indoc::indoc;
use language::{
language_settings::{AllLanguageSettings, LanguageSettingsContent},
LanguageName,
language_settings::{AllLanguageSettings, LanguageSettingsContent},
};
use settings::SettingsStore;

View file

@ -1,14 +1,14 @@
use std::{cell::RefCell, rc::Rc};
use crate::{
Vim,
insert::NormalBefore,
motion::Motion,
normal::InsertBefore,
state::{Mode, Operator, RecordedSelection, ReplayableAction, VimGlobals},
Vim,
};
use editor::Editor;
use gpui::{actions, Action, App, Context, Window};
use gpui::{Action, App, Context, Window, actions};
use workspace::Workspace;
actions!(vim, [Repeat, EndRepeat, ToggleRecord, ReplayLastRecording]);

View file

@ -1,10 +1,10 @@
use crate::Vim;
use editor::{
DisplayPoint, Editor, EditorSettings,
display_map::{DisplayRow, ToDisplayPoint},
scroll::ScrollAmount,
DisplayPoint, Editor, EditorSettings,
};
use gpui::{actions, Context, Window};
use gpui::{Context, Window, actions};
use language::Bias;
use settings::Settings;
@ -163,7 +163,7 @@ mod test {
test::{NeovimBackedTestContext, VimTestContext},
};
use editor::{EditorSettings, ScrollBeyondLastLine};
use gpui::{point, px, size, AppContext as _};
use gpui::{AppContext as _, point, px, size};
use indoc::indoc;
use language::Point;
use settings::SettingsStore;

View file

@ -1,18 +1,18 @@
use editor::Editor;
use gpui::{actions, impl_actions, impl_internal_actions, Context, Window};
use gpui::{Context, Window, actions, impl_actions, impl_internal_actions};
use language::Point;
use schemars::JsonSchema;
use search::{buffer_search, BufferSearchBar, SearchOptions};
use search::{BufferSearchBar, SearchOptions, buffer_search};
use serde_derive::Deserialize;
use std::{iter::Peekable, str::Chars, time::Duration};
use util::serde::default_true;
use workspace::{notifications::NotifyResultExt, searchable::Direction};
use crate::{
Vim,
command::CommandRange,
motion::Motion,
state::{Mode, SearchState},
Vim,
};
#[derive(Clone, Debug, Deserialize, JsonSchema, PartialEq)]
@ -590,7 +590,7 @@ mod test {
test::{NeovimBackedTestContext, VimTestContext},
};
use editor::EditorSettings;
use editor::{display_map::DisplayRow, DisplayPoint};
use editor::{DisplayPoint, display_map::DisplayRow};
use indoc::indoc;
use search::BufferSearchBar;

View file

@ -1,10 +1,10 @@
use editor::{movement, Editor};
use gpui::{actions, Context, Window};
use editor::{Editor, movement};
use gpui::{Context, Window, actions};
use language::Point;
use crate::{
motion::{Motion, MotionKind},
Mode, Vim,
motion::{Motion, MotionKind},
};
actions!(vim, [Substitute, SubstituteLine]);

View file

@ -1,6 +1,6 @@
use crate::{motion::Motion, object::Object, Vim};
use crate::{Vim, motion::Motion, object::Object};
use collections::HashMap;
use editor::{display_map::ToDisplayPoint, Bias};
use editor::{Bias, display_map::ToDisplayPoint};
use gpui::{Context, Window};
use language::SelectionGoal;

View file

@ -1,10 +1,10 @@
use std::{ops::Range, time::Duration};
use crate::{
Vim, VimSettings,
motion::{Motion, MotionKind},
object::Object,
state::{Mode, Register},
Vim, VimSettings,
};
use collections::HashMap;
use editor::{ClipboardSelection, Editor};

View file

@ -1,16 +1,16 @@
use std::ops::Range;
use crate::{
Vim,
motion::right,
state::{Mode, Operator},
Vim,
};
use editor::{
Bias, DisplayPoint, Editor, ToOffset,
display_map::{DisplaySnapshot, ToDisplayPoint},
movement::{self, FindRange},
Bias, DisplayPoint, Editor, ToOffset,
};
use gpui::{actions, impl_actions, Window};
use gpui::{Window, actions, impl_actions};
use itertools::Itertools;
use language::{BufferSnapshot, CharKind, Point, Selection, TextObject, TreeSitterOptions};
use multi_buffer::MultiBufferRow;

View file

@ -1,14 +1,14 @@
use crate::{
Vim,
motion::{self, Motion},
object::Object,
state::Mode,
Vim,
};
use editor::{
display_map::ToDisplayPoint, scroll::Autoscroll, Anchor, Bias, Editor, EditorSnapshot,
ToOffset, ToPoint,
Anchor, Bias, Editor, EditorSnapshot, ToOffset, ToPoint, display_map::ToDisplayPoint,
scroll::Autoscroll,
};
use gpui::{actions, Context, Window};
use gpui::{Context, Window, actions};
use language::{Point, SelectionGoal};
use std::ops::Range;
use std::sync::Arc;

View file

@ -1,7 +1,7 @@
use crate::{motion::Motion, object::Object, state::Mode, Vim};
use crate::{Vim, motion::Motion, object::Object, state::Mode};
use collections::HashMap;
use editor::{display_map::ToDisplayPoint, scroll::Autoscroll, Bias, Editor, RewrapOptions};
use gpui::{actions, Context, Window};
use editor::{Bias, Editor, RewrapOptions, display_map::ToDisplayPoint, scroll::Autoscroll};
use gpui::{Context, Window, actions};
use language::SelectionGoal;
actions!(vim, [Rewrap]);

View file

@ -2,8 +2,8 @@ use crate::command::command_interceptor;
use crate::motion::MotionKind;
use crate::normal::repeat::Replayer;
use crate::surrounds::SurroundsType;
use crate::{motion::Motion, object::Object};
use crate::{ToggleMarksView, ToggleRegistersView, UseSystemClipboard, Vim, VimAddon, VimSettings};
use crate::{motion::Motion, object::Object};
use anyhow::Result;
use collections::HashMap;
use command_palette_hooks::{CommandPaletteFilter, CommandPaletteInterceptor};
@ -28,8 +28,8 @@ use std::{fmt::Display, ops::Range, sync::Arc};
use text::{Bias, ToPoint};
use theme::ThemeSettings;
use ui::{
h_flex, rems, ActiveTheme, Context, Div, FluentBuilder, KeyBinding, ParentElement,
SharedString, Styled, StyledTypography, Window,
ActiveTheme, Context, Div, FluentBuilder, KeyBinding, ParentElement, SharedString, Styled,
StyledTypography, Window, h_flex, rems,
};
use util::ResultExt;
use workspace::searchable::Direction;

View file

@ -1,10 +1,10 @@
use crate::{
Vim,
motion::{self, Motion},
object::Object,
state::Mode,
Vim,
};
use editor::{movement, scroll::Autoscroll, Bias};
use editor::{Bias, movement, scroll::Autoscroll};
use gpui::{Context, Window};
use language::BracketPair;
@ -544,7 +544,7 @@ mod test {
use gpui::KeyBinding;
use indoc::indoc;
use crate::{state::Mode, test::VimTestContext, PushAddSurrounds};
use crate::{PushAddSurrounds, state::Mode, test::VimTestContext};
#[gpui::test]
async fn test_add_surrounds(cx: &mut gpui::TestAppContext) {

View file

@ -7,8 +7,8 @@ use std::time::Duration;
use collections::HashMap;
use command_palette::CommandPalette;
use editor::{
actions::DeleteLine, display_map::DisplayRow, test::editor_test_context::EditorTestContext,
DisplayPoint, Editor, EditorMode, MultiBuffer,
DisplayPoint, Editor, EditorMode, MultiBuffer, actions::DeleteLine, display_map::DisplayRow,
test::editor_test_context::EditorTestContext,
};
use futures::StreamExt;
use gpui::{KeyBinding, Modifiers, MouseButton, TestAppContext};
@ -21,7 +21,7 @@ use indoc::indoc;
use search::BufferSearchBar;
use workspace::WorkspaceSettings;
use crate::{insert::NormalBefore, motion, state::Mode, PushSneak, PushSneakBackward};
use crate::{PushSneak, PushSneakBackward, insert::NormalBefore, motion, state::Mode};
#[gpui::test]
async fn test_initially_disabled(cx: &mut gpui::TestAppContext) {
@ -228,7 +228,9 @@ async fn test_escape_command_palette(cx: &mut gpui::TestAppContext) {
cx.set_state("aˇbc\n", Mode::Normal);
cx.simulate_keystrokes("i cmd-shift-p");
assert!(cx.workspace(|workspace, _, cx| workspace.active_modal::<CommandPalette>(cx).is_some()));
assert!(
cx.workspace(|workspace, _, cx| workspace.active_modal::<CommandPalette>(cx).is_some())
);
cx.simulate_keystrokes("escape");
cx.run_until_parked();
assert!(

View file

@ -1,4 +1,4 @@
use gpui::{px, size, AppContext as _, UpdateGlobal};
use gpui::{AppContext as _, UpdateGlobal, px, size};
use indoc::indoc;
use settings::SettingsStore;
use std::{
@ -9,7 +9,7 @@ use std::{
use language::language_settings::{AllLanguageSettings, SoftWrap};
use util::test::marked_text_offsets;
use super::{neovim_connection::NeovimConnection, VimTestContext};
use super::{VimTestContext, neovim_connection::NeovimConnection};
use crate::state::{Mode, VimGlobals};
pub struct NeovimBackedTestContext {

View file

@ -17,7 +17,7 @@ use language::Point;
#[cfg(feature = "neovim")]
use nvim_rs::{
create::tokio::new_child_cmd, error::LoopError, Handler, Neovim, UiAttachOptions, Value,
Handler, Neovim, UiAttachOptions, Value, create::tokio::new_child_cmd, error::LoopError,
};
#[cfg(feature = "neovim")]
use parking_lot::ReentrantMutex;

View file

@ -2,7 +2,7 @@ use std::ops::{Deref, DerefMut};
use editor::test::editor_lsp_test_context::EditorLspTestContext;
use gpui::{Context, Entity, SemanticVersion, UpdateGlobal};
use search::{project_search::ProjectSearchBar, BufferSearchBar};
use search::{BufferSearchBar, project_search::ProjectSearchBar};
use crate::{state::Operator, *};

View file

@ -22,12 +22,12 @@ mod visual;
use anyhow::Result;
use collections::HashMap;
use editor::{
movement::{self, FindRange},
Anchor, Bias, Editor, EditorEvent, EditorMode, EditorSettings, ToPoint,
movement::{self, FindRange},
};
use gpui::{
actions, impl_actions, Action, App, AppContext, Axis, Context, Entity, EventEmitter,
KeyContext, KeystrokeEvent, Render, Subscription, Task, WeakEntity, Window,
Action, App, AppContext, Axis, Context, Entity, EventEmitter, KeyContext, KeystrokeEvent,
Render, Subscription, Task, WeakEntity, Window, actions, impl_actions,
};
use insert::{NormalBefore, TemporaryNormal};
use language::{CharKind, CursorShape, Point, Selection, SelectionGoal, TransactionId};
@ -38,12 +38,12 @@ use object::Object;
use schemars::JsonSchema;
use serde::Deserialize;
use serde_derive::Serialize;
use settings::{update_settings_file, Settings, SettingsSources, SettingsStore};
use settings::{Settings, SettingsSources, SettingsStore, update_settings_file};
use state::{Mode, Operator, RecordedSelection, SearchState, VimGlobals};
use std::{mem, ops::Range, sync::Arc};
use surrounds::SurroundsType;
use theme::ThemeSettings;
use ui::{px, IntoElement, SharedString};
use ui::{IntoElement, SharedString, px};
use vim_mode_setting::VimModeSetting;
use workspace::{self, Pane, Workspace};

View file

@ -2,12 +2,12 @@ use std::sync::Arc;
use collections::HashMap;
use editor::{
Bias, DisplayPoint, Editor, ToOffset,
display_map::{DisplaySnapshot, ToDisplayPoint},
movement,
scroll::Autoscroll,
Bias, DisplayPoint, Editor, ToOffset,
};
use gpui::{actions, Context, Window};
use gpui::{Context, Window, actions};
use language::{Point, Selection, SelectionGoal};
use multi_buffer::MultiBufferRow;
use search::BufferSearchBar;
@ -15,10 +15,10 @@ use util::ResultExt;
use workspace::searchable::Direction;
use crate::{
motion::{first_non_whitespace, next_line_end, start_of_line, Motion, MotionKind},
Vim,
motion::{Motion, MotionKind, first_non_whitespace, next_line_end, start_of_line},
object::Object,
state::{Mark, Mode, Operator},
Vim,
};
actions!(