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
|
@ -7,7 +7,7 @@ use picker::{Picker, PickerDelegate};
|
|||
use std::cell::LazyCell;
|
||||
use std::sync::Arc;
|
||||
use sysinfo::System;
|
||||
use ui::{prelude::*, Context, Tooltip};
|
||||
use ui::{Context, Tooltip, prelude::*};
|
||||
use ui::{ListItem, ListItemSpacing};
|
||||
use util::debug_panic;
|
||||
use workspace::ModalView;
|
||||
|
|
|
@ -1,20 +1,20 @@
|
|||
use crate::session::DebugSession;
|
||||
use anyhow::{anyhow, Result};
|
||||
use anyhow::{Result, anyhow};
|
||||
use collections::HashMap;
|
||||
use command_palette_hooks::CommandPaletteFilter;
|
||||
use dap::{
|
||||
client::SessionId, debugger_settings::DebuggerSettings, ContinuedEvent, LoadedSourceEvent,
|
||||
ModuleEvent, OutputEvent, StoppedEvent, ThreadEvent,
|
||||
ContinuedEvent, LoadedSourceEvent, ModuleEvent, OutputEvent, StoppedEvent, ThreadEvent,
|
||||
client::SessionId, debugger_settings::DebuggerSettings,
|
||||
};
|
||||
use futures::{channel::mpsc, SinkExt as _};
|
||||
use futures::{SinkExt as _, channel::mpsc};
|
||||
use gpui::{
|
||||
actions, Action, App, AsyncWindowContext, Context, Entity, EventEmitter, FocusHandle,
|
||||
Focusable, Subscription, Task, WeakEntity,
|
||||
Action, App, AsyncWindowContext, Context, Entity, EventEmitter, FocusHandle, Focusable,
|
||||
Subscription, Task, WeakEntity, actions,
|
||||
};
|
||||
use project::{
|
||||
Project,
|
||||
debugger::dap_store::{self, DapStore},
|
||||
terminals::TerminalKind,
|
||||
Project,
|
||||
};
|
||||
use rpc::proto::{self};
|
||||
use settings::Settings;
|
||||
|
@ -24,9 +24,10 @@ use terminal_view::terminal_panel::TerminalPanel;
|
|||
use ui::prelude::*;
|
||||
use util::ResultExt;
|
||||
use workspace::{
|
||||
ClearAllBreakpoints, Continue, Disconnect, Pane, Pause, Restart, StepBack, StepInto, StepOut,
|
||||
StepOver, Stop, ToggleIgnoreBreakpoints, Workspace,
|
||||
dock::{DockPosition, Panel, PanelEvent},
|
||||
pane, ClearAllBreakpoints, Continue, Disconnect, Pane, Pause, Restart, StepBack, StepInto,
|
||||
StepOut, StepOver, Stop, ToggleIgnoreBreakpoints, Workspace,
|
||||
pane,
|
||||
};
|
||||
|
||||
pub enum DebugPanelEvent {
|
||||
|
|
|
@ -8,22 +8,22 @@ use std::time::Duration;
|
|||
use dap::client::SessionId;
|
||||
use failed::FailedState;
|
||||
use gpui::{
|
||||
percentage, Animation, AnimationExt, AnyElement, App, Entity, EventEmitter, FocusHandle,
|
||||
Focusable, Subscription, Task, Transformation, WeakEntity,
|
||||
Animation, AnimationExt, AnyElement, App, Entity, EventEmitter, FocusHandle, Focusable,
|
||||
Subscription, Task, Transformation, WeakEntity, percentage,
|
||||
};
|
||||
use inert::{InertEvent, InertState};
|
||||
use project::Project;
|
||||
use project::debugger::{dap_store::DapStore, session::Session};
|
||||
use project::worktree_store::WorktreeStore;
|
||||
use project::Project;
|
||||
use rpc::proto::{self, PeerId};
|
||||
use running::RunningState;
|
||||
use starting::{StartingEvent, StartingState};
|
||||
use task::DebugTaskDefinition;
|
||||
use ui::{prelude::*, Indicator};
|
||||
use ui::{Indicator, prelude::*};
|
||||
use util::ResultExt;
|
||||
use workspace::{
|
||||
item::{self, Item},
|
||||
FollowableItem, ViewId, Workspace,
|
||||
item::{self, Item},
|
||||
};
|
||||
|
||||
use crate::debugger_panel::DebugPanel;
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
use gpui::{FocusHandle, Focusable};
|
||||
use ui::{
|
||||
h_flex, Color, Context, IntoElement, Label, LabelCommon, ParentElement, Render, Styled, Window,
|
||||
Color, Context, IntoElement, Label, LabelCommon, ParentElement, Render, Styled, Window, h_flex,
|
||||
};
|
||||
|
||||
pub(crate) struct FailedState {
|
||||
|
|
|
@ -7,10 +7,10 @@ use settings::Settings as _;
|
|||
use task::{DebugTaskDefinition, LaunchConfig, TCPHost};
|
||||
use theme::ThemeSettings;
|
||||
use ui::{
|
||||
div, h_flex, relative, v_flex, ActiveTheme as _, ButtonCommon, ButtonLike, Clickable, Context,
|
||||
ContextMenu, Disableable, DropdownMenu, FluentBuilder, Icon, IconName, IconSize,
|
||||
InteractiveElement, IntoElement, Label, LabelCommon, LabelSize, ParentElement, PopoverMenu,
|
||||
PopoverMenuHandle, Render, SharedString, SplitButton, Styled, Window,
|
||||
ActiveTheme as _, ButtonCommon, ButtonLike, Clickable, Context, ContextMenu, Disableable,
|
||||
DropdownMenu, FluentBuilder, Icon, IconName, IconSize, InteractiveElement, IntoElement, Label,
|
||||
LabelCommon, LabelSize, ParentElement, PopoverMenu, PopoverMenuHandle, Render, SharedString,
|
||||
SplitButton, Styled, Window, div, h_flex, relative, v_flex,
|
||||
};
|
||||
use workspace::Workspace;
|
||||
|
||||
|
|
|
@ -6,7 +6,7 @@ pub mod variable_list;
|
|||
|
||||
use super::{DebugPanelItemEvent, ThreadItem};
|
||||
use console::Console;
|
||||
use dap::{client::SessionId, debugger_settings::DebuggerSettings, Capabilities, Thread};
|
||||
use dap::{Capabilities, Thread, client::SessionId, debugger_settings::DebuggerSettings};
|
||||
use gpui::{AppContext, Entity, EventEmitter, FocusHandle, Focusable, Subscription, WeakEntity};
|
||||
use loaded_source_list::LoadedSourceList;
|
||||
use module_list::ModuleList;
|
||||
|
@ -15,10 +15,10 @@ use rpc::proto::ViewId;
|
|||
use settings::Settings;
|
||||
use stack_frame_list::StackFrameList;
|
||||
use ui::{
|
||||
div, h_flex, v_flex, ActiveTheme, AnyElement, App, Button, ButtonCommon, Clickable, Context,
|
||||
ContextMenu, Disableable, Divider, DropdownMenu, FluentBuilder, IconButton, IconName, IconSize,
|
||||
Indicator, InteractiveElement, IntoElement, Label, ParentElement, Render, SharedString,
|
||||
StatefulInteractiveElement, Styled, Tooltip, Window,
|
||||
ActiveTheme, AnyElement, App, Button, ButtonCommon, Clickable, Context, ContextMenu,
|
||||
Disableable, Divider, DropdownMenu, FluentBuilder, IconButton, IconName, IconSize, Indicator,
|
||||
InteractiveElement, IntoElement, Label, ParentElement, Render, SharedString,
|
||||
StatefulInteractiveElement, Styled, Tooltip, Window, div, h_flex, v_flex,
|
||||
};
|
||||
use util::ResultExt;
|
||||
use variable_list::VariableList;
|
||||
|
|
|
@ -11,8 +11,8 @@ use gpui::{Context, Entity, Render, Subscription, Task, TextStyle, WeakEntity};
|
|||
use language::{Buffer, CodeLabel};
|
||||
use menu::Confirm;
|
||||
use project::{
|
||||
debugger::session::{CompletionsQuery, OutputToken, Session},
|
||||
Completion,
|
||||
debugger::session::{CompletionsQuery, OutputToken, Session},
|
||||
};
|
||||
use settings::Settings;
|
||||
use std::{cell::RefCell, rc::Rc, usize};
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
use gpui::{list, AnyElement, Empty, Entity, FocusHandle, Focusable, ListState, Subscription};
|
||||
use gpui::{AnyElement, Empty, Entity, FocusHandle, Focusable, ListState, Subscription, list};
|
||||
use project::debugger::session::{Session, SessionEvent};
|
||||
use ui::prelude::*;
|
||||
use util::maybe;
|
||||
|
|
|
@ -1,10 +1,10 @@
|
|||
use anyhow::anyhow;
|
||||
use gpui::{
|
||||
list, AnyElement, Empty, Entity, FocusHandle, Focusable, ListState, Subscription, WeakEntity,
|
||||
AnyElement, Empty, Entity, FocusHandle, Focusable, ListState, Subscription, WeakEntity, list,
|
||||
};
|
||||
use project::{
|
||||
debugger::session::{Session, SessionEvent},
|
||||
ProjectItem as _, ProjectPath,
|
||||
debugger::session::{Session, SessionEvent},
|
||||
};
|
||||
use std::{path::Path, sync::Arc};
|
||||
use ui::prelude::*;
|
||||
|
|
|
@ -1,17 +1,17 @@
|
|||
use std::path::Path;
|
||||
use std::sync::Arc;
|
||||
|
||||
use anyhow::{anyhow, Result};
|
||||
use anyhow::{Result, anyhow};
|
||||
use dap::StackFrameId;
|
||||
use gpui::{
|
||||
list, AnyElement, Entity, EventEmitter, FocusHandle, Focusable, ListState, Subscription, Task,
|
||||
WeakEntity,
|
||||
AnyElement, Entity, EventEmitter, FocusHandle, Focusable, ListState, Subscription, Task,
|
||||
WeakEntity, list,
|
||||
};
|
||||
|
||||
use language::PointUtf16;
|
||||
use project::debugger::session::{Session, SessionEvent, StackFrame};
|
||||
use project::{ProjectItem, ProjectPath};
|
||||
use ui::{prelude::*, Tooltip};
|
||||
use ui::{Tooltip, prelude::*};
|
||||
use util::ResultExt;
|
||||
use workspace::Workspace;
|
||||
|
||||
|
|
|
@ -2,14 +2,14 @@ use super::stack_frame_list::{StackFrameList, StackFrameListEvent};
|
|||
use dap::{ScopePresentationHint, StackFrameId, VariablePresentationHintKind, VariableReference};
|
||||
use editor::Editor;
|
||||
use gpui::{
|
||||
actions, anchored, deferred, uniform_list, AnyElement, ClickEvent, ClipboardItem, Context,
|
||||
DismissEvent, Entity, FocusHandle, Focusable, Hsla, MouseButton, MouseDownEvent, Point,
|
||||
Stateful, Subscription, TextStyleRefinement, UniformListScrollHandle,
|
||||
AnyElement, ClickEvent, ClipboardItem, Context, DismissEvent, Entity, FocusHandle, Focusable,
|
||||
Hsla, MouseButton, MouseDownEvent, Point, Stateful, Subscription, TextStyleRefinement,
|
||||
UniformListScrollHandle, actions, anchored, deferred, uniform_list,
|
||||
};
|
||||
use menu::{SelectFirst, SelectLast, SelectNext, SelectPrevious};
|
||||
use project::debugger::session::{Session, SessionEvent};
|
||||
use std::{collections::HashMap, ops::Range, sync::Arc};
|
||||
use ui::{prelude::*, ContextMenu, ListItem, Scrollbar, ScrollbarState};
|
||||
use ui::{ContextMenu, ListItem, Scrollbar, ScrollbarState, prelude::*};
|
||||
use util::{debug_panic, maybe};
|
||||
|
||||
actions!(variable_list, [ExpandSelectedEntry, CollapseSelectedEntry]);
|
||||
|
|
|
@ -4,11 +4,11 @@ use anyhow::Result;
|
|||
|
||||
use dap::client::SessionId;
|
||||
use gpui::{
|
||||
percentage, Animation, AnimationExt, Entity, EventEmitter, FocusHandle, Focusable, Task,
|
||||
Transformation,
|
||||
Animation, AnimationExt, Entity, EventEmitter, FocusHandle, Focusable, Task, Transformation,
|
||||
percentage,
|
||||
};
|
||||
use project::debugger::session::Session;
|
||||
use ui::{v_flex, Color, Context, Icon, IconName, IntoElement, ParentElement, Render, Styled};
|
||||
use ui::{Color, Context, Icon, IconName, IntoElement, ParentElement, Render, Styled, v_flex};
|
||||
|
||||
pub(crate) struct StartingState {
|
||||
focus_handle: FocusHandle,
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
use crate::{attach_modal::Candidate, *};
|
||||
use attach_modal::AttachModal;
|
||||
use dap::{client::SessionId, FakeAdapter};
|
||||
use dap::{FakeAdapter, client::SessionId};
|
||||
use gpui::{BackgroundExecutor, TestAppContext, VisualTestContext};
|
||||
use menu::Confirm;
|
||||
use project::{FakeFs, Project};
|
||||
|
|
|
@ -1,35 +1,35 @@
|
|||
use crate::*;
|
||||
use dap::{
|
||||
ErrorResponse, RunInTerminalRequestArguments, SourceBreakpoint, StartDebuggingRequestArguments,
|
||||
StartDebuggingRequestArgumentsRequest,
|
||||
client::SessionId,
|
||||
requests::{
|
||||
Continue, Disconnect, Launch, Next, RunInTerminal, SetBreakpoints, StackTrace,
|
||||
StartDebugging, StepBack, StepIn, StepOut, Threads,
|
||||
},
|
||||
ErrorResponse, RunInTerminalRequestArguments, SourceBreakpoint, StartDebuggingRequestArguments,
|
||||
StartDebuggingRequestArgumentsRequest,
|
||||
};
|
||||
use editor::{
|
||||
actions::{self},
|
||||
Editor, EditorMode, MultiBuffer,
|
||||
actions::{self},
|
||||
};
|
||||
use gpui::{BackgroundExecutor, TestAppContext, VisualTestContext};
|
||||
use project::{
|
||||
debugger::session::{ThreadId, ThreadStatus},
|
||||
FakeFs, Project,
|
||||
debugger::session::{ThreadId, ThreadStatus},
|
||||
};
|
||||
use serde_json::json;
|
||||
use std::{
|
||||
path::Path,
|
||||
sync::{
|
||||
atomic::{AtomicBool, Ordering},
|
||||
Arc,
|
||||
atomic::{AtomicBool, Ordering},
|
||||
},
|
||||
};
|
||||
use task::LaunchConfig;
|
||||
use terminal_view::{terminal_panel::TerminalPanel, TerminalView};
|
||||
use terminal_view::{TerminalView, terminal_panel::TerminalPanel};
|
||||
use tests::{active_debug_session_panel, init_test, init_test_workspace};
|
||||
use util::path;
|
||||
use workspace::{dock::Panel, Item};
|
||||
use workspace::{Item, dock::Panel};
|
||||
|
||||
#[gpui::test]
|
||||
async fn test_basic_show_debug_panel(executor: BackgroundExecutor, cx: &mut TestAppContext) {
|
||||
|
@ -444,15 +444,17 @@ async fn test_handle_successful_run_in_terminal_reverse_request(
|
|||
let panel = terminal_panel.read(cx).pane().unwrap().read(cx);
|
||||
|
||||
assert_eq!(1, panel.items_len());
|
||||
assert!(panel
|
||||
.active_item()
|
||||
.unwrap()
|
||||
.downcast::<TerminalView>()
|
||||
.unwrap()
|
||||
.read(cx)
|
||||
.terminal()
|
||||
.read(cx)
|
||||
.debug_terminal());
|
||||
assert!(
|
||||
panel
|
||||
.active_item()
|
||||
.unwrap()
|
||||
.downcast::<TerminalView>()
|
||||
.unwrap()
|
||||
.read(cx)
|
||||
.terminal()
|
||||
.read(cx)
|
||||
.debug_terminal()
|
||||
);
|
||||
})
|
||||
.unwrap();
|
||||
|
||||
|
@ -772,15 +774,21 @@ async fn test_shutdown_children_when_parent_session_shutdown(
|
|||
|
||||
// assert parent session and all children sessions are shutdown
|
||||
dap_store.update(cx, |dap_store, cx| {
|
||||
assert!(dap_store
|
||||
.session_by_id(parent_session.read(cx).session_id())
|
||||
.is_none());
|
||||
assert!(dap_store
|
||||
.session_by_id(first_child_session.read(cx).session_id())
|
||||
.is_none());
|
||||
assert!(dap_store
|
||||
.session_by_id(second_child_session.read(cx).session_id())
|
||||
.is_none());
|
||||
assert!(
|
||||
dap_store
|
||||
.session_by_id(parent_session.read(cx).session_id())
|
||||
.is_none()
|
||||
);
|
||||
assert!(
|
||||
dap_store
|
||||
.session_by_id(first_child_session.read(cx).session_id())
|
||||
.is_none()
|
||||
);
|
||||
assert!(
|
||||
dap_store
|
||||
.session_by_id(second_child_session.read(cx).session_id())
|
||||
.is_none()
|
||||
);
|
||||
});
|
||||
}
|
||||
|
||||
|
@ -874,15 +882,21 @@ async fn test_shutdown_parent_session_if_all_children_are_shutdown(
|
|||
|
||||
// assert parent session and second child session still exist
|
||||
dap_store.update(cx, |dap_store, cx| {
|
||||
assert!(dap_store
|
||||
.session_by_id(parent_session.read(cx).session_id())
|
||||
.is_some());
|
||||
assert!(dap_store
|
||||
.session_by_id(first_child_session.read(cx).session_id())
|
||||
.is_none());
|
||||
assert!(dap_store
|
||||
.session_by_id(second_child_session.read(cx).session_id())
|
||||
.is_some());
|
||||
assert!(
|
||||
dap_store
|
||||
.session_by_id(parent_session.read(cx).session_id())
|
||||
.is_some()
|
||||
);
|
||||
assert!(
|
||||
dap_store
|
||||
.session_by_id(first_child_session.read(cx).session_id())
|
||||
.is_none()
|
||||
);
|
||||
assert!(
|
||||
dap_store
|
||||
.session_by_id(second_child_session.read(cx).session_id())
|
||||
.is_some()
|
||||
);
|
||||
});
|
||||
|
||||
// shutdown first child session
|
||||
|
@ -896,12 +910,16 @@ async fn test_shutdown_parent_session_if_all_children_are_shutdown(
|
|||
// assert parent session got shutdown by second child session
|
||||
// because it was the last child
|
||||
dap_store.update(cx, |dap_store, cx| {
|
||||
assert!(dap_store
|
||||
.session_by_id(parent_session.read(cx).session_id())
|
||||
.is_none());
|
||||
assert!(dap_store
|
||||
.session_by_id(second_child_session.read(cx).session_id())
|
||||
.is_none());
|
||||
assert!(
|
||||
dap_store
|
||||
.session_by_id(parent_session.read(cx).session_id())
|
||||
.is_none()
|
||||
);
|
||||
assert!(
|
||||
dap_store
|
||||
.session_by_id(second_child_session.read(cx).session_id())
|
||||
.is_none()
|
||||
);
|
||||
});
|
||||
}
|
||||
|
||||
|
|
|
@ -4,14 +4,14 @@ use crate::{
|
|||
tests::{active_debug_session_panel, init_test, init_test_workspace},
|
||||
};
|
||||
use dap::{
|
||||
requests::{Modules, StackTrace, Threads},
|
||||
StoppedEvent,
|
||||
requests::{Modules, StackTrace, Threads},
|
||||
};
|
||||
use gpui::{BackgroundExecutor, TestAppContext, VisualTestContext};
|
||||
use project::{FakeFs, Project};
|
||||
use std::sync::{
|
||||
atomic::{AtomicBool, AtomicI32, Ordering},
|
||||
Arc,
|
||||
atomic::{AtomicBool, AtomicI32, Ordering},
|
||||
};
|
||||
use task::LaunchConfig;
|
||||
|
||||
|
|
|
@ -4,8 +4,8 @@ use crate::{
|
|||
tests::{active_debug_session_panel, init_test, init_test_workspace},
|
||||
};
|
||||
use dap::{
|
||||
requests::{StackTrace, Threads},
|
||||
StackFrame,
|
||||
requests::{StackTrace, Threads},
|
||||
};
|
||||
use editor::{Editor, ToPoint as _};
|
||||
use gpui::{BackgroundExecutor, TestAppContext, VisualTestContext};
|
||||
|
|
|
@ -1,17 +1,17 @@
|
|||
use std::sync::{
|
||||
atomic::{AtomicBool, Ordering},
|
||||
Arc,
|
||||
atomic::{AtomicBool, Ordering},
|
||||
};
|
||||
|
||||
use crate::{
|
||||
DebugPanel,
|
||||
session::running::variable_list::{CollapseSelectedEntry, ExpandSelectedEntry},
|
||||
tests::{active_debug_session_panel, init_test, init_test_workspace},
|
||||
DebugPanel,
|
||||
};
|
||||
use collections::HashMap;
|
||||
use dap::{
|
||||
requests::{Initialize, Launch, Scopes, StackTrace, Variables},
|
||||
Scope, StackFrame, Variable,
|
||||
requests::{Initialize, Launch, Scopes, StackTrace, Variables},
|
||||
};
|
||||
use gpui::{BackgroundExecutor, TestAppContext, VisualTestContext};
|
||||
use menu::{SelectFirst, SelectNext, SelectPrevious};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue