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
|
@ -5,10 +5,10 @@ mod logger;
|
|||
mod reliability;
|
||||
mod zed;
|
||||
|
||||
use anyhow::{anyhow, Context as _, Result};
|
||||
use clap::{command, Parser};
|
||||
use anyhow::{Context as _, Result, anyhow};
|
||||
use clap::{Parser, command};
|
||||
use cli::FORCE_CLI_MODE_ENV_VAR_NAME;
|
||||
use client::{parse_zed_link, Client, ProxySettings, UserStore};
|
||||
use client::{Client, ProxySettings, UserStore, parse_zed_link};
|
||||
use collab_ui::channel_view::ChannelView;
|
||||
use collections::HashMap;
|
||||
use dap::DapRegistry;
|
||||
|
@ -17,12 +17,12 @@ use editor::Editor;
|
|||
use extension::ExtensionHostProxy;
|
||||
use extension_host::ExtensionStore;
|
||||
use fs::{Fs, RealFs};
|
||||
use futures::{future, StreamExt};
|
||||
use futures::{StreamExt, future};
|
||||
use git::GitHostingProviderRegistry;
|
||||
use gpui::{App, AppContext as _, Application, AsyncApp, UpdateGlobal as _};
|
||||
|
||||
use gpui_tokio::Tokio;
|
||||
use http_client::{read_proxy_from_env, Uri};
|
||||
use http_client::{Uri, read_proxy_from_env};
|
||||
use language::LanguageRegistry;
|
||||
use prompt_store::PromptBuilder;
|
||||
use reqwest_client::ReqwestClient;
|
||||
|
@ -32,10 +32,10 @@ use logger::{init_logger, init_stdout_logger};
|
|||
use node_runtime::{NodeBinaryOptions, NodeRuntime};
|
||||
use parking_lot::Mutex;
|
||||
use project::project_settings::ProjectSettings;
|
||||
use recent_projects::{open_ssh_project, SshSettings};
|
||||
use recent_projects::{SshSettings, open_ssh_project};
|
||||
use release_channel::{AppCommitSha, AppVersion, ReleaseChannel};
|
||||
use session::{AppSession, Session};
|
||||
use settings::{watch_config_file, Settings, SettingsStore};
|
||||
use settings::{Settings, SettingsStore, watch_config_file};
|
||||
use std::{
|
||||
env,
|
||||
io::{self, IsTerminal},
|
||||
|
@ -47,15 +47,15 @@ use theme::{
|
|||
ActiveTheme, IconThemeNotFoundError, SystemAppearance, ThemeNotFoundError, ThemeRegistry,
|
||||
ThemeSettings,
|
||||
};
|
||||
use util::{maybe, ResultExt, TryFutureExt};
|
||||
use util::{ResultExt, TryFutureExt, maybe};
|
||||
use uuid::Uuid;
|
||||
use welcome::{show_welcome_view, BaseKeymap, FIRST_OPEN};
|
||||
use welcome::{BaseKeymap, FIRST_OPEN, show_welcome_view};
|
||||
use workspace::{AppState, SerializedWorkspaceLocation, WorkspaceSettings, WorkspaceStore};
|
||||
use zed::{
|
||||
app_menus, build_window_options, derive_paths_with_position, handle_cli_connection,
|
||||
handle_keymap_file_changes, handle_settings_changed, handle_settings_file_changes,
|
||||
initialize_workspace, inline_completion_registry, open_paths_with_positions, OpenListener,
|
||||
OpenRequest,
|
||||
OpenListener, OpenRequest, app_menus, build_window_options, derive_paths_with_position,
|
||||
handle_cli_connection, handle_keymap_file_changes, handle_settings_changed,
|
||||
handle_settings_file_changes, initialize_workspace, inline_completion_registry,
|
||||
open_paths_with_positions,
|
||||
};
|
||||
|
||||
#[cfg(unix)]
|
||||
|
@ -174,7 +174,7 @@ fn main() {
|
|||
|
||||
#[cfg(all(not(debug_assertions), target_os = "windows"))]
|
||||
unsafe {
|
||||
use windows::Win32::System::Console::{AttachConsole, ATTACH_PARENT_PROCESS};
|
||||
use windows::Win32::System::Console::{ATTACH_PARENT_PROCESS, AttachConsole};
|
||||
|
||||
if args.foreground {
|
||||
let _ = AttachConsole(ATTACH_PARENT_PROCESS);
|
||||
|
|
|
@ -2,19 +2,19 @@ use crate::stdout_is_a_pty;
|
|||
use anyhow::{Context as _, Result};
|
||||
use backtrace::{self, Backtrace};
|
||||
use chrono::Utc;
|
||||
use client::{telemetry, TelemetrySettings};
|
||||
use client::{TelemetrySettings, telemetry};
|
||||
use db::kvp::KEY_VALUE_STORE;
|
||||
use gpui::{App, AppContext as _, SemanticVersion};
|
||||
use http_client::{self, HttpClient, HttpClientWithUrl, HttpRequestExt, Method};
|
||||
use paths::{crashes_dir, crashes_retired_dir};
|
||||
use project::Project;
|
||||
use release_channel::{AppCommitSha, ReleaseChannel, RELEASE_CHANNEL};
|
||||
use release_channel::{AppCommitSha, RELEASE_CHANNEL, ReleaseChannel};
|
||||
use settings::Settings;
|
||||
use smol::stream::StreamExt;
|
||||
use std::{
|
||||
env,
|
||||
ffi::{c_void, OsStr},
|
||||
sync::{atomic::Ordering, Arc},
|
||||
ffi::{OsStr, c_void},
|
||||
sync::{Arc, atomic::Ordering},
|
||||
};
|
||||
use std::{io::Write, panic, sync::atomic::AtomicU32, thread};
|
||||
use telemetry_events::{LocationData, Panic, PanicRequest};
|
||||
|
@ -255,8 +255,9 @@ pub fn monitor_main_thread_hangs(
|
|||
}
|
||||
|
||||
use nix::sys::signal::{
|
||||
sigaction, SaFlags, SigAction, SigHandler, SigSet,
|
||||
SaFlags, SigAction, SigHandler, SigSet,
|
||||
Signal::{self, SIGUSR2},
|
||||
sigaction,
|
||||
};
|
||||
|
||||
use parking_lot::Mutex;
|
||||
|
@ -264,7 +265,7 @@ pub fn monitor_main_thread_hangs(
|
|||
use http_client::Method;
|
||||
use std::{
|
||||
ffi::c_int,
|
||||
sync::{mpsc, OnceLock},
|
||||
sync::{OnceLock, mpsc},
|
||||
time::Duration,
|
||||
};
|
||||
use telemetry_events::{BacktraceFrame, HangReport};
|
||||
|
|
|
@ -11,24 +11,24 @@ pub(crate) mod windows_only_instance;
|
|||
use anyhow::Context as _;
|
||||
pub use app_menus::*;
|
||||
use assets::Assets;
|
||||
use assistant2::AssistantDiffToolbar;
|
||||
use assistant_context_editor::AssistantPanelDelegate;
|
||||
use assistant2::AssistantDiffToolbar;
|
||||
use breadcrumbs::Breadcrumbs;
|
||||
use client::{zed_urls, ZED_URL_SCHEME};
|
||||
use client::{ZED_URL_SCHEME, zed_urls};
|
||||
use collections::VecDeque;
|
||||
use command_palette_hooks::CommandPaletteFilter;
|
||||
use debugger_ui::debugger_panel::DebugPanel;
|
||||
use editor::ProposedChangesEditorToolbar;
|
||||
use editor::{scroll::Autoscroll, Editor, MultiBuffer};
|
||||
use editor::{Editor, MultiBuffer, scroll::Autoscroll};
|
||||
use feature_flags::{Debugger, FeatureFlagAppExt, FeatureFlagViewExt};
|
||||
use futures::{channel::mpsc, select_biased, StreamExt};
|
||||
use futures::{StreamExt, channel::mpsc, select_biased};
|
||||
use git_ui::git_panel::GitPanel;
|
||||
use git_ui::project_diff::ProjectDiffToolbar;
|
||||
use gpui::{
|
||||
actions, point, px, Action, App, AppContext as _, AsyncApp, AsyncWindowContext, Context,
|
||||
DismissEvent, Element, Entity, Focusable, KeyBinding, MenuItem, ParentElement,
|
||||
PathPromptOptions, PromptLevel, ReadGlobal, SharedString, Styled, Task, TitlebarOptions,
|
||||
UpdateGlobal, Window, WindowKind, WindowOptions,
|
||||
Action, App, AppContext as _, AsyncApp, AsyncWindowContext, Context, DismissEvent, Element,
|
||||
Entity, Focusable, KeyBinding, MenuItem, ParentElement, PathPromptOptions, PromptLevel,
|
||||
ReadGlobal, SharedString, Styled, Task, TitlebarOptions, UpdateGlobal, Window, WindowKind,
|
||||
WindowOptions, actions, point, px,
|
||||
};
|
||||
use image_viewer::ImageInfo;
|
||||
use migrate::{MigrationBanner, MigrationEvent, MigrationNotification, MigrationType};
|
||||
|
@ -48,9 +48,9 @@ use release_channel::{AppCommitSha, ReleaseChannel};
|
|||
use rope::Rope;
|
||||
use search::project_search::ProjectSearchBar;
|
||||
use settings::{
|
||||
initial_debug_tasks_content, initial_project_settings_content, initial_tasks_content,
|
||||
update_settings_file, InvalidSettingsError, KeymapFile, KeymapFileLoadResult, Settings,
|
||||
SettingsStore, DEFAULT_KEYMAP_PATH, VIM_KEYMAP_PATH,
|
||||
DEFAULT_KEYMAP_PATH, InvalidSettingsError, KeymapFile, KeymapFileLoadResult, Settings,
|
||||
SettingsStore, VIM_KEYMAP_PATH, initial_debug_tasks_content, initial_project_settings_content,
|
||||
initial_tasks_content, update_settings_file,
|
||||
};
|
||||
use std::any::TypeId;
|
||||
use std::path::PathBuf;
|
||||
|
@ -59,19 +59,20 @@ use std::time::Duration;
|
|||
use std::{borrow::Cow, ops::Deref, path::Path, sync::Arc};
|
||||
use terminal_view::terminal_panel::{self, TerminalPanel};
|
||||
use theme::{ActiveTheme, ThemeSettings};
|
||||
use ui::{prelude::*, PopoverMenuHandle};
|
||||
use ui::{PopoverMenuHandle, prelude::*};
|
||||
use util::markdown::MarkdownString;
|
||||
use util::{asset_str, ResultExt};
|
||||
use util::{ResultExt, asset_str};
|
||||
use uuid::Uuid;
|
||||
use vim_mode_setting::VimModeSetting;
|
||||
use welcome::{BaseKeymap, MultibufferHint};
|
||||
use workspace::notifications::{dismiss_app_notification, show_app_notification, NotificationId};
|
||||
use workspace::notifications::{NotificationId, dismiss_app_notification, show_app_notification};
|
||||
use workspace::{
|
||||
AppState, NewFile, NewWindow, OpenLog, Toast, Workspace, WorkspaceSettings,
|
||||
create_and_open_local_file, notifications::simple_message_notification::MessageNotification,
|
||||
open_new, AppState, NewFile, NewWindow, OpenLog, Toast, Workspace, WorkspaceSettings,
|
||||
open_new,
|
||||
};
|
||||
use workspace::{notifications::DetachAndPromptErr, Pane};
|
||||
use workspace::{CloseIntent, RestoreBanner};
|
||||
use workspace::{Pane, notifications::DetachAndPromptErr};
|
||||
use zed_actions::{
|
||||
OpenAccountSettings, OpenBrowser, OpenServerSettings, OpenSettings, OpenZedUrl, Quit,
|
||||
};
|
||||
|
@ -1751,15 +1752,15 @@ mod tests {
|
|||
use super::*;
|
||||
use assets::Assets;
|
||||
use collections::HashSet;
|
||||
use editor::{display_map::DisplayRow, scroll::Autoscroll, DisplayPoint, Editor};
|
||||
use editor::{DisplayPoint, Editor, display_map::DisplayRow, scroll::Autoscroll};
|
||||
use gpui::{
|
||||
actions, Action, AnyWindowHandle, App, AssetSource, BorrowAppContext, SemanticVersion,
|
||||
TestAppContext, UpdateGlobal, VisualTestContext, WindowHandle,
|
||||
Action, AnyWindowHandle, App, AssetSource, BorrowAppContext, SemanticVersion,
|
||||
TestAppContext, UpdateGlobal, VisualTestContext, WindowHandle, actions,
|
||||
};
|
||||
use language::{LanguageMatcher, LanguageRegistry};
|
||||
use project::{project_settings::ProjectSettings, Project, ProjectPath, WorktreeSettings};
|
||||
use project::{Project, ProjectPath, WorktreeSettings, project_settings::ProjectSettings};
|
||||
use serde_json::json;
|
||||
use settings::{watch_config_file, SettingsStore};
|
||||
use settings::{SettingsStore, watch_config_file};
|
||||
use std::{
|
||||
path::{Path, PathBuf},
|
||||
time::Duration,
|
||||
|
@ -1767,9 +1768,10 @@ mod tests {
|
|||
use theme::{ThemeRegistry, ThemeSettings};
|
||||
use util::{path, separator};
|
||||
use workspace::{
|
||||
NewFile, OpenOptions, OpenVisible, SERIALIZATION_THROTTLE_TIME, SaveIntent, SplitDirection,
|
||||
WorkspaceHandle,
|
||||
item::{Item, ItemHandle},
|
||||
open_new, open_paths, pane, NewFile, OpenOptions, OpenVisible, SaveIntent, SplitDirection,
|
||||
WorkspaceHandle, SERIALIZATION_THROTTLE_TIME,
|
||||
open_new, open_paths, pane,
|
||||
};
|
||||
|
||||
#[gpui::test]
|
||||
|
@ -1871,11 +1873,13 @@ mod tests {
|
|||
.update(cx, |workspace, window, cx| {
|
||||
assert_eq!(workspace.worktrees(cx).count(), 2);
|
||||
assert!(workspace.left_dock().read(cx).is_open());
|
||||
assert!(workspace
|
||||
.active_pane()
|
||||
.read(cx)
|
||||
.focus_handle(cx)
|
||||
.is_focused(window));
|
||||
assert!(
|
||||
workspace
|
||||
.active_pane()
|
||||
.read(cx)
|
||||
.focus_handle(cx)
|
||||
.is_focused(window)
|
||||
);
|
||||
})
|
||||
.unwrap();
|
||||
|
||||
|
|
|
@ -3,7 +3,7 @@ use collections::HashMap;
|
|||
use copilot::{Copilot, CopilotCompletionProvider};
|
||||
use editor::{Editor, EditorMode};
|
||||
use gpui::{AnyWindowHandle, App, AppContext as _, Context, Entity, WeakEntity};
|
||||
use language::language_settings::{all_language_settings, EditPredictionProvider};
|
||||
use language::language_settings::{EditPredictionProvider, all_language_settings};
|
||||
use settings::SettingsStore;
|
||||
use std::{cell::RefCell, rc::Rc, sync::Arc};
|
||||
use supermaven::{Supermaven, SupermavenCompletionProvider};
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
use crate::handle_open_request;
|
||||
use crate::restorable_workspace_locations;
|
||||
use anyhow::{anyhow, Context as _, Result};
|
||||
use cli::{ipc, IpcHandshake};
|
||||
use cli::{ipc::IpcSender, CliRequest, CliResponse};
|
||||
use anyhow::{Context as _, Result, anyhow};
|
||||
use cli::{CliRequest, CliResponse, ipc::IpcSender};
|
||||
use cli::{IpcHandshake, ipc};
|
||||
use client::parse_zed_link;
|
||||
use collections::HashMap;
|
||||
use db::kvp::KEY_VALUE_STORE;
|
||||
|
@ -14,16 +14,16 @@ use futures::future::join_all;
|
|||
use futures::{FutureExt, SinkExt, StreamExt};
|
||||
use gpui::{App, AsyncApp, Global, WindowHandle};
|
||||
use language::Point;
|
||||
use recent_projects::{open_ssh_project, SshSettings};
|
||||
use recent_projects::{SshSettings, open_ssh_project};
|
||||
use remote::SshConnectionOptions;
|
||||
use settings::Settings;
|
||||
use std::path::{Path, PathBuf};
|
||||
use std::sync::Arc;
|
||||
use std::thread;
|
||||
use std::time::Duration;
|
||||
use util::paths::PathWithPosition;
|
||||
use util::ResultExt;
|
||||
use welcome::{show_welcome_view, FIRST_OPEN};
|
||||
use util::paths::PathWithPosition;
|
||||
use welcome::{FIRST_OPEN, show_welcome_view};
|
||||
use workspace::item::ItemHandle;
|
||||
use workspace::{AppState, OpenOptions, SerializedWorkspaceLocation, Workspace};
|
||||
|
||||
|
@ -532,8 +532,8 @@ mod tests {
|
|||
use std::sync::Arc;
|
||||
|
||||
use cli::{
|
||||
ipc::{self},
|
||||
CliResponse,
|
||||
ipc::{self},
|
||||
};
|
||||
use editor::Editor;
|
||||
use gpui::TestAppContext;
|
||||
|
|
|
@ -12,15 +12,15 @@ use gpui::{
|
|||
Action, ClickEvent, Context, Corner, ElementId, Entity, EventEmitter, FocusHandle, Focusable,
|
||||
InteractiveElement, ParentElement, Render, Styled, Subscription, WeakEntity, Window,
|
||||
};
|
||||
use search::{buffer_search, BufferSearchBar};
|
||||
use search::{BufferSearchBar, buffer_search};
|
||||
use settings::{Settings, SettingsStore};
|
||||
use ui::{
|
||||
prelude::*, ButtonStyle, ContextMenu, ContextMenuEntry, IconButton, IconButtonShape, IconName,
|
||||
IconSize, PopoverMenu, PopoverMenuHandle, Tooltip,
|
||||
ButtonStyle, ContextMenu, ContextMenuEntry, IconButton, IconButtonShape, IconName, IconSize,
|
||||
PopoverMenu, PopoverMenuHandle, Tooltip, prelude::*,
|
||||
};
|
||||
use vim_mode_setting::VimModeSetting;
|
||||
use workspace::{
|
||||
item::ItemHandle, ToolbarItemEvent, ToolbarItemLocation, ToolbarItemView, Workspace,
|
||||
ToolbarItemEvent, ToolbarItemLocation, ToolbarItemView, Workspace, item::ItemHandle,
|
||||
};
|
||||
use zed_actions::{assistant::InlineAssist, outline::ToggleOutline};
|
||||
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
use gpui::{AnyElement, Modifiers, WeakEntity};
|
||||
use markdown_preview::{
|
||||
markdown_preview_view::MarkdownPreviewView, OpenPreview, OpenPreviewToTheSide,
|
||||
OpenPreview, OpenPreviewToTheSide, markdown_preview_view::MarkdownPreviewView,
|
||||
};
|
||||
use ui::{prelude::*, text_for_keystroke, IconButtonShape, Tooltip};
|
||||
use ui::{IconButtonShape, Tooltip, prelude::*, text_for_keystroke};
|
||||
use workspace::Workspace;
|
||||
|
||||
use super::QuickActionBar;
|
||||
|
|
|
@ -1,16 +1,17 @@
|
|||
use std::time::Duration;
|
||||
|
||||
use gpui::ElementId;
|
||||
use gpui::{percentage, Animation, AnimationExt, AnyElement, Entity, Transformation};
|
||||
use gpui::{Animation, AnimationExt, AnyElement, Entity, Transformation, percentage};
|
||||
use picker::Picker;
|
||||
use repl::{
|
||||
ExecutionState, JupyterSettings, Kernel, KernelSpecification, KernelStatus, Session,
|
||||
SessionSupport,
|
||||
components::{KernelPickerDelegate, KernelSelector},
|
||||
worktree_id_for_editor, ExecutionState, JupyterSettings, Kernel, KernelSpecification,
|
||||
KernelStatus, Session, SessionSupport,
|
||||
worktree_id_for_editor,
|
||||
};
|
||||
use ui::{
|
||||
prelude::*, ButtonLike, ContextMenu, IconWithIndicator, Indicator, IntoElement, PopoverMenu,
|
||||
PopoverMenuHandle, Tooltip,
|
||||
ButtonLike, ContextMenu, IconWithIndicator, Indicator, IntoElement, PopoverMenu,
|
||||
PopoverMenuHandle, Tooltip, prelude::*,
|
||||
};
|
||||
use util::ResultExt;
|
||||
|
||||
|
|
|
@ -1,17 +1,16 @@
|
|||
use std::{sync::Arc, thread::JoinHandle};
|
||||
|
||||
use anyhow::Context;
|
||||
use cli::{ipc::IpcOneShotServer, CliRequest, CliResponse, IpcHandshake};
|
||||
use cli::{CliRequest, CliResponse, IpcHandshake, ipc::IpcOneShotServer};
|
||||
use parking_lot::Mutex;
|
||||
use release_channel::app_identifier;
|
||||
use util::ResultExt;
|
||||
use windows::{
|
||||
core::HSTRING,
|
||||
Win32::{
|
||||
Foundation::{CloseHandle, GetLastError, ERROR_ALREADY_EXISTS, GENERIC_WRITE, HANDLE},
|
||||
Foundation::{CloseHandle, ERROR_ALREADY_EXISTS, GENERIC_WRITE, GetLastError, HANDLE},
|
||||
Storage::FileSystem::{
|
||||
CreateFileW, ReadFile, WriteFile, FILE_FLAGS_AND_ATTRIBUTES, FILE_SHARE_MODE,
|
||||
OPEN_EXISTING, PIPE_ACCESS_INBOUND,
|
||||
CreateFileW, FILE_FLAGS_AND_ATTRIBUTES, FILE_SHARE_MODE, OPEN_EXISTING,
|
||||
PIPE_ACCESS_INBOUND, ReadFile, WriteFile,
|
||||
},
|
||||
System::{
|
||||
Pipes::{
|
||||
|
@ -21,6 +20,7 @@ use windows::{
|
|||
Threading::CreateMutexW,
|
||||
},
|
||||
},
|
||||
core::HSTRING,
|
||||
};
|
||||
|
||||
use crate::{Args, OpenListener};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue