gpui: Store action documentation (#33809)
Closes #ISSUE Adds a new `documentation` method to actions, that is extracted from doc comments when using the `actions!` or derive macros. Additionally, this PR adds doc comments to as many action definitions in Zed as possible. Release Notes: - N/A *or* Added/Fixed/Improved ...
This commit is contained in:
parent
def8bab5a8
commit
6cd4dbdea1
96 changed files with 1467 additions and 78 deletions
|
@ -31,7 +31,13 @@ use workspace::{StatusItemView, Workspace, item::ItemHandle};
|
|||
|
||||
const GIT_OPERATION_DELAY: Duration = Duration::from_millis(0);
|
||||
|
||||
actions!(activity_indicator, [ShowErrorMessage]);
|
||||
actions!(
|
||||
activity_indicator,
|
||||
[
|
||||
/// Displays error messages from language servers in the status bar.
|
||||
ShowErrorMessage
|
||||
]
|
||||
);
|
||||
|
||||
pub enum Event {
|
||||
ShowStatus {
|
||||
|
|
|
@ -54,42 +54,76 @@ pub use ui::preview::{all_agent_previews, get_agent_preview};
|
|||
actions!(
|
||||
agent,
|
||||
[
|
||||
/// Creates a new text-based conversation thread.
|
||||
NewTextThread,
|
||||
/// Toggles the context picker interface for adding files, symbols, or other context.
|
||||
ToggleContextPicker,
|
||||
/// Toggles the navigation menu for switching between threads and views.
|
||||
ToggleNavigationMenu,
|
||||
/// Toggles the options menu for agent settings and preferences.
|
||||
ToggleOptionsMenu,
|
||||
/// Deletes the recently opened thread from history.
|
||||
DeleteRecentlyOpenThread,
|
||||
/// Toggles the profile selector for switching between agent profiles.
|
||||
ToggleProfileSelector,
|
||||
/// Removes all added context from the current conversation.
|
||||
RemoveAllContext,
|
||||
/// Expands the message editor to full size.
|
||||
ExpandMessageEditor,
|
||||
/// Opens the conversation history view.
|
||||
OpenHistory,
|
||||
/// Adds a context server to the configuration.
|
||||
AddContextServer,
|
||||
/// Removes the currently selected thread.
|
||||
RemoveSelectedThread,
|
||||
/// Starts a chat conversation with the agent.
|
||||
Chat,
|
||||
/// Starts a chat conversation with follow-up enabled.
|
||||
ChatWithFollow,
|
||||
/// Cycles to the next inline assist suggestion.
|
||||
CycleNextInlineAssist,
|
||||
/// Cycles to the previous inline assist suggestion.
|
||||
CyclePreviousInlineAssist,
|
||||
/// Moves focus up in the interface.
|
||||
FocusUp,
|
||||
/// Moves focus down in the interface.
|
||||
FocusDown,
|
||||
/// Moves focus left in the interface.
|
||||
FocusLeft,
|
||||
/// Moves focus right in the interface.
|
||||
FocusRight,
|
||||
/// Removes the currently focused context item.
|
||||
RemoveFocusedContext,
|
||||
/// Accepts the suggested context item.
|
||||
AcceptSuggestedContext,
|
||||
/// Opens the active thread as a markdown file.
|
||||
OpenActiveThreadAsMarkdown,
|
||||
/// Opens the agent diff view to review changes.
|
||||
OpenAgentDiff,
|
||||
/// Keeps the current suggestion or change.
|
||||
Keep,
|
||||
/// Rejects the current suggestion or change.
|
||||
Reject,
|
||||
/// Rejects all suggestions or changes.
|
||||
RejectAll,
|
||||
/// Keeps all suggestions or changes.
|
||||
KeepAll,
|
||||
/// Follows the agent's suggestions.
|
||||
Follow,
|
||||
/// Resets the trial upsell notification.
|
||||
ResetTrialUpsell,
|
||||
/// Resets the trial end upsell notification.
|
||||
ResetTrialEndUpsell,
|
||||
/// Continues the current thread.
|
||||
ContinueThread,
|
||||
/// Continues the thread with burn mode enabled.
|
||||
ContinueWithBurnMode,
|
||||
/// Toggles burn mode for faster responses.
|
||||
ToggleBurnMode,
|
||||
]
|
||||
);
|
||||
|
||||
/// Creates a new conversation thread, optionally based on an existing thread.
|
||||
#[derive(Default, Clone, PartialEq, Deserialize, JsonSchema, Action)]
|
||||
#[action(namespace = agent)]
|
||||
#[serde(deny_unknown_fields)]
|
||||
|
@ -98,6 +132,7 @@ pub struct NewThread {
|
|||
from_thread_id: Option<ThreadId>,
|
||||
}
|
||||
|
||||
/// Opens the profile management interface for configuring agent tools and settings.
|
||||
#[derive(PartialEq, Clone, Default, Debug, Deserialize, JsonSchema, Action)]
|
||||
#[action(namespace = agent)]
|
||||
#[serde(deny_unknown_fields)]
|
||||
|
|
|
@ -18,6 +18,7 @@ use ui::{ListItem, ListItemSpacing, prelude::*};
|
|||
actions!(
|
||||
agent,
|
||||
[
|
||||
/// Toggles the language model selector dropdown.
|
||||
#[action(deprecated_aliases = ["assistant::ToggleModelSelector", "assistant2::ToggleModelSelector"])]
|
||||
ToggleModelSelector
|
||||
]
|
||||
|
|
|
@ -85,16 +85,24 @@ use assistant_context::{
|
|||
actions!(
|
||||
assistant,
|
||||
[
|
||||
/// Sends the current message to the assistant.
|
||||
Assist,
|
||||
/// Confirms and executes the entered slash command.
|
||||
ConfirmCommand,
|
||||
/// Copies code from the assistant's response to the clipboard.
|
||||
CopyCode,
|
||||
/// Cycles between user and assistant message roles.
|
||||
CycleMessageRole,
|
||||
/// Inserts the selected text into the active editor.
|
||||
InsertIntoEditor,
|
||||
/// Quotes the current selection in the assistant conversation.
|
||||
QuoteSelection,
|
||||
/// Splits the conversation at the current cursor position.
|
||||
Split,
|
||||
]
|
||||
);
|
||||
|
||||
/// Inserts files that were dragged and dropped into the assistant conversation.
|
||||
#[derive(PartialEq, Clone, Action)]
|
||||
#[action(namespace = assistant, no_json, no_register)]
|
||||
pub enum InsertDraggedFiles {
|
||||
|
|
|
@ -28,7 +28,17 @@ use workspace::Workspace;
|
|||
const SHOULD_SHOW_UPDATE_NOTIFICATION_KEY: &str = "auto-updater-should-show-updated-notification";
|
||||
const POLL_INTERVAL: Duration = Duration::from_secs(60 * 60);
|
||||
|
||||
actions!(auto_update, [Check, DismissErrorMessage, ViewReleaseNotes,]);
|
||||
actions!(
|
||||
auto_update,
|
||||
[
|
||||
/// Checks for available updates.
|
||||
Check,
|
||||
/// Dismisses the update error message.
|
||||
DismissErrorMessage,
|
||||
/// Opens the release notes for the current version.
|
||||
ViewReleaseNotes,
|
||||
]
|
||||
);
|
||||
|
||||
#[derive(Serialize)]
|
||||
struct UpdateRequestBody {
|
||||
|
|
|
@ -12,7 +12,13 @@ use workspace::Workspace;
|
|||
use workspace::notifications::simple_message_notification::MessageNotification;
|
||||
use workspace::notifications::{NotificationId, show_app_notification};
|
||||
|
||||
actions!(auto_update, [ViewReleaseNotesLocally]);
|
||||
actions!(
|
||||
auto_update,
|
||||
[
|
||||
/// Opens release notes in the browser for the current version.
|
||||
ViewReleaseNotesLocally
|
||||
]
|
||||
);
|
||||
|
||||
pub fn init(cx: &mut App) {
|
||||
notify_if_app_was_updated(cx);
|
||||
|
|
|
@ -81,7 +81,17 @@ pub const INITIAL_RECONNECTION_DELAY: Duration = Duration::from_millis(500);
|
|||
pub const MAX_RECONNECTION_DELAY: Duration = Duration::from_secs(10);
|
||||
pub const CONNECTION_TIMEOUT: Duration = Duration::from_secs(20);
|
||||
|
||||
actions!(client, [SignIn, SignOut, Reconnect]);
|
||||
actions!(
|
||||
client,
|
||||
[
|
||||
/// Signs in to Zed account.
|
||||
SignIn,
|
||||
/// Signs out of Zed account.
|
||||
SignOut,
|
||||
/// Reconnects to the collaboration server.
|
||||
Reconnect
|
||||
]
|
||||
);
|
||||
|
||||
#[derive(Clone, Default, Serialize, Deserialize, JsonSchema)]
|
||||
pub struct ClientSettingsContent {
|
||||
|
|
|
@ -30,7 +30,13 @@ use workspace::{
|
|||
};
|
||||
use workspace::{item::Dedup, notifications::NotificationId};
|
||||
|
||||
actions!(collab, [CopyLink]);
|
||||
actions!(
|
||||
collab,
|
||||
[
|
||||
/// Copies a link to the current position in the channel buffer.
|
||||
CopyLink
|
||||
]
|
||||
);
|
||||
|
||||
pub fn init(cx: &mut App) {
|
||||
workspace::FollowableViewRegistry::register::<ChannelView>(cx)
|
||||
|
|
|
@ -71,7 +71,13 @@ struct SerializedChatPanel {
|
|||
width: Option<Pixels>,
|
||||
}
|
||||
|
||||
actions!(chat_panel, [ToggleFocus]);
|
||||
actions!(
|
||||
chat_panel,
|
||||
[
|
||||
/// Toggles focus on the chat panel.
|
||||
ToggleFocus
|
||||
]
|
||||
);
|
||||
|
||||
impl ChatPanel {
|
||||
pub fn new(
|
||||
|
|
|
@ -44,15 +44,25 @@ use workspace::{
|
|||
actions!(
|
||||
collab_panel,
|
||||
[
|
||||
/// Toggles focus on the collaboration panel.
|
||||
ToggleFocus,
|
||||
/// Removes the selected channel or contact.
|
||||
Remove,
|
||||
/// Opens the context menu for the selected item.
|
||||
Secondary,
|
||||
/// Collapses the selected channel in the tree view.
|
||||
CollapseSelectedChannel,
|
||||
/// Expands the selected channel in the tree view.
|
||||
ExpandSelectedChannel,
|
||||
/// Starts moving a channel to a new location.
|
||||
StartMoveChannel,
|
||||
/// Moves the selected item to the current location.
|
||||
MoveSelected,
|
||||
/// Inserts a space character in the filter input.
|
||||
InsertSpace,
|
||||
/// Moves the selected channel up in the list.
|
||||
MoveChannelUp,
|
||||
/// Moves the selected channel down in the list.
|
||||
MoveChannelDown,
|
||||
]
|
||||
);
|
||||
|
|
|
@ -17,9 +17,13 @@ use workspace::{ModalView, notifications::DetachAndPromptErr};
|
|||
actions!(
|
||||
channel_modal,
|
||||
[
|
||||
/// Selects the next control in the channel modal.
|
||||
SelectNextControl,
|
||||
/// Toggles between invite members and manage members mode.
|
||||
ToggleMode,
|
||||
/// Toggles admin status for the selected member.
|
||||
ToggleMemberAdmin,
|
||||
/// Removes the selected member from the channel.
|
||||
RemoveMember
|
||||
]
|
||||
);
|
||||
|
|
|
@ -74,7 +74,13 @@ pub struct NotificationPresenter {
|
|||
pub can_navigate: bool,
|
||||
}
|
||||
|
||||
actions!(notification_panel, [ToggleFocus]);
|
||||
actions!(
|
||||
notification_panel,
|
||||
[
|
||||
/// Toggles focus on the notification panel.
|
||||
ToggleFocus
|
||||
]
|
||||
);
|
||||
|
||||
pub fn init(cx: &mut App) {
|
||||
cx.observe_new(|workspace: &mut Workspace, _, _| {
|
||||
|
|
|
@ -46,11 +46,17 @@ pub use crate::sign_in::{CopilotCodeVerification, initiate_sign_in, reinstall_an
|
|||
actions!(
|
||||
copilot,
|
||||
[
|
||||
/// Requests a code completion suggestion from Copilot.
|
||||
Suggest,
|
||||
/// Cycles to the next Copilot suggestion.
|
||||
NextSuggestion,
|
||||
/// Cycles to the previous Copilot suggestion.
|
||||
PreviousSuggestion,
|
||||
/// Reinstalls the Copilot language server.
|
||||
Reinstall,
|
||||
/// Signs in to GitHub Copilot.
|
||||
SignIn,
|
||||
/// Signs out of GitHub Copilot.
|
||||
SignOut
|
||||
]
|
||||
);
|
||||
|
|
|
@ -918,7 +918,13 @@ impl Render for DapLogView {
|
|||
}
|
||||
}
|
||||
|
||||
actions!(dev, [OpenDebugAdapterLogs]);
|
||||
actions!(
|
||||
dev,
|
||||
[
|
||||
/// Opens the debug adapter protocol logs viewer.
|
||||
OpenDebugAdapterLogs
|
||||
]
|
||||
);
|
||||
|
||||
pub fn init(cx: &mut App) {
|
||||
let log_store = cx.new(|cx| LogStore::new(cx));
|
||||
|
|
|
@ -32,36 +32,67 @@ pub mod tests;
|
|||
actions!(
|
||||
debugger,
|
||||
[
|
||||
/// Starts a new debugging session.
|
||||
Start,
|
||||
/// Continues execution until the next breakpoint.
|
||||
Continue,
|
||||
/// Detaches the debugger from the running process.
|
||||
Detach,
|
||||
/// Pauses the currently running program.
|
||||
Pause,
|
||||
/// Restarts the current debugging session.
|
||||
Restart,
|
||||
/// Reruns the current debugging session with the same configuration.
|
||||
RerunSession,
|
||||
/// Steps into the next function call.
|
||||
StepInto,
|
||||
/// Steps over the current line.
|
||||
StepOver,
|
||||
/// Steps out of the current function.
|
||||
StepOut,
|
||||
/// Steps back to the previous statement.
|
||||
StepBack,
|
||||
/// Stops the debugging session.
|
||||
Stop,
|
||||
/// Toggles whether to ignore all breakpoints.
|
||||
ToggleIgnoreBreakpoints,
|
||||
/// Clears all breakpoints in the project.
|
||||
ClearAllBreakpoints,
|
||||
/// Focuses on the debugger console panel.
|
||||
FocusConsole,
|
||||
/// Focuses on the variables panel.
|
||||
FocusVariables,
|
||||
/// Focuses on the breakpoint list panel.
|
||||
FocusBreakpointList,
|
||||
/// Focuses on the call stack frames panel.
|
||||
FocusFrames,
|
||||
/// Focuses on the loaded modules panel.
|
||||
FocusModules,
|
||||
/// Focuses on the loaded sources panel.
|
||||
FocusLoadedSources,
|
||||
/// Focuses on the terminal panel.
|
||||
FocusTerminal,
|
||||
/// Shows the stack trace for the current thread.
|
||||
ShowStackTrace,
|
||||
/// Toggles the thread picker dropdown.
|
||||
ToggleThreadPicker,
|
||||
/// Toggles the session picker dropdown.
|
||||
ToggleSessionPicker,
|
||||
/// Reruns the last debugging session.
|
||||
#[action(deprecated_aliases = ["debugger::RerunLastSession"])]
|
||||
Rerun,
|
||||
/// Toggles expansion of the selected item in the debugger UI.
|
||||
ToggleExpandItem,
|
||||
]
|
||||
);
|
||||
|
||||
actions!(dev, [CopyDebugAdapterArguments]);
|
||||
actions!(
|
||||
dev,
|
||||
[
|
||||
/// Copies debug adapter launch arguments to clipboard.
|
||||
CopyDebugAdapterArguments
|
||||
]
|
||||
);
|
||||
|
||||
pub fn init(cx: &mut App) {
|
||||
DebuggerSettings::register(cx);
|
||||
|
|
|
@ -33,7 +33,12 @@ use zed_actions::{ToggleEnableBreakpoint, UnsetBreakpoint};
|
|||
|
||||
actions!(
|
||||
debugger,
|
||||
[PreviousBreakpointProperty, NextBreakpointProperty]
|
||||
[
|
||||
/// Navigates to the previous breakpoint property in the list.
|
||||
PreviousBreakpointProperty,
|
||||
/// Navigates to the next breakpoint property in the list.
|
||||
NextBreakpointProperty
|
||||
]
|
||||
);
|
||||
#[derive(Clone, Copy, PartialEq)]
|
||||
pub(crate) enum SelectedBreakpointKind {
|
||||
|
|
|
@ -23,7 +23,13 @@ use std::{cell::RefCell, ops::Range, rc::Rc, usize};
|
|||
use theme::{Theme, ThemeSettings};
|
||||
use ui::{ContextMenu, Divider, PopoverMenu, SplitButton, Tooltip, prelude::*};
|
||||
|
||||
actions!(console, [WatchExpression]);
|
||||
actions!(
|
||||
console,
|
||||
[
|
||||
/// Adds an expression to the watch list.
|
||||
WatchExpression
|
||||
]
|
||||
);
|
||||
|
||||
pub struct Console {
|
||||
console: Entity<Editor>,
|
||||
|
|
|
@ -18,12 +18,19 @@ use util::debug_panic;
|
|||
actions!(
|
||||
variable_list,
|
||||
[
|
||||
/// Expands the selected variable entry to show its children.
|
||||
ExpandSelectedEntry,
|
||||
/// Collapses the selected variable entry to hide its children.
|
||||
CollapseSelectedEntry,
|
||||
/// Copies the variable name to the clipboard.
|
||||
CopyVariableName,
|
||||
/// Copies the variable value to the clipboard.
|
||||
CopyVariableValue,
|
||||
/// Edits the value of the selected variable.
|
||||
EditVariable,
|
||||
/// Adds the selected variable to the watch list.
|
||||
AddWatch,
|
||||
/// Removes the selected variable from the watch list.
|
||||
RemoveWatch,
|
||||
]
|
||||
);
|
||||
|
|
|
@ -48,7 +48,14 @@ use workspace::{
|
|||
|
||||
actions!(
|
||||
diagnostics,
|
||||
[Deploy, ToggleWarnings, ToggleDiagnosticsRefresh]
|
||||
[
|
||||
/// Opens the project diagnostics view.
|
||||
Deploy,
|
||||
/// Toggles the display of warning-level diagnostics.
|
||||
ToggleWarnings,
|
||||
/// Toggles automatic refresh of diagnostics.
|
||||
ToggleDiagnosticsRefresh
|
||||
]
|
||||
);
|
||||
|
||||
#[derive(Default)]
|
||||
|
|
|
@ -4,6 +4,7 @@ use gpui::{Action, actions};
|
|||
use schemars::JsonSchema;
|
||||
use util::serde::default_true;
|
||||
|
||||
/// Selects the next occurrence of the current selection.
|
||||
#[derive(PartialEq, Clone, Deserialize, Default, JsonSchema, Action)]
|
||||
#[action(namespace = editor)]
|
||||
#[serde(deny_unknown_fields)]
|
||||
|
@ -12,6 +13,7 @@ pub struct SelectNext {
|
|||
pub replace_newest: bool,
|
||||
}
|
||||
|
||||
/// Selects the previous occurrence of the current selection.
|
||||
#[derive(PartialEq, Clone, Deserialize, Default, JsonSchema, Action)]
|
||||
#[action(namespace = editor)]
|
||||
#[serde(deny_unknown_fields)]
|
||||
|
@ -20,6 +22,7 @@ pub struct SelectPrevious {
|
|||
pub replace_newest: bool,
|
||||
}
|
||||
|
||||
/// Moves the cursor to the beginning of the current line.
|
||||
#[derive(PartialEq, Clone, Deserialize, Default, JsonSchema, Action)]
|
||||
#[action(namespace = editor)]
|
||||
#[serde(deny_unknown_fields)]
|
||||
|
@ -30,6 +33,7 @@ pub struct MoveToBeginningOfLine {
|
|||
pub stop_at_indent: bool,
|
||||
}
|
||||
|
||||
/// Selects from the cursor to the beginning of the current line.
|
||||
#[derive(PartialEq, Clone, Deserialize, Default, JsonSchema, Action)]
|
||||
#[action(namespace = editor)]
|
||||
#[serde(deny_unknown_fields)]
|
||||
|
@ -40,6 +44,7 @@ pub struct SelectToBeginningOfLine {
|
|||
pub stop_at_indent: bool,
|
||||
}
|
||||
|
||||
/// Deletes from the cursor to the beginning of the current line.
|
||||
#[derive(PartialEq, Clone, Deserialize, Default, JsonSchema, Action)]
|
||||
#[action(namespace = editor)]
|
||||
#[serde(deny_unknown_fields)]
|
||||
|
@ -48,6 +53,7 @@ pub struct DeleteToBeginningOfLine {
|
|||
pub(super) stop_at_indent: bool,
|
||||
}
|
||||
|
||||
/// Moves the cursor up by one page.
|
||||
#[derive(PartialEq, Clone, Deserialize, Default, JsonSchema, Action)]
|
||||
#[action(namespace = editor)]
|
||||
#[serde(deny_unknown_fields)]
|
||||
|
@ -56,6 +62,7 @@ pub struct MovePageUp {
|
|||
pub(super) center_cursor: bool,
|
||||
}
|
||||
|
||||
/// Moves the cursor down by one page.
|
||||
#[derive(PartialEq, Clone, Deserialize, Default, JsonSchema, Action)]
|
||||
#[action(namespace = editor)]
|
||||
#[serde(deny_unknown_fields)]
|
||||
|
@ -64,6 +71,7 @@ pub struct MovePageDown {
|
|||
pub(super) center_cursor: bool,
|
||||
}
|
||||
|
||||
/// Moves the cursor to the end of the current line.
|
||||
#[derive(PartialEq, Clone, Deserialize, Default, JsonSchema, Action)]
|
||||
#[action(namespace = editor)]
|
||||
#[serde(deny_unknown_fields)]
|
||||
|
@ -72,6 +80,7 @@ pub struct MoveToEndOfLine {
|
|||
pub stop_at_soft_wraps: bool,
|
||||
}
|
||||
|
||||
/// Selects from the cursor to the end of the current line.
|
||||
#[derive(PartialEq, Clone, Deserialize, Default, JsonSchema, Action)]
|
||||
#[action(namespace = editor)]
|
||||
#[serde(deny_unknown_fields)]
|
||||
|
@ -80,6 +89,7 @@ pub struct SelectToEndOfLine {
|
|||
pub(super) stop_at_soft_wraps: bool,
|
||||
}
|
||||
|
||||
/// Toggles the display of available code actions at the cursor position.
|
||||
#[derive(PartialEq, Clone, Deserialize, Default, JsonSchema, Action)]
|
||||
#[action(namespace = editor)]
|
||||
#[serde(deny_unknown_fields)]
|
||||
|
@ -101,6 +111,7 @@ pub enum CodeActionSource {
|
|||
QuickActionBar,
|
||||
}
|
||||
|
||||
/// Confirms and accepts the currently selected completion suggestion.
|
||||
#[derive(PartialEq, Clone, Deserialize, Default, JsonSchema, Action)]
|
||||
#[action(namespace = editor)]
|
||||
#[serde(deny_unknown_fields)]
|
||||
|
@ -109,6 +120,7 @@ pub struct ConfirmCompletion {
|
|||
pub item_ix: Option<usize>,
|
||||
}
|
||||
|
||||
/// Composes multiple completion suggestions into a single completion.
|
||||
#[derive(PartialEq, Clone, Deserialize, Default, JsonSchema, Action)]
|
||||
#[action(namespace = editor)]
|
||||
#[serde(deny_unknown_fields)]
|
||||
|
@ -117,6 +129,7 @@ pub struct ComposeCompletion {
|
|||
pub item_ix: Option<usize>,
|
||||
}
|
||||
|
||||
/// Confirms and applies the currently selected code action.
|
||||
#[derive(PartialEq, Clone, Deserialize, Default, JsonSchema, Action)]
|
||||
#[action(namespace = editor)]
|
||||
#[serde(deny_unknown_fields)]
|
||||
|
@ -125,6 +138,7 @@ pub struct ConfirmCodeAction {
|
|||
pub item_ix: Option<usize>,
|
||||
}
|
||||
|
||||
/// Toggles comment markers for the selected lines.
|
||||
#[derive(PartialEq, Clone, Deserialize, Default, JsonSchema, Action)]
|
||||
#[action(namespace = editor)]
|
||||
#[serde(deny_unknown_fields)]
|
||||
|
@ -135,6 +149,7 @@ pub struct ToggleComments {
|
|||
pub ignore_indent: bool,
|
||||
}
|
||||
|
||||
/// Moves the cursor up by a specified number of lines.
|
||||
#[derive(PartialEq, Clone, Deserialize, Default, JsonSchema, Action)]
|
||||
#[action(namespace = editor)]
|
||||
#[serde(deny_unknown_fields)]
|
||||
|
@ -143,6 +158,7 @@ pub struct MoveUpByLines {
|
|||
pub(super) lines: u32,
|
||||
}
|
||||
|
||||
/// Moves the cursor down by a specified number of lines.
|
||||
#[derive(PartialEq, Clone, Deserialize, Default, JsonSchema, Action)]
|
||||
#[action(namespace = editor)]
|
||||
#[serde(deny_unknown_fields)]
|
||||
|
@ -151,6 +167,7 @@ pub struct MoveDownByLines {
|
|||
pub(super) lines: u32,
|
||||
}
|
||||
|
||||
/// Extends selection up by a specified number of lines.
|
||||
#[derive(PartialEq, Clone, Deserialize, Default, JsonSchema, Action)]
|
||||
#[action(namespace = editor)]
|
||||
#[serde(deny_unknown_fields)]
|
||||
|
@ -159,6 +176,7 @@ pub struct SelectUpByLines {
|
|||
pub(super) lines: u32,
|
||||
}
|
||||
|
||||
/// Extends selection down by a specified number of lines.
|
||||
#[derive(PartialEq, Clone, Deserialize, Default, JsonSchema, Action)]
|
||||
#[action(namespace = editor)]
|
||||
#[serde(deny_unknown_fields)]
|
||||
|
@ -167,6 +185,7 @@ pub struct SelectDownByLines {
|
|||
pub(super) lines: u32,
|
||||
}
|
||||
|
||||
/// Expands all excerpts in the editor.
|
||||
#[derive(PartialEq, Clone, Deserialize, Default, JsonSchema, Action)]
|
||||
#[action(namespace = editor)]
|
||||
#[serde(deny_unknown_fields)]
|
||||
|
@ -175,6 +194,7 @@ pub struct ExpandExcerpts {
|
|||
pub(super) lines: u32,
|
||||
}
|
||||
|
||||
/// Expands excerpts above the current position.
|
||||
#[derive(PartialEq, Clone, Deserialize, Default, JsonSchema, Action)]
|
||||
#[action(namespace = editor)]
|
||||
#[serde(deny_unknown_fields)]
|
||||
|
@ -183,6 +203,7 @@ pub struct ExpandExcerptsUp {
|
|||
pub(super) lines: u32,
|
||||
}
|
||||
|
||||
/// Expands excerpts below the current position.
|
||||
#[derive(PartialEq, Clone, Deserialize, Default, JsonSchema, Action)]
|
||||
#[action(namespace = editor)]
|
||||
#[serde(deny_unknown_fields)]
|
||||
|
@ -191,6 +212,7 @@ pub struct ExpandExcerptsDown {
|
|||
pub(super) lines: u32,
|
||||
}
|
||||
|
||||
/// Shows code completion suggestions at the cursor position.
|
||||
#[derive(PartialEq, Clone, Deserialize, Default, JsonSchema, Action)]
|
||||
#[action(namespace = editor)]
|
||||
#[serde(deny_unknown_fields)]
|
||||
|
@ -199,10 +221,12 @@ pub struct ShowCompletions {
|
|||
pub(super) trigger: Option<String>,
|
||||
}
|
||||
|
||||
/// Handles text input in the editor.
|
||||
#[derive(PartialEq, Clone, Deserialize, Default, JsonSchema, Action)]
|
||||
#[action(namespace = editor)]
|
||||
pub struct HandleInput(pub String);
|
||||
|
||||
/// Deletes from the cursor to the end of the next word.
|
||||
#[derive(PartialEq, Clone, Deserialize, Default, JsonSchema, Action)]
|
||||
#[action(namespace = editor)]
|
||||
#[serde(deny_unknown_fields)]
|
||||
|
@ -211,6 +235,7 @@ pub struct DeleteToNextWordEnd {
|
|||
pub ignore_newlines: bool,
|
||||
}
|
||||
|
||||
/// Deletes from the cursor to the start of the previous word.
|
||||
#[derive(PartialEq, Clone, Deserialize, Default, JsonSchema, Action)]
|
||||
#[action(namespace = editor)]
|
||||
#[serde(deny_unknown_fields)]
|
||||
|
@ -219,10 +244,12 @@ pub struct DeleteToPreviousWordStart {
|
|||
pub ignore_newlines: bool,
|
||||
}
|
||||
|
||||
/// Folds all code blocks at the specified indentation level.
|
||||
#[derive(PartialEq, Clone, Deserialize, Default, JsonSchema, Action)]
|
||||
#[action(namespace = editor)]
|
||||
pub struct FoldAtLevel(pub u32);
|
||||
|
||||
/// Spawns the nearest available task from the current cursor position.
|
||||
#[derive(PartialEq, Clone, Deserialize, Default, JsonSchema, Action)]
|
||||
#[action(namespace = editor)]
|
||||
#[serde(deny_unknown_fields)]
|
||||
|
@ -238,11 +265,20 @@ pub enum UuidVersion {
|
|||
V7,
|
||||
}
|
||||
|
||||
actions!(debugger, [RunToCursor, EvaluateSelectedText]);
|
||||
actions!(
|
||||
debugger,
|
||||
[
|
||||
/// Runs program execution to the current cursor position.
|
||||
RunToCursor,
|
||||
/// Evaluates the selected text in the debugger context.
|
||||
EvaluateSelectedText
|
||||
]
|
||||
);
|
||||
|
||||
actions!(
|
||||
go_to_line,
|
||||
[
|
||||
/// Toggles the go to line dialog.
|
||||
#[action(name = "Toggle")]
|
||||
ToggleGoToLine
|
||||
]
|
||||
|
@ -251,219 +287,430 @@ actions!(
|
|||
actions!(
|
||||
editor,
|
||||
[
|
||||
/// Accepts the full edit prediction.
|
||||
AcceptEditPrediction,
|
||||
/// Accepts a partial Copilot suggestion.
|
||||
AcceptPartialCopilotSuggestion,
|
||||
/// Accepts a partial edit prediction.
|
||||
AcceptPartialEditPrediction,
|
||||
/// Adds a cursor above the current selection.
|
||||
AddSelectionAbove,
|
||||
/// Adds a cursor below the current selection.
|
||||
AddSelectionBelow,
|
||||
/// Applies all diff hunks in the editor.
|
||||
ApplyAllDiffHunks,
|
||||
/// Applies the diff hunk at the current position.
|
||||
ApplyDiffHunk,
|
||||
/// Deletes the character before the cursor.
|
||||
Backspace,
|
||||
/// Cancels the current operation.
|
||||
Cancel,
|
||||
/// Cancels the running flycheck operation.
|
||||
CancelFlycheck,
|
||||
/// Cancels pending language server work.
|
||||
CancelLanguageServerWork,
|
||||
/// Clears flycheck results.
|
||||
ClearFlycheck,
|
||||
/// Confirms the rename operation.
|
||||
ConfirmRename,
|
||||
/// Confirms completion by inserting at cursor.
|
||||
ConfirmCompletionInsert,
|
||||
/// Confirms completion by replacing existing text.
|
||||
ConfirmCompletionReplace,
|
||||
/// Navigates to the first item in the context menu.
|
||||
ContextMenuFirst,
|
||||
/// Navigates to the last item in the context menu.
|
||||
ContextMenuLast,
|
||||
/// Navigates to the next item in the context menu.
|
||||
ContextMenuNext,
|
||||
/// Navigates to the previous item in the context menu.
|
||||
ContextMenuPrevious,
|
||||
/// Converts indentation from tabs to spaces.
|
||||
ConvertIndentationToSpaces,
|
||||
/// Converts indentation from spaces to tabs.
|
||||
ConvertIndentationToTabs,
|
||||
/// Converts selected text to kebab-case.
|
||||
ConvertToKebabCase,
|
||||
/// Converts selected text to lowerCamelCase.
|
||||
ConvertToLowerCamelCase,
|
||||
/// Converts selected text to lowercase.
|
||||
ConvertToLowerCase,
|
||||
/// Toggles the case of selected text.
|
||||
ConvertToOppositeCase,
|
||||
/// Converts selected text to snake_case.
|
||||
ConvertToSnakeCase,
|
||||
/// Converts selected text to Title Case.
|
||||
ConvertToTitleCase,
|
||||
/// Converts selected text to UpperCamelCase.
|
||||
ConvertToUpperCamelCase,
|
||||
/// Converts selected text to UPPERCASE.
|
||||
ConvertToUpperCase,
|
||||
/// Applies ROT13 cipher to selected text.
|
||||
ConvertToRot13,
|
||||
/// Applies ROT47 cipher to selected text.
|
||||
ConvertToRot47,
|
||||
/// Copies selected text to the clipboard.
|
||||
Copy,
|
||||
/// Copies selected text to the clipboard with leading/trailing whitespace trimmed.
|
||||
CopyAndTrim,
|
||||
/// Copies the current file location to the clipboard.
|
||||
CopyFileLocation,
|
||||
/// Copies the highlighted text as JSON.
|
||||
CopyHighlightJson,
|
||||
/// Copies the current file name to the clipboard.
|
||||
CopyFileName,
|
||||
/// Copies the file name without extension to the clipboard.
|
||||
CopyFileNameWithoutExtension,
|
||||
/// Copies a permalink to the current line.
|
||||
CopyPermalinkToLine,
|
||||
/// Cuts selected text to the clipboard.
|
||||
Cut,
|
||||
/// Cuts from cursor to end of line.
|
||||
CutToEndOfLine,
|
||||
/// Deletes the character after the cursor.
|
||||
Delete,
|
||||
/// Deletes the current line.
|
||||
DeleteLine,
|
||||
/// Deletes from cursor to end of line.
|
||||
DeleteToEndOfLine,
|
||||
/// Deletes to the end of the next subword.
|
||||
DeleteToNextSubwordEnd,
|
||||
/// Deletes to the start of the previous subword.
|
||||
DeleteToPreviousSubwordStart,
|
||||
/// Displays names of all active cursors.
|
||||
DisplayCursorNames,
|
||||
/// Duplicates the current line below.
|
||||
DuplicateLineDown,
|
||||
/// Duplicates the current line above.
|
||||
DuplicateLineUp,
|
||||
/// Duplicates the current selection.
|
||||
DuplicateSelection,
|
||||
/// Expands all diff hunks in the editor.
|
||||
#[action(deprecated_aliases = ["editor::ExpandAllHunkDiffs"])]
|
||||
ExpandAllDiffHunks,
|
||||
/// Expands macros recursively at cursor position.
|
||||
ExpandMacroRecursively,
|
||||
/// Finds all references to the symbol at cursor.
|
||||
FindAllReferences,
|
||||
/// Finds the next match in the search.
|
||||
FindNextMatch,
|
||||
/// Finds the previous match in the search.
|
||||
FindPreviousMatch,
|
||||
/// Folds the current code block.
|
||||
Fold,
|
||||
/// Folds all foldable regions in the editor.
|
||||
FoldAll,
|
||||
/// Folds all function bodies in the editor.
|
||||
FoldFunctionBodies,
|
||||
/// Folds the current code block and all its children.
|
||||
FoldRecursive,
|
||||
/// Folds the selected ranges.
|
||||
FoldSelectedRanges,
|
||||
/// Toggles folding at the current position.
|
||||
ToggleFold,
|
||||
/// Toggles recursive folding at the current position.
|
||||
ToggleFoldRecursive,
|
||||
/// Formats the entire document.
|
||||
Format,
|
||||
/// Formats only the selected text.
|
||||
FormatSelections,
|
||||
/// Goes to the declaration of the symbol at cursor.
|
||||
GoToDeclaration,
|
||||
/// Goes to declaration in a split pane.
|
||||
GoToDeclarationSplit,
|
||||
/// Goes to the definition of the symbol at cursor.
|
||||
GoToDefinition,
|
||||
/// Goes to definition in a split pane.
|
||||
GoToDefinitionSplit,
|
||||
/// Goes to the next diagnostic in the file.
|
||||
GoToDiagnostic,
|
||||
/// Goes to the next diff hunk.
|
||||
GoToHunk,
|
||||
/// Goes to the previous diff hunk.
|
||||
GoToPreviousHunk,
|
||||
/// Goes to the implementation of the symbol at cursor.
|
||||
GoToImplementation,
|
||||
/// Goes to implementation in a split pane.
|
||||
GoToImplementationSplit,
|
||||
/// Goes to the next change in the file.
|
||||
GoToNextChange,
|
||||
/// Goes to the parent module of the current file.
|
||||
GoToParentModule,
|
||||
/// Goes to the previous change in the file.
|
||||
GoToPreviousChange,
|
||||
/// Goes to the previous diagnostic in the file.
|
||||
GoToPreviousDiagnostic,
|
||||
/// Goes to the type definition of the symbol at cursor.
|
||||
GoToTypeDefinition,
|
||||
/// Goes to type definition in a split pane.
|
||||
GoToTypeDefinitionSplit,
|
||||
/// Scrolls down by half a page.
|
||||
HalfPageDown,
|
||||
/// Scrolls up by half a page.
|
||||
HalfPageUp,
|
||||
/// Shows hover information for the symbol at cursor.
|
||||
Hover,
|
||||
/// Increases indentation of selected lines.
|
||||
Indent,
|
||||
/// Inserts a UUID v4 at cursor position.
|
||||
InsertUuidV4,
|
||||
/// Inserts a UUID v7 at cursor position.
|
||||
InsertUuidV7,
|
||||
/// Joins the current line with the next line.
|
||||
JoinLines,
|
||||
/// Cuts to kill ring (Emacs-style).
|
||||
KillRingCut,
|
||||
/// Yanks from kill ring (Emacs-style).
|
||||
KillRingYank,
|
||||
/// Moves cursor down one line.
|
||||
LineDown,
|
||||
/// Moves cursor up one line.
|
||||
LineUp,
|
||||
/// Moves cursor down.
|
||||
MoveDown,
|
||||
/// Moves cursor left.
|
||||
MoveLeft,
|
||||
/// Moves the current line down.
|
||||
MoveLineDown,
|
||||
/// Moves the current line up.
|
||||
MoveLineUp,
|
||||
/// Moves cursor right.
|
||||
MoveRight,
|
||||
/// Moves cursor to the beginning of the document.
|
||||
MoveToBeginning,
|
||||
/// Moves cursor to the enclosing bracket.
|
||||
MoveToEnclosingBracket,
|
||||
/// Moves cursor to the end of the document.
|
||||
MoveToEnd,
|
||||
/// Moves cursor to the end of the paragraph.
|
||||
MoveToEndOfParagraph,
|
||||
/// Moves cursor to the end of the next subword.
|
||||
MoveToNextSubwordEnd,
|
||||
/// Moves cursor to the end of the next word.
|
||||
MoveToNextWordEnd,
|
||||
/// Moves cursor to the start of the previous subword.
|
||||
MoveToPreviousSubwordStart,
|
||||
/// Moves cursor to the start of the previous word.
|
||||
MoveToPreviousWordStart,
|
||||
/// Moves cursor to the start of the paragraph.
|
||||
MoveToStartOfParagraph,
|
||||
/// Moves cursor to the start of the current excerpt.
|
||||
MoveToStartOfExcerpt,
|
||||
/// Moves cursor to the start of the next excerpt.
|
||||
MoveToStartOfNextExcerpt,
|
||||
/// Moves cursor to the end of the current excerpt.
|
||||
MoveToEndOfExcerpt,
|
||||
/// Moves cursor to the end of the previous excerpt.
|
||||
MoveToEndOfPreviousExcerpt,
|
||||
/// Moves cursor up.
|
||||
MoveUp,
|
||||
/// Inserts a new line and moves cursor to it.
|
||||
Newline,
|
||||
/// Inserts a new line above the current line.
|
||||
NewlineAbove,
|
||||
/// Inserts a new line below the current line.
|
||||
NewlineBelow,
|
||||
/// Navigates to the next edit prediction.
|
||||
NextEditPrediction,
|
||||
/// Scrolls to the next screen.
|
||||
NextScreen,
|
||||
/// Opens the context menu at cursor position.
|
||||
OpenContextMenu,
|
||||
/// Opens excerpts from the current file.
|
||||
OpenExcerpts,
|
||||
/// Opens excerpts in a split pane.
|
||||
OpenExcerptsSplit,
|
||||
/// Opens the proposed changes editor.
|
||||
OpenProposedChangesEditor,
|
||||
/// Opens documentation for the symbol at cursor.
|
||||
OpenDocs,
|
||||
/// Opens a permalink to the current line.
|
||||
OpenPermalinkToLine,
|
||||
/// Opens the file whose name is selected in the editor.
|
||||
#[action(deprecated_aliases = ["editor::OpenFile"])]
|
||||
OpenSelectedFilename,
|
||||
/// Opens all selections in a multibuffer.
|
||||
OpenSelectionsInMultibuffer,
|
||||
/// Opens the URL at cursor position.
|
||||
OpenUrl,
|
||||
/// Organizes import statements.
|
||||
OrganizeImports,
|
||||
/// Decreases indentation of selected lines.
|
||||
Outdent,
|
||||
/// Automatically adjusts indentation based on context.
|
||||
AutoIndent,
|
||||
/// Scrolls down by one page.
|
||||
PageDown,
|
||||
/// Scrolls up by one page.
|
||||
PageUp,
|
||||
/// Pastes from clipboard.
|
||||
Paste,
|
||||
/// Navigates to the previous edit prediction.
|
||||
PreviousEditPrediction,
|
||||
/// Redoes the last undone edit.
|
||||
Redo,
|
||||
/// Redoes the last selection change.
|
||||
RedoSelection,
|
||||
/// Renames the symbol at cursor.
|
||||
Rename,
|
||||
/// Restarts the language server for the current file.
|
||||
RestartLanguageServer,
|
||||
/// Reveals the current file in the system file manager.
|
||||
RevealInFileManager,
|
||||
/// Reverses the order of selected lines.
|
||||
ReverseLines,
|
||||
/// Reloads the file from disk.
|
||||
ReloadFile,
|
||||
/// Rewraps text to fit within the preferred line length.
|
||||
Rewrap,
|
||||
/// Runs flycheck diagnostics.
|
||||
RunFlycheck,
|
||||
/// Scrolls the cursor to the bottom of the viewport.
|
||||
ScrollCursorBottom,
|
||||
/// Scrolls the cursor to the center of the viewport.
|
||||
ScrollCursorCenter,
|
||||
/// Cycles cursor position between center, top, and bottom.
|
||||
ScrollCursorCenterTopBottom,
|
||||
/// Scrolls the cursor to the top of the viewport.
|
||||
ScrollCursorTop,
|
||||
/// Selects all text in the editor.
|
||||
SelectAll,
|
||||
/// Selects all matches of the current selection.
|
||||
SelectAllMatches,
|
||||
/// Selects to the start of the current excerpt.
|
||||
SelectToStartOfExcerpt,
|
||||
/// Selects to the start of the next excerpt.
|
||||
SelectToStartOfNextExcerpt,
|
||||
/// Selects to the end of the current excerpt.
|
||||
SelectToEndOfExcerpt,
|
||||
/// Selects to the end of the previous excerpt.
|
||||
SelectToEndOfPreviousExcerpt,
|
||||
/// Extends selection down.
|
||||
SelectDown,
|
||||
/// Selects the enclosing symbol.
|
||||
SelectEnclosingSymbol,
|
||||
/// Selects the next larger syntax node.
|
||||
SelectLargerSyntaxNode,
|
||||
/// Extends selection left.
|
||||
SelectLeft,
|
||||
/// Selects the current line.
|
||||
SelectLine,
|
||||
/// Extends selection down by one page.
|
||||
SelectPageDown,
|
||||
/// Extends selection up by one page.
|
||||
SelectPageUp,
|
||||
/// Extends selection right.
|
||||
SelectRight,
|
||||
/// Selects the next smaller syntax node.
|
||||
SelectSmallerSyntaxNode,
|
||||
/// Selects to the beginning of the document.
|
||||
SelectToBeginning,
|
||||
/// Selects to the end of the document.
|
||||
SelectToEnd,
|
||||
/// Selects to the end of the paragraph.
|
||||
SelectToEndOfParagraph,
|
||||
/// Selects to the end of the next subword.
|
||||
SelectToNextSubwordEnd,
|
||||
/// Selects to the end of the next word.
|
||||
SelectToNextWordEnd,
|
||||
/// Selects to the start of the previous subword.
|
||||
SelectToPreviousSubwordStart,
|
||||
/// Selects to the start of the previous word.
|
||||
SelectToPreviousWordStart,
|
||||
/// Selects to the start of the paragraph.
|
||||
SelectToStartOfParagraph,
|
||||
/// Extends selection up.
|
||||
SelectUp,
|
||||
/// Shows the system character palette.
|
||||
ShowCharacterPalette,
|
||||
/// Shows edit prediction at cursor.
|
||||
ShowEditPrediction,
|
||||
/// Shows signature help for the current function.
|
||||
ShowSignatureHelp,
|
||||
/// Shows word completions.
|
||||
ShowWordCompletions,
|
||||
/// Randomly shuffles selected lines.
|
||||
ShuffleLines,
|
||||
/// Navigates to the next signature in the signature help popup.
|
||||
SignatureHelpNext,
|
||||
/// Navigates to the previous signature in the signature help popup.
|
||||
SignatureHelpPrevious,
|
||||
/// Sorts selected lines case-insensitively.
|
||||
SortLinesCaseInsensitive,
|
||||
/// Sorts selected lines case-sensitively.
|
||||
SortLinesCaseSensitive,
|
||||
/// Splits selection into individual lines.
|
||||
SplitSelectionIntoLines,
|
||||
/// Stops the language server for the current file.
|
||||
StopLanguageServer,
|
||||
/// Switches between source and header files.
|
||||
SwitchSourceHeader,
|
||||
/// Inserts a tab character or indents.
|
||||
Tab,
|
||||
/// Removes a tab character or outdents.
|
||||
Backtab,
|
||||
/// Toggles a breakpoint at the current line.
|
||||
ToggleBreakpoint,
|
||||
/// Toggles the case of selected text.
|
||||
ToggleCase,
|
||||
/// Disables the breakpoint at the current line.
|
||||
DisableBreakpoint,
|
||||
/// Enables the breakpoint at the current line.
|
||||
EnableBreakpoint,
|
||||
/// Edits the log message for a breakpoint.
|
||||
EditLogBreakpoint,
|
||||
/// Toggles automatic signature help.
|
||||
ToggleAutoSignatureHelp,
|
||||
/// Toggles inline git blame display.
|
||||
ToggleGitBlameInline,
|
||||
/// Opens the git commit for the blame at cursor.
|
||||
OpenGitBlameCommit,
|
||||
/// Toggles the diagnostics panel.
|
||||
ToggleDiagnostics,
|
||||
/// Toggles indent guides display.
|
||||
ToggleIndentGuides,
|
||||
/// Toggles inlay hints display.
|
||||
ToggleInlayHints,
|
||||
/// Toggles inline values display.
|
||||
ToggleInlineValues,
|
||||
/// Toggles inline diagnostics display.
|
||||
ToggleInlineDiagnostics,
|
||||
/// Toggles edit prediction feature.
|
||||
ToggleEditPrediction,
|
||||
/// Toggles line numbers display.
|
||||
ToggleLineNumbers,
|
||||
/// Toggles the minimap display.
|
||||
ToggleMinimap,
|
||||
/// Swaps the start and end of the current selection.
|
||||
SwapSelectionEnds,
|
||||
/// Sets a mark at the current position.
|
||||
SetMark,
|
||||
/// Toggles relative line numbers display.
|
||||
ToggleRelativeLineNumbers,
|
||||
/// Toggles diff display for selected hunks.
|
||||
#[action(deprecated_aliases = ["editor::ToggleHunkDiff"])]
|
||||
ToggleSelectedDiffHunks,
|
||||
/// Toggles the selection menu.
|
||||
ToggleSelectionMenu,
|
||||
/// Toggles soft wrap mode.
|
||||
ToggleSoftWrap,
|
||||
/// Toggles the tab bar display.
|
||||
ToggleTabBar,
|
||||
/// Transposes characters around cursor.
|
||||
Transpose,
|
||||
/// Undoes the last edit.
|
||||
Undo,
|
||||
/// Undoes the last selection change.
|
||||
UndoSelection,
|
||||
/// Unfolds all folded regions.
|
||||
UnfoldAll,
|
||||
/// Unfolds lines at cursor.
|
||||
UnfoldLines,
|
||||
/// Unfolds recursively at cursor.
|
||||
UnfoldRecursive,
|
||||
/// Removes duplicate lines (case-insensitive).
|
||||
UniqueLinesCaseInsensitive,
|
||||
/// Removes duplicate lines (case-sensitive).
|
||||
UniqueLinesCaseSensitive,
|
||||
]
|
||||
);
|
||||
|
|
|
@ -178,7 +178,13 @@ pub struct ExtensionIndexLanguageEntry {
|
|||
pub grammar: Option<Arc<str>>,
|
||||
}
|
||||
|
||||
actions!(zed, [ReloadExtensions]);
|
||||
actions!(
|
||||
zed,
|
||||
[
|
||||
/// Reloads all installed extensions.
|
||||
ReloadExtensions
|
||||
]
|
||||
);
|
||||
|
||||
pub fn init(
|
||||
extension_host_proxy: Arc<ExtensionHostProxy>,
|
||||
|
|
|
@ -38,7 +38,13 @@ use crate::extension_version_selector::{
|
|||
ExtensionVersionSelector, ExtensionVersionSelectorDelegate,
|
||||
};
|
||||
|
||||
actions!(zed, [InstallDevExtension]);
|
||||
actions!(
|
||||
zed,
|
||||
[
|
||||
/// Installs an extension from a local directory for development.
|
||||
InstallDevExtension
|
||||
]
|
||||
);
|
||||
|
||||
pub fn init(cx: &mut App) {
|
||||
cx.observe_new(move |workspace: &mut Workspace, window, cx| {
|
||||
|
|
|
@ -11,9 +11,13 @@ pub mod system_specs;
|
|||
actions!(
|
||||
zed,
|
||||
[
|
||||
/// Copies system specifications to the clipboard for bug reports.
|
||||
CopySystemSpecsIntoClipboard,
|
||||
/// Opens email client to send feedback to Zed support.
|
||||
EmailZed,
|
||||
/// Opens the Zed repository on GitHub.
|
||||
OpenZedRepo,
|
||||
/// Opens the feature request form.
|
||||
RequestFeature,
|
||||
]
|
||||
);
|
||||
|
|
|
@ -47,7 +47,14 @@ use workspace::{
|
|||
|
||||
actions!(
|
||||
file_finder,
|
||||
[SelectPrevious, ToggleFilterMenu, ToggleSplitMenu]
|
||||
[
|
||||
/// Selects the previous item in the file finder.
|
||||
SelectPrevious,
|
||||
/// Toggles the file filter menu.
|
||||
ToggleFilterMenu,
|
||||
/// Toggles the split direction menu.
|
||||
ToggleSplitMenu
|
||||
]
|
||||
);
|
||||
|
||||
impl ModalView for FileFinder {
|
||||
|
|
|
@ -31,38 +31,64 @@ actions!(
|
|||
git,
|
||||
[
|
||||
// per-hunk
|
||||
/// Toggles the staged state of the hunk at cursor.
|
||||
ToggleStaged,
|
||||
/// Stages the current hunk and moves to the next one.
|
||||
StageAndNext,
|
||||
/// Unstages the current hunk and moves to the next one.
|
||||
UnstageAndNext,
|
||||
/// Restores the selected hunks to their original state.
|
||||
#[action(deprecated_aliases = ["editor::RevertSelectedHunks"])]
|
||||
Restore,
|
||||
// per-file
|
||||
/// Shows git blame information for the current file.
|
||||
#[action(deprecated_aliases = ["editor::ToggleGitBlame"])]
|
||||
Blame,
|
||||
/// Stages the current file.
|
||||
StageFile,
|
||||
/// Unstages the current file.
|
||||
UnstageFile,
|
||||
// repo-wide
|
||||
/// Stages all changes in the repository.
|
||||
StageAll,
|
||||
/// Unstages all changes in the repository.
|
||||
UnstageAll,
|
||||
/// Restores all tracked files to their last committed state.
|
||||
RestoreTrackedFiles,
|
||||
/// Moves all untracked files to trash.
|
||||
TrashUntrackedFiles,
|
||||
/// Undoes the last commit, keeping changes in the working directory.
|
||||
Uncommit,
|
||||
/// Pushes commits to the remote repository.
|
||||
Push,
|
||||
/// Pushes commits to a specific remote branch.
|
||||
PushTo,
|
||||
/// Force pushes commits to the remote repository.
|
||||
ForcePush,
|
||||
/// Pulls changes from the remote repository.
|
||||
Pull,
|
||||
/// Fetches changes from the remote repository.
|
||||
Fetch,
|
||||
/// Fetches changes from a specific remote.
|
||||
FetchFrom,
|
||||
/// Creates a new commit with staged changes.
|
||||
Commit,
|
||||
/// Amends the last commit with staged changes.
|
||||
Amend,
|
||||
/// Cancels the current git operation.
|
||||
Cancel,
|
||||
/// Expands the commit message editor.
|
||||
ExpandCommitEditor,
|
||||
/// Generates a commit message using AI.
|
||||
GenerateCommitMessage,
|
||||
/// Initializes a new git repository.
|
||||
Init,
|
||||
/// Opens all modified files in the editor.
|
||||
OpenModifiedFiles,
|
||||
]
|
||||
);
|
||||
|
||||
/// Restores a file to its last committed state, discarding local changes.
|
||||
#[derive(Clone, Debug, Default, PartialEq, Deserialize, JsonSchema, Action)]
|
||||
#[action(namespace = git, deprecated_aliases = ["editor::RevertFile"])]
|
||||
#[serde(deny_unknown_fields)]
|
||||
|
|
|
@ -77,11 +77,17 @@ use zed_llm_client::CompletionIntent;
|
|||
actions!(
|
||||
git_panel,
|
||||
[
|
||||
/// Closes the git panel.
|
||||
Close,
|
||||
/// Toggles focus on the git panel.
|
||||
ToggleFocus,
|
||||
/// Opens the git panel menu.
|
||||
OpenMenu,
|
||||
/// Focuses on the commit message editor.
|
||||
FocusEditor,
|
||||
/// Focuses on the changes list.
|
||||
FocusChanges,
|
||||
/// Toggles automatic co-author suggestions.
|
||||
ToggleFillCoAuthors,
|
||||
]
|
||||
);
|
||||
|
|
|
@ -31,7 +31,13 @@ pub mod project_diff;
|
|||
pub(crate) mod remote_output;
|
||||
pub mod repository_selector;
|
||||
|
||||
actions!(git, [ResetOnboarding]);
|
||||
actions!(
|
||||
git,
|
||||
[
|
||||
/// Resets the git onboarding state to show the tutorial again.
|
||||
ResetOnboarding
|
||||
]
|
||||
);
|
||||
|
||||
pub fn init(cx: &mut App) {
|
||||
GitPanelSettings::register(cx);
|
||||
|
|
|
@ -41,7 +41,15 @@ use workspace::{
|
|||
searchable::SearchableItemHandle,
|
||||
};
|
||||
|
||||
actions!(git, [Diff, Add]);
|
||||
actions!(
|
||||
git,
|
||||
[
|
||||
/// Shows the diff between the working directory and the index.
|
||||
Diff,
|
||||
/// Adds files to the git staging area.
|
||||
Add
|
||||
]
|
||||
);
|
||||
|
||||
pub struct ProjectDiff {
|
||||
project: Entity<Project>,
|
||||
|
|
|
@ -150,6 +150,15 @@ pub trait Action: Any + Send {
|
|||
{
|
||||
None
|
||||
}
|
||||
|
||||
/// The documentation for this action, if any. When using the derive macro for actions
|
||||
/// this will be automatically generated from the doc comments on the action struct.
|
||||
fn documentation() -> Option<&'static str>
|
||||
where
|
||||
Self: Sized,
|
||||
{
|
||||
None
|
||||
}
|
||||
}
|
||||
|
||||
impl std::fmt::Debug for dyn Action {
|
||||
|
@ -254,6 +263,7 @@ pub struct MacroActionData {
|
|||
pub json_schema: fn(&mut schemars::SchemaGenerator) -> Option<schemars::Schema>,
|
||||
pub deprecated_aliases: &'static [&'static str],
|
||||
pub deprecation_message: Option<&'static str>,
|
||||
pub documentation: Option<&'static str>,
|
||||
}
|
||||
|
||||
inventory::collect!(MacroActionBuilder);
|
||||
|
@ -276,6 +286,7 @@ impl ActionRegistry {
|
|||
json_schema: A::action_json_schema,
|
||||
deprecated_aliases: A::deprecated_aliases(),
|
||||
deprecation_message: A::deprecation_message(),
|
||||
documentation: A::documentation(),
|
||||
});
|
||||
}
|
||||
|
||||
|
|
|
@ -14,6 +14,7 @@ pub(crate) fn derive_action(input: TokenStream) -> TokenStream {
|
|||
let mut no_register = false;
|
||||
let mut namespace = None;
|
||||
let mut deprecated = None;
|
||||
let mut doc_str: Option<String> = None;
|
||||
|
||||
for attr in &input.attrs {
|
||||
if attr.path().is_ident("action") {
|
||||
|
@ -74,6 +75,22 @@ pub(crate) fn derive_action(input: TokenStream) -> TokenStream {
|
|||
Ok(())
|
||||
})
|
||||
.unwrap_or_else(|e| panic!("in #[action] attribute: {}", e));
|
||||
} else if attr.path().is_ident("doc") {
|
||||
use syn::{Expr::Lit, ExprLit, Lit::Str, Meta, MetaNameValue};
|
||||
if let Meta::NameValue(MetaNameValue {
|
||||
value:
|
||||
Lit(ExprLit {
|
||||
lit: Str(ref lit_str),
|
||||
..
|
||||
}),
|
||||
..
|
||||
}) = attr.meta
|
||||
{
|
||||
let doc = lit_str.value();
|
||||
let doc_str = doc_str.get_or_insert_default();
|
||||
doc_str.push_str(doc.trim());
|
||||
doc_str.push('\n');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -122,6 +139,13 @@ pub(crate) fn derive_action(input: TokenStream) -> TokenStream {
|
|||
quote! { None }
|
||||
};
|
||||
|
||||
let documentation_fn_body = if let Some(doc) = doc_str {
|
||||
let doc = doc.trim();
|
||||
quote! { Some(#doc) }
|
||||
} else {
|
||||
quote! { None }
|
||||
};
|
||||
|
||||
let registration = if no_register {
|
||||
quote! {}
|
||||
} else {
|
||||
|
@ -171,6 +195,10 @@ pub(crate) fn derive_action(input: TokenStream) -> TokenStream {
|
|||
fn deprecation_message() -> Option<&'static str> {
|
||||
#deprecation_fn_body
|
||||
}
|
||||
|
||||
fn documentation() -> Option<&'static str> {
|
||||
#documentation_fn_body
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
|
|
|
@ -34,6 +34,7 @@ pub(crate) fn generate_register_action(type_name: &Ident) -> TokenStream2 {
|
|||
json_schema: <#type_name as gpui::Action>::action_json_schema,
|
||||
deprecated_aliases: <#type_name as gpui::Action>::deprecated_aliases(),
|
||||
deprecation_message: <#type_name as gpui::Action>::deprecation_message(),
|
||||
documentation: <#type_name as gpui::Action>::documentation(),
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -37,7 +37,13 @@ use zed_actions::OpenBrowser;
|
|||
use zed_llm_client::UsageLimit;
|
||||
use zeta::RateCompletions;
|
||||
|
||||
actions!(edit_prediction, [ToggleMenu]);
|
||||
actions!(
|
||||
edit_prediction,
|
||||
[
|
||||
/// Toggles the inline completion menu.
|
||||
ToggleMenu
|
||||
]
|
||||
);
|
||||
|
||||
const COPILOT_SETTINGS_URL: &str = "https://github.com/settings/copilot";
|
||||
|
||||
|
|
|
@ -8,7 +8,15 @@ use util::ResultExt;
|
|||
use workspace::notifications::{DetachAndPromptErr, NotificationId};
|
||||
use workspace::{Toast, Workspace};
|
||||
|
||||
actions!(cli, [Install, RegisterZedScheme]);
|
||||
actions!(
|
||||
cli,
|
||||
[
|
||||
/// Installs the Zed CLI tool to the system PATH.
|
||||
Install,
|
||||
/// Registers the zed:// URL scheme handler.
|
||||
RegisterZedScheme
|
||||
]
|
||||
);
|
||||
|
||||
async fn install_script(cx: &AsyncApp) -> Result<PathBuf> {
|
||||
let cli_path = cx.update(|cx| cx.path_for_auxiliary_executable("cli"))??;
|
||||
|
|
|
@ -13,7 +13,13 @@ use std::{
|
|||
};
|
||||
use workspace::{AppState, OpenVisible, Workspace};
|
||||
|
||||
actions!(journal, [NewJournalEntry]);
|
||||
actions!(
|
||||
journal,
|
||||
[
|
||||
/// Creates a new journal entry for today.
|
||||
NewJournalEntry
|
||||
]
|
||||
);
|
||||
|
||||
/// Settings specific to journaling
|
||||
#[derive(Clone, Debug, Serialize, Deserialize, JsonSchema)]
|
||||
|
|
|
@ -19,7 +19,13 @@ use ui::{HighlightedLabel, ListItem, ListItemSpacing, prelude::*};
|
|||
use util::ResultExt;
|
||||
use workspace::{ModalView, Workspace};
|
||||
|
||||
actions!(language_selector, [Toggle]);
|
||||
actions!(
|
||||
language_selector,
|
||||
[
|
||||
/// Toggles the language selector modal.
|
||||
Toggle
|
||||
]
|
||||
);
|
||||
|
||||
pub fn init(cx: &mut App) {
|
||||
cx.observe_new(LanguageSelector::register).detach();
|
||||
|
|
|
@ -13,7 +13,13 @@ use ui::{
|
|||
};
|
||||
use workspace::{Item, SplitDirection, Workspace};
|
||||
|
||||
actions!(dev, [OpenKeyContextView]);
|
||||
actions!(
|
||||
dev,
|
||||
[
|
||||
/// Opens the key context view for debugging keybindings.
|
||||
OpenKeyContextView
|
||||
]
|
||||
);
|
||||
|
||||
pub fn init(cx: &mut App) {
|
||||
cx.observe_new(|workspace: &mut Workspace, _, _| {
|
||||
|
|
|
@ -204,7 +204,13 @@ pub(crate) struct LogMenuItem {
|
|||
pub server_kind: LanguageServerKind,
|
||||
}
|
||||
|
||||
actions!(dev, [OpenLanguageServerLogs]);
|
||||
actions!(
|
||||
dev,
|
||||
[
|
||||
/// Opens the language server protocol logs viewer.
|
||||
OpenLanguageServerLogs
|
||||
]
|
||||
);
|
||||
|
||||
pub(super) struct GlobalLogStore(pub WeakEntity<LogStore>);
|
||||
|
||||
|
|
|
@ -19,7 +19,13 @@ use workspace::{StatusItemView, Workspace};
|
|||
|
||||
use crate::lsp_log::GlobalLogStore;
|
||||
|
||||
actions!(lsp_tool, [ToggleMenu]);
|
||||
actions!(
|
||||
lsp_tool,
|
||||
[
|
||||
/// Toggles the language server tool menu.
|
||||
ToggleMenu
|
||||
]
|
||||
);
|
||||
|
||||
pub struct LspTool {
|
||||
state: Entity<PickerState>,
|
||||
|
|
|
@ -15,7 +15,13 @@ use workspace::{
|
|||
item::{Item, ItemHandle},
|
||||
};
|
||||
|
||||
actions!(dev, [OpenSyntaxTreeView]);
|
||||
actions!(
|
||||
dev,
|
||||
[
|
||||
/// Opens the syntax tree view for the current file.
|
||||
OpenSyntaxTreeView
|
||||
]
|
||||
);
|
||||
|
||||
pub fn init(cx: &mut App) {
|
||||
cx.observe_new(|workspace: &mut Workspace, _, _| {
|
||||
|
|
|
@ -141,7 +141,15 @@ pub type CodeBlockRenderFn = Arc<
|
|||
pub type CodeBlockTransformFn =
|
||||
Arc<dyn Fn(AnyDiv, Range<usize>, CodeBlockMetadata, &mut Window, &App) -> AnyDiv>;
|
||||
|
||||
actions!(markdown, [Copy, CopyAsMarkdown]);
|
||||
actions!(
|
||||
markdown,
|
||||
[
|
||||
/// Copies the selected text to the clipboard.
|
||||
Copy,
|
||||
/// Copies the selected text as markdown to the clipboard.
|
||||
CopyAsMarkdown
|
||||
]
|
||||
);
|
||||
|
||||
impl Markdown {
|
||||
pub fn new(
|
||||
|
|
|
@ -9,10 +9,15 @@ pub mod markdown_renderer;
|
|||
actions!(
|
||||
markdown,
|
||||
[
|
||||
/// Scrolls up by one page in the markdown preview.
|
||||
MovePageUp,
|
||||
/// Scrolls down by one page in the markdown preview.
|
||||
MovePageDown,
|
||||
/// Opens a markdown preview for the current file.
|
||||
OpenPreview,
|
||||
/// Opens a markdown preview in a split pane.
|
||||
OpenPreviewToTheSide,
|
||||
/// Opens a following markdown preview that syncs with the editor.
|
||||
OpenFollowingPreview
|
||||
]
|
||||
);
|
||||
|
|
|
@ -12,13 +12,21 @@ pub fn init() {}
|
|||
actions!(
|
||||
menu,
|
||||
[
|
||||
/// Cancels the current menu operation.
|
||||
Cancel,
|
||||
/// Confirms the selected menu item.
|
||||
Confirm,
|
||||
/// Performs secondary confirmation action.
|
||||
SecondaryConfirm,
|
||||
/// Selects the previous item in the menu.
|
||||
SelectPrevious,
|
||||
/// Selects the next item in the menu.
|
||||
SelectNext,
|
||||
/// Selects the first item in the menu.
|
||||
SelectFirst,
|
||||
/// Selects the last item in the menu.
|
||||
SelectLast,
|
||||
/// Restarts the menu from the beginning.
|
||||
Restart,
|
||||
EndSlot,
|
||||
]
|
||||
|
|
|
@ -65,17 +65,28 @@ use worktree::{Entry, ProjectEntryId, WorktreeId};
|
|||
actions!(
|
||||
outline_panel,
|
||||
[
|
||||
/// Collapses all entries in the outline tree.
|
||||
CollapseAllEntries,
|
||||
/// Collapses the currently selected entry.
|
||||
CollapseSelectedEntry,
|
||||
/// Expands all entries in the outline tree.
|
||||
ExpandAllEntries,
|
||||
/// Expands the currently selected entry.
|
||||
ExpandSelectedEntry,
|
||||
/// Folds the selected directory.
|
||||
FoldDirectory,
|
||||
/// Opens the selected entry in the editor.
|
||||
OpenSelectedEntry,
|
||||
/// Reveals the selected item in the system file manager.
|
||||
RevealInFileManager,
|
||||
/// Selects the parent of the current entry.
|
||||
SelectParent,
|
||||
/// Toggles the pin status of the active editor.
|
||||
ToggleActiveEditorPin,
|
||||
ToggleFocus,
|
||||
/// Unfolds the selected directory.
|
||||
UnfoldDirectory,
|
||||
/// Toggles focus on the outline panel.
|
||||
ToggleFocus,
|
||||
]
|
||||
);
|
||||
|
||||
|
|
|
@ -5,7 +5,15 @@ use settings::Settings;
|
|||
use theme::ThemeSettings;
|
||||
use ui::{Tab, prelude::*};
|
||||
|
||||
actions!(panel, [NextPanelTab, PreviousPanelTab]);
|
||||
actions!(
|
||||
panel,
|
||||
[
|
||||
/// Navigates to the next tab in the panel.
|
||||
NextPanelTab,
|
||||
/// Navigates to the previous tab in the panel.
|
||||
PreviousPanelTab
|
||||
]
|
||||
);
|
||||
|
||||
pub trait PanelHeader: workspace::Panel {
|
||||
fn header_height(&self, cx: &mut App) -> Pixels {
|
||||
|
|
|
@ -34,7 +34,13 @@ pub enum Direction {
|
|||
Down,
|
||||
}
|
||||
|
||||
actions!(picker, [ConfirmCompletion]);
|
||||
actions!(
|
||||
picker,
|
||||
[
|
||||
/// Confirms the selected completion in the picker.
|
||||
ConfirmCompletion
|
||||
]
|
||||
);
|
||||
|
||||
/// ConfirmInput is an alternative editor action which - instead of selecting active picker entry - treats pickers editor input literally,
|
||||
/// performing some kind of action on it.
|
||||
|
|
|
@ -21,7 +21,13 @@ pub fn init(cx: &mut App) {
|
|||
extension::init(cx);
|
||||
}
|
||||
|
||||
actions!(context_server, [Restart]);
|
||||
actions!(
|
||||
context_server,
|
||||
[
|
||||
/// Restarts the context server.
|
||||
Restart
|
||||
]
|
||||
);
|
||||
|
||||
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
|
||||
pub enum ContextServerStatus {
|
||||
|
|
|
@ -181,6 +181,7 @@ struct EntryDetails {
|
|||
canonical_path: Option<Arc<Path>>,
|
||||
}
|
||||
|
||||
/// Permanently deletes the selected file or directory.
|
||||
#[derive(PartialEq, Clone, Default, Debug, Deserialize, JsonSchema, Action)]
|
||||
#[action(namespace = project_panel)]
|
||||
#[serde(deny_unknown_fields)]
|
||||
|
@ -189,6 +190,7 @@ struct Delete {
|
|||
pub skip_prompt: bool,
|
||||
}
|
||||
|
||||
/// Moves the selected file or directory to the system trash.
|
||||
#[derive(PartialEq, Clone, Default, Debug, Deserialize, JsonSchema, Action)]
|
||||
#[action(namespace = project_panel)]
|
||||
#[serde(deny_unknown_fields)]
|
||||
|
@ -200,32 +202,59 @@ struct Trash {
|
|||
actions!(
|
||||
project_panel,
|
||||
[
|
||||
/// Expands the selected entry in the project tree.
|
||||
ExpandSelectedEntry,
|
||||
/// Collapses the selected entry in the project tree.
|
||||
CollapseSelectedEntry,
|
||||
/// Collapses all entries in the project tree.
|
||||
CollapseAllEntries,
|
||||
/// Creates a new directory.
|
||||
NewDirectory,
|
||||
/// Creates a new file.
|
||||
NewFile,
|
||||
/// Copies the selected file or directory.
|
||||
Copy,
|
||||
/// Duplicates the selected file or directory.
|
||||
Duplicate,
|
||||
/// Reveals the selected item in the system file manager.
|
||||
RevealInFileManager,
|
||||
/// Removes the selected folder from the project.
|
||||
RemoveFromProject,
|
||||
/// Opens the selected file with the system's default application.
|
||||
OpenWithSystem,
|
||||
/// Cuts the selected file or directory.
|
||||
Cut,
|
||||
/// Pastes the previously cut or copied item.
|
||||
Paste,
|
||||
/// Renames the selected file or directory.
|
||||
Rename,
|
||||
/// Opens the selected file in the editor.
|
||||
Open,
|
||||
/// Opens the selected file in a permanent tab.
|
||||
OpenPermanent,
|
||||
/// Toggles focus on the project panel.
|
||||
ToggleFocus,
|
||||
/// Toggles visibility of git-ignored files.
|
||||
ToggleHideGitIgnore,
|
||||
/// Starts a new search in the selected directory.
|
||||
NewSearchInDirectory,
|
||||
/// Unfolds the selected directory.
|
||||
UnfoldDirectory,
|
||||
/// Folds the selected directory.
|
||||
FoldDirectory,
|
||||
/// Selects the parent directory.
|
||||
SelectParent,
|
||||
/// Selects the next entry with git changes.
|
||||
SelectNextGitEntry,
|
||||
/// Selects the previous entry with git changes.
|
||||
SelectPrevGitEntry,
|
||||
/// Selects the next entry with diagnostics.
|
||||
SelectNextDiagnostic,
|
||||
/// Selects the previous entry with diagnostics.
|
||||
SelectPrevDiagnostic,
|
||||
/// Selects the next directory.
|
||||
SelectNextDirectory,
|
||||
/// Selects the previous directory.
|
||||
SelectPrevDirectory,
|
||||
]
|
||||
);
|
||||
|
|
|
@ -28,12 +28,19 @@ use nbformat::v4::Metadata as NotebookMetadata;
|
|||
actions!(
|
||||
notebook,
|
||||
[
|
||||
/// Opens a Jupyter notebook file.
|
||||
OpenNotebook,
|
||||
/// Runs all cells in the notebook.
|
||||
RunAll,
|
||||
/// Clears all cell outputs.
|
||||
ClearOutputs,
|
||||
/// Moves the current cell up.
|
||||
MoveCellUp,
|
||||
/// Moves the current cell down.
|
||||
MoveCellDown,
|
||||
/// Adds a new markdown cell.
|
||||
AddMarkdownBlock,
|
||||
/// Adds a new code cell.
|
||||
AddCodeBlock,
|
||||
]
|
||||
);
|
||||
|
|
|
@ -16,13 +16,21 @@ use crate::repl_store::ReplStore;
|
|||
actions!(
|
||||
repl,
|
||||
[
|
||||
/// Runs the current cell and advances to the next one.
|
||||
Run,
|
||||
/// Runs the current cell without advancing.
|
||||
RunInPlace,
|
||||
/// Clears all outputs in the REPL.
|
||||
ClearOutputs,
|
||||
/// Opens the REPL sessions panel.
|
||||
Sessions,
|
||||
/// Interrupts the currently running kernel.
|
||||
Interrupt,
|
||||
/// Shuts down the current kernel.
|
||||
Shutdown,
|
||||
/// Restarts the current kernel.
|
||||
Restart,
|
||||
/// Refreshes the list of available kernelspecs.
|
||||
RefreshKernelspecs
|
||||
]
|
||||
);
|
||||
|
|
|
@ -37,7 +37,16 @@ pub fn init(cx: &mut App) {
|
|||
|
||||
actions!(
|
||||
rules_library,
|
||||
[NewRule, DeleteRule, DuplicateRule, ToggleDefaultRule]
|
||||
[
|
||||
/// Creates a new rule in the rules library.
|
||||
NewRule,
|
||||
/// Deletes the selected rule.
|
||||
DeleteRule,
|
||||
/// Duplicates the selected rule.
|
||||
DuplicateRule,
|
||||
/// Toggles whether the selected rule is a default rule.
|
||||
ToggleDefaultRule
|
||||
]
|
||||
);
|
||||
|
||||
const BUILT_IN_TOOLTIP_TEXT: &'static str = concat!(
|
||||
|
|
|
@ -46,6 +46,7 @@ use registrar::{ForDeployed, ForDismissed, SearchActionsRegistrar, WithResults};
|
|||
|
||||
const MAX_BUFFER_SEARCH_HISTORY_SIZE: usize = 50;
|
||||
|
||||
/// Opens the buffer search interface with the specified configuration.
|
||||
#[derive(PartialEq, Clone, Deserialize, JsonSchema, Action)]
|
||||
#[action(namespace = buffer_search)]
|
||||
#[serde(deny_unknown_fields)]
|
||||
|
@ -58,7 +59,17 @@ pub struct Deploy {
|
|||
pub selection_search_enabled: bool,
|
||||
}
|
||||
|
||||
actions!(buffer_search, [DeployReplace, Dismiss, FocusEditor]);
|
||||
actions!(
|
||||
buffer_search,
|
||||
[
|
||||
/// Deploys the search and replace interface.
|
||||
DeployReplace,
|
||||
/// Dismisses the search bar.
|
||||
Dismiss,
|
||||
/// Focuses back on the editor.
|
||||
FocusEditor
|
||||
]
|
||||
);
|
||||
|
||||
impl Deploy {
|
||||
pub fn find() -> Self {
|
||||
|
|
|
@ -47,7 +47,16 @@ use workspace::{
|
|||
|
||||
actions!(
|
||||
project_search,
|
||||
[SearchInNew, ToggleFocus, NextField, ToggleFilters]
|
||||
[
|
||||
/// Searches in a new project search tab.
|
||||
SearchInNew,
|
||||
/// Toggles focus between the search bar and the search results.
|
||||
ToggleFocus,
|
||||
/// Moves to the next input field.
|
||||
NextField,
|
||||
/// Toggles the search filters panel.
|
||||
ToggleFilters
|
||||
]
|
||||
);
|
||||
|
||||
#[derive(Default)]
|
||||
|
|
|
@ -23,19 +23,35 @@ pub fn init(cx: &mut App) {
|
|||
actions!(
|
||||
search,
|
||||
[
|
||||
/// Focuses on the search input field.
|
||||
FocusSearch,
|
||||
/// Toggles whole word matching.
|
||||
ToggleWholeWord,
|
||||
/// Toggles case-sensitive search.
|
||||
ToggleCaseSensitive,
|
||||
/// Toggles searching in ignored files.
|
||||
ToggleIncludeIgnored,
|
||||
/// Toggles regular expression mode.
|
||||
ToggleRegex,
|
||||
/// Toggles the replace interface.
|
||||
ToggleReplace,
|
||||
/// Toggles searching within selection only.
|
||||
ToggleSelection,
|
||||
/// Selects the next search match.
|
||||
SelectNextMatch,
|
||||
/// Selects the previous search match.
|
||||
SelectPreviousMatch,
|
||||
/// Selects all search matches.
|
||||
SelectAllMatches,
|
||||
/// Cycles through search modes.
|
||||
CycleMode,
|
||||
/// Navigates to the next query in search history.
|
||||
NextHistoryQuery,
|
||||
/// Navigates to the previous query in search history.
|
||||
PreviousHistoryQuery,
|
||||
/// Replaces all matches.
|
||||
ReplaceAll,
|
||||
/// Replaces the next match.
|
||||
ReplaceNext,
|
||||
]
|
||||
);
|
||||
|
|
|
@ -28,10 +28,26 @@ use crate::{
|
|||
ui_components::table::{Table, TableInteractionState},
|
||||
};
|
||||
|
||||
actions!(zed, [OpenKeymapEditor]);
|
||||
actions!(
|
||||
zed,
|
||||
[
|
||||
/// Opens the keymap editor.
|
||||
OpenKeymapEditor
|
||||
]
|
||||
);
|
||||
|
||||
const KEYMAP_EDITOR_NAMESPACE: &'static str = "keymap_editor";
|
||||
actions!(keymap_editor, [EditBinding, CopyAction, CopyContext]);
|
||||
actions!(
|
||||
keymap_editor,
|
||||
[
|
||||
/// Edits the selected key binding.
|
||||
EditBinding,
|
||||
/// Copies the action name to clipboard.
|
||||
CopyAction,
|
||||
/// Copies the context predicate to clipboard.
|
||||
CopyContext
|
||||
]
|
||||
);
|
||||
|
||||
pub fn init(cx: &mut App) {
|
||||
let keymap_event_channel = KeymapEventChannel::new();
|
||||
|
|
|
@ -29,6 +29,7 @@ impl FeatureFlag for SettingsUiFeatureFlag {
|
|||
const NAME: &'static str = "settings-ui";
|
||||
}
|
||||
|
||||
/// Imports settings from Visual Studio Code.
|
||||
#[derive(Copy, Clone, Debug, Default, PartialEq, Deserialize, JsonSchema, Action)]
|
||||
#[action(namespace = zed)]
|
||||
#[serde(deny_unknown_fields)]
|
||||
|
@ -37,6 +38,7 @@ pub struct ImportVsCodeSettings {
|
|||
pub skip_prompt: bool,
|
||||
}
|
||||
|
||||
/// Imports settings from Cursor editor.
|
||||
#[derive(Copy, Clone, Debug, Default, PartialEq, Deserialize, JsonSchema, Action)]
|
||||
#[action(namespace = zed)]
|
||||
#[serde(deny_unknown_fields)]
|
||||
|
@ -44,7 +46,13 @@ pub struct ImportCursorSettings {
|
|||
#[serde(default)]
|
||||
pub skip_prompt: bool,
|
||||
}
|
||||
actions!(zed, [OpenSettingsEditor]);
|
||||
actions!(
|
||||
zed,
|
||||
[
|
||||
/// Opens the settings editor.
|
||||
OpenSettingsEditor
|
||||
]
|
||||
);
|
||||
|
||||
pub fn init(cx: &mut App) {
|
||||
cx.on_action(|_: &OpenSettingsEditor, cx| {
|
||||
|
|
|
@ -54,7 +54,15 @@ impl From<ScopeFileName> for ScopeName {
|
|||
}
|
||||
}
|
||||
|
||||
actions!(snippets, [ConfigureSnippets, OpenFolder]);
|
||||
actions!(
|
||||
snippets,
|
||||
[
|
||||
/// Opens the snippets configuration file.
|
||||
ConfigureSnippets,
|
||||
/// Opens the snippets folder in the file manager.
|
||||
OpenFolder
|
||||
]
|
||||
);
|
||||
|
||||
pub fn init(cx: &mut App) {
|
||||
cx.observe_new(register).detach();
|
||||
|
|
|
@ -25,7 +25,13 @@ use std::{path::PathBuf, process::Stdio, sync::Arc};
|
|||
use ui::prelude::*;
|
||||
use util::ResultExt;
|
||||
|
||||
actions!(supermaven, [SignOut]);
|
||||
actions!(
|
||||
supermaven,
|
||||
[
|
||||
/// Signs out of Supermaven.
|
||||
SignOut
|
||||
]
|
||||
);
|
||||
|
||||
pub fn init(client: Arc<Client>, cx: &mut App) {
|
||||
let supermaven = cx.new(|_| Supermaven::Starting);
|
||||
|
|
|
@ -5,7 +5,14 @@ pub mod svg_preview_view;
|
|||
|
||||
actions!(
|
||||
svg,
|
||||
[OpenPreview, OpenPreviewToTheSide, OpenFollowingPreview]
|
||||
[
|
||||
/// Opens an SVG preview for the current file.
|
||||
OpenPreview,
|
||||
/// Opens an SVG preview in a split pane.
|
||||
OpenPreviewToTheSide,
|
||||
/// Opens a following SVG preview that syncs with the editor.
|
||||
OpenFollowingPreview
|
||||
]
|
||||
);
|
||||
|
||||
pub fn init(cx: &mut App) {
|
||||
|
|
|
@ -25,6 +25,7 @@ use workspace::{
|
|||
|
||||
const PANEL_WIDTH_REMS: f32 = 28.;
|
||||
|
||||
/// Toggles the tab switcher interface.
|
||||
#[derive(PartialEq, Clone, Deserialize, JsonSchema, Default, Action)]
|
||||
#[action(namespace = tab_switcher)]
|
||||
#[serde(deny_unknown_fields)]
|
||||
|
@ -32,7 +33,15 @@ pub struct Toggle {
|
|||
#[serde(default)]
|
||||
pub select_last: bool,
|
||||
}
|
||||
actions!(tab_switcher, [CloseSelectedItem, ToggleAll]);
|
||||
actions!(
|
||||
tab_switcher,
|
||||
[
|
||||
/// Closes the selected item in the tab switcher.
|
||||
CloseSelectedItem,
|
||||
/// Toggles between showing all tabs or just the current pane's tabs.
|
||||
ToggleAll
|
||||
]
|
||||
);
|
||||
|
||||
pub struct TabSwitcher {
|
||||
picker: Entity<Picker<TabSwitcherDelegate>>,
|
||||
|
|
|
@ -73,18 +73,36 @@ use crate::mappings::{colors::to_alac_rgb, keys::to_esc_str};
|
|||
actions!(
|
||||
terminal,
|
||||
[
|
||||
/// Clears the terminal screen.
|
||||
Clear,
|
||||
/// Copies selected text to the clipboard.
|
||||
Copy,
|
||||
/// Pastes from the clipboard.
|
||||
Paste,
|
||||
/// Shows the character palette for special characters.
|
||||
ShowCharacterPalette,
|
||||
/// Searches for text in the terminal.
|
||||
SearchTest,
|
||||
/// Scrolls up by one line.
|
||||
ScrollLineUp,
|
||||
/// Scrolls down by one line.
|
||||
ScrollLineDown,
|
||||
/// Scrolls up by one page.
|
||||
ScrollPageUp,
|
||||
/// Scrolls down by one page.
|
||||
ScrollPageDown,
|
||||
/// Scrolls up by half a page.
|
||||
ScrollHalfPageUp,
|
||||
/// Scrolls down by half a page.
|
||||
ScrollHalfPageDown,
|
||||
/// Scrolls to the top of the terminal buffer.
|
||||
ScrollToTop,
|
||||
/// Scrolls to the bottom of the terminal buffer.
|
||||
ScrollToBottom,
|
||||
/// Toggles vi mode in the terminal.
|
||||
ToggleViMode,
|
||||
/// Selects all text in the terminal.
|
||||
SelectAll,
|
||||
]
|
||||
);
|
||||
|
||||
|
|
|
@ -46,7 +46,13 @@ use zed_actions::assistant::InlineAssist;
|
|||
|
||||
const TERMINAL_PANEL_KEY: &str = "TerminalPanel";
|
||||
|
||||
actions!(terminal_panel, [ToggleFocus]);
|
||||
actions!(
|
||||
terminal_panel,
|
||||
[
|
||||
/// Toggles focus on the terminal panel.
|
||||
ToggleFocus
|
||||
]
|
||||
);
|
||||
|
||||
pub fn init(cx: &mut App) {
|
||||
cx.observe_new(
|
||||
|
|
|
@ -70,15 +70,23 @@ const GIT_DIFF_PATH_PREFIXES: &[&str] = &["a", "b"];
|
|||
#[derive(Clone, Debug, PartialEq)]
|
||||
pub struct ScrollTerminal(pub i32);
|
||||
|
||||
/// Sends the specified text directly to the terminal.
|
||||
#[derive(Clone, Debug, Default, Deserialize, JsonSchema, PartialEq, Action)]
|
||||
#[action(namespace = terminal)]
|
||||
pub struct SendText(String);
|
||||
|
||||
/// Sends a keystroke sequence to the terminal.
|
||||
#[derive(Clone, Debug, Default, Deserialize, JsonSchema, PartialEq, Action)]
|
||||
#[action(namespace = terminal)]
|
||||
pub struct SendKeystroke(String);
|
||||
|
||||
actions!(terminal, [RerunTask]);
|
||||
actions!(
|
||||
terminal,
|
||||
[
|
||||
/// Reruns the last executed task in the terminal.
|
||||
RerunTask
|
||||
]
|
||||
);
|
||||
|
||||
pub fn init(cx: &mut App) {
|
||||
assistant_slash_command::init(cx);
|
||||
|
|
|
@ -17,7 +17,13 @@ use zed_actions::{ExtensionCategoryFilter, Extensions};
|
|||
|
||||
use crate::icon_theme_selector::{IconThemeSelector, IconThemeSelectorDelegate};
|
||||
|
||||
actions!(theme_selector, [Reload]);
|
||||
actions!(
|
||||
theme_selector,
|
||||
[
|
||||
/// Reloads all themes from disk.
|
||||
Reload
|
||||
]
|
||||
);
|
||||
|
||||
pub fn init(cx: &mut App) {
|
||||
cx.on_action(|action: &zed_actions::theme_selector::Toggle, cx| {
|
||||
|
|
|
@ -12,7 +12,15 @@ use smallvec::SmallVec;
|
|||
use ui::{ContextMenu, PopoverMenu, PopoverMenuHandle, Tooltip, prelude::*};
|
||||
|
||||
#[cfg(not(target_os = "macos"))]
|
||||
actions!(app_menu, [ActivateMenuRight, ActivateMenuLeft]);
|
||||
actions!(
|
||||
app_menu,
|
||||
[
|
||||
/// Navigates to the menu item on the right.
|
||||
ActivateMenuRight,
|
||||
/// Navigates to the menu item on the left.
|
||||
ActivateMenuLeft
|
||||
]
|
||||
);
|
||||
|
||||
#[cfg(not(target_os = "macos"))]
|
||||
#[derive(Clone, Deserialize, JsonSchema, PartialEq, Default, Action)]
|
||||
|
|
|
@ -11,7 +11,17 @@ use workspace::notifications::DetachAndPromptErr;
|
|||
|
||||
use crate::TitleBar;
|
||||
|
||||
actions!(collab, [ToggleScreenSharing, ToggleMute, ToggleDeafen]);
|
||||
actions!(
|
||||
collab,
|
||||
[
|
||||
/// Toggles screen sharing on or off.
|
||||
ToggleScreenSharing,
|
||||
/// Toggles microphone mute.
|
||||
ToggleMute,
|
||||
/// Toggles deafen mode (mute both microphone and speakers).
|
||||
ToggleDeafen
|
||||
]
|
||||
);
|
||||
|
||||
fn toggle_screen_sharing(_: &ToggleScreenSharing, window: &mut Window, cx: &mut App) {
|
||||
let call = ActiveCall::global(cx).read(cx);
|
||||
|
|
|
@ -47,7 +47,17 @@ const MAX_PROJECT_NAME_LENGTH: usize = 40;
|
|||
const MAX_BRANCH_NAME_LENGTH: usize = 40;
|
||||
const MAX_SHORT_SHA_LENGTH: usize = 8;
|
||||
|
||||
actions!(collab, [ToggleUserMenu, ToggleProjectMenu, SwitchBranch]);
|
||||
actions!(
|
||||
collab,
|
||||
[
|
||||
/// Toggles the user menu dropdown.
|
||||
ToggleUserMenu,
|
||||
/// Toggles the project menu dropdown.
|
||||
ToggleProjectMenu,
|
||||
/// Switches to a different git branch.
|
||||
SwitchBranch
|
||||
]
|
||||
);
|
||||
|
||||
pub fn init(cx: &mut App) {
|
||||
TitleBarSettings::register(cx);
|
||||
|
|
|
@ -15,7 +15,13 @@ use ui::{HighlightedLabel, ListItem, ListItemSpacing, prelude::*};
|
|||
use util::ResultExt;
|
||||
use workspace::{ModalView, Workspace};
|
||||
|
||||
actions!(toolchain, [Select]);
|
||||
actions!(
|
||||
toolchain,
|
||||
[
|
||||
/// Selects a toolchain for the current project.
|
||||
Select
|
||||
]
|
||||
);
|
||||
|
||||
pub fn init(cx: &mut App) {
|
||||
cx.observe_new(ToolchainSelector::register).detach();
|
||||
|
|
|
@ -3,7 +3,15 @@ use gpui::{Context, Window, actions};
|
|||
|
||||
use crate::{Vim, state::Mode};
|
||||
|
||||
actions!(vim, [ChangeListOlder, ChangeListNewer]);
|
||||
actions!(
|
||||
vim,
|
||||
[
|
||||
/// Navigates to an older position in the change list.
|
||||
ChangeListOlder,
|
||||
/// Navigates to a newer position in the change list.
|
||||
ChangeListNewer
|
||||
]
|
||||
);
|
||||
|
||||
pub(crate) fn register(editor: &mut Editor, cx: &mut Context<Vim>) {
|
||||
Vim::action(editor, cx, |vim, _: &ChangeListOlder, window, cx| {
|
||||
|
|
|
@ -44,18 +44,21 @@ use crate::{
|
|||
visual::VisualDeleteLine,
|
||||
};
|
||||
|
||||
/// Goes to the specified line number in the editor.
|
||||
#[derive(Clone, Debug, PartialEq, Action)]
|
||||
#[action(namespace = vim, no_json, no_register)]
|
||||
pub struct GoToLine {
|
||||
range: CommandRange,
|
||||
}
|
||||
|
||||
/// Yanks (copies) text based on the specified range.
|
||||
#[derive(Clone, Debug, PartialEq, Action)]
|
||||
#[action(namespace = vim, no_json, no_register)]
|
||||
pub struct YankCommand {
|
||||
range: CommandRange,
|
||||
}
|
||||
|
||||
/// Executes a command with the specified range.
|
||||
#[derive(Clone, Debug, PartialEq, Action)]
|
||||
#[action(namespace = vim, no_json, no_register)]
|
||||
pub struct WithRange {
|
||||
|
@ -64,6 +67,7 @@ pub struct WithRange {
|
|||
action: WrappedAction,
|
||||
}
|
||||
|
||||
/// Executes a command with the specified count.
|
||||
#[derive(Clone, Debug, PartialEq, Action)]
|
||||
#[action(namespace = vim, no_json, no_register)]
|
||||
pub struct WithCount {
|
||||
|
@ -155,12 +159,14 @@ impl VimOption {
|
|||
}
|
||||
}
|
||||
|
||||
/// Sets vim options and configuration values.
|
||||
#[derive(Clone, PartialEq, Action)]
|
||||
#[action(namespace = vim, no_json, no_register)]
|
||||
pub struct VimSet {
|
||||
options: Vec<VimOption>,
|
||||
}
|
||||
|
||||
/// Saves the current file with optional save intent.
|
||||
#[derive(Clone, PartialEq, Action)]
|
||||
#[action(namespace = vim, no_json, no_register)]
|
||||
struct VimSave {
|
||||
|
@ -168,6 +174,7 @@ struct VimSave {
|
|||
pub filename: String,
|
||||
}
|
||||
|
||||
/// Deletes the specified marks from the editor.
|
||||
#[derive(Clone, PartialEq, Action)]
|
||||
#[action(namespace = vim, no_json, no_register)]
|
||||
enum DeleteMarks {
|
||||
|
@ -177,8 +184,18 @@ enum DeleteMarks {
|
|||
|
||||
actions!(
|
||||
vim,
|
||||
[VisualCommand, CountCommand, ShellCommand, ArgumentRequired]
|
||||
[
|
||||
/// Executes a command in visual mode.
|
||||
VisualCommand,
|
||||
/// Executes a command with a count prefix.
|
||||
CountCommand,
|
||||
/// Executes a shell command.
|
||||
ShellCommand,
|
||||
/// Indicates that an argument is required for the command.
|
||||
ArgumentRequired
|
||||
]
|
||||
);
|
||||
/// Opens the specified file for editing.
|
||||
#[derive(Clone, PartialEq, Action)]
|
||||
#[action(namespace = vim, no_json, no_register)]
|
||||
struct VimEdit {
|
||||
|
@ -1282,6 +1299,7 @@ fn generate_positions(string: &str, query: &str) -> Vec<usize> {
|
|||
positions
|
||||
}
|
||||
|
||||
/// Applies a command to all lines matching a pattern.
|
||||
#[derive(Debug, PartialEq, Clone, Action)]
|
||||
#[action(namespace = vim, no_json, no_register)]
|
||||
pub(crate) struct OnMatchingLines {
|
||||
|
@ -1480,6 +1498,7 @@ impl OnMatchingLines {
|
|||
}
|
||||
}
|
||||
|
||||
/// Executes a shell command and returns the output.
|
||||
#[derive(Clone, Debug, PartialEq, Action)]
|
||||
#[action(namespace = vim, no_json, no_register)]
|
||||
pub struct ShellExec {
|
||||
|
|
|
@ -6,7 +6,13 @@ use text::SelectionGoal;
|
|||
|
||||
use crate::{Vim, motion::Motion, state::Mode};
|
||||
|
||||
actions!(vim, [HelixNormalAfter]);
|
||||
actions!(
|
||||
vim,
|
||||
[
|
||||
/// Switches to normal mode after the cursor (Helix-style).
|
||||
HelixNormalAfter
|
||||
]
|
||||
);
|
||||
|
||||
pub fn register(editor: &mut Editor, cx: &mut Context<Vim>) {
|
||||
Vim::action(editor, cx, Vim::helix_normal_after);
|
||||
|
|
|
@ -13,7 +13,17 @@ pub(crate) enum IndentDirection {
|
|||
Auto,
|
||||
}
|
||||
|
||||
actions!(vim, [Indent, Outdent, AutoIndent]);
|
||||
actions!(
|
||||
vim,
|
||||
[
|
||||
/// Increases indentation of selected lines.
|
||||
Indent,
|
||||
/// Decreases indentation of selected lines.
|
||||
Outdent,
|
||||
/// Automatically adjusts indentation based on syntax.
|
||||
AutoIndent
|
||||
]
|
||||
);
|
||||
|
||||
pub(crate) fn register(editor: &mut Editor, cx: &mut Context<Vim>) {
|
||||
Vim::action(editor, cx, |vim, _: &Indent, window, cx| {
|
||||
|
|
|
@ -5,7 +5,15 @@ use language::SelectionGoal;
|
|||
use settings::Settings;
|
||||
use vim_mode_setting::HelixModeSetting;
|
||||
|
||||
actions!(vim, [NormalBefore, TemporaryNormal]);
|
||||
actions!(
|
||||
vim,
|
||||
[
|
||||
/// Switches to normal mode with cursor positioned before the current character.
|
||||
NormalBefore,
|
||||
/// Temporarily switches to normal mode for one command.
|
||||
TemporaryNormal
|
||||
]
|
||||
);
|
||||
|
||||
pub fn register(editor: &mut Editor, cx: &mut Context<Vim>) {
|
||||
Vim::action(editor, cx, Vim::normal_before);
|
||||
|
|
|
@ -176,6 +176,7 @@ enum IndentType {
|
|||
Same,
|
||||
}
|
||||
|
||||
/// Moves to the start of the next word.
|
||||
#[derive(Clone, Deserialize, JsonSchema, PartialEq, Action)]
|
||||
#[action(namespace = vim)]
|
||||
#[serde(deny_unknown_fields)]
|
||||
|
@ -184,6 +185,7 @@ struct NextWordStart {
|
|||
ignore_punctuation: bool,
|
||||
}
|
||||
|
||||
/// Moves to the end of the next word.
|
||||
#[derive(Clone, Deserialize, JsonSchema, PartialEq, Action)]
|
||||
#[action(namespace = vim)]
|
||||
#[serde(deny_unknown_fields)]
|
||||
|
@ -192,6 +194,7 @@ struct NextWordEnd {
|
|||
ignore_punctuation: bool,
|
||||
}
|
||||
|
||||
/// Moves to the start of the previous word.
|
||||
#[derive(Clone, Deserialize, JsonSchema, PartialEq, Action)]
|
||||
#[action(namespace = vim)]
|
||||
#[serde(deny_unknown_fields)]
|
||||
|
@ -200,6 +203,7 @@ struct PreviousWordStart {
|
|||
ignore_punctuation: bool,
|
||||
}
|
||||
|
||||
/// Moves to the end of the previous word.
|
||||
#[derive(Clone, Deserialize, JsonSchema, PartialEq, Action)]
|
||||
#[action(namespace = vim)]
|
||||
#[serde(deny_unknown_fields)]
|
||||
|
@ -208,6 +212,7 @@ struct PreviousWordEnd {
|
|||
ignore_punctuation: bool,
|
||||
}
|
||||
|
||||
/// Moves to the start of the next subword.
|
||||
#[derive(Clone, Deserialize, JsonSchema, PartialEq, Action)]
|
||||
#[action(namespace = vim)]
|
||||
#[serde(deny_unknown_fields)]
|
||||
|
@ -216,6 +221,7 @@ pub(crate) struct NextSubwordStart {
|
|||
pub(crate) ignore_punctuation: bool,
|
||||
}
|
||||
|
||||
/// Moves to the end of the next subword.
|
||||
#[derive(Clone, Deserialize, JsonSchema, PartialEq, Action)]
|
||||
#[action(namespace = vim)]
|
||||
#[serde(deny_unknown_fields)]
|
||||
|
@ -224,6 +230,7 @@ pub(crate) struct NextSubwordEnd {
|
|||
pub(crate) ignore_punctuation: bool,
|
||||
}
|
||||
|
||||
/// Moves to the start of the previous subword.
|
||||
#[derive(Clone, Deserialize, JsonSchema, PartialEq, Action)]
|
||||
#[action(namespace = vim)]
|
||||
#[serde(deny_unknown_fields)]
|
||||
|
@ -232,6 +239,7 @@ pub(crate) struct PreviousSubwordStart {
|
|||
pub(crate) ignore_punctuation: bool,
|
||||
}
|
||||
|
||||
/// Moves to the end of the previous subword.
|
||||
#[derive(Clone, Deserialize, JsonSchema, PartialEq, Action)]
|
||||
#[action(namespace = vim)]
|
||||
#[serde(deny_unknown_fields)]
|
||||
|
@ -240,6 +248,7 @@ pub(crate) struct PreviousSubwordEnd {
|
|||
pub(crate) ignore_punctuation: bool,
|
||||
}
|
||||
|
||||
/// Moves cursor up by the specified number of lines.
|
||||
#[derive(Clone, Deserialize, JsonSchema, PartialEq, Action)]
|
||||
#[action(namespace = vim)]
|
||||
#[serde(deny_unknown_fields)]
|
||||
|
@ -248,6 +257,7 @@ pub(crate) struct Up {
|
|||
pub(crate) display_lines: bool,
|
||||
}
|
||||
|
||||
/// Moves cursor down by the specified number of lines.
|
||||
#[derive(Clone, Deserialize, JsonSchema, PartialEq, Action)]
|
||||
#[action(namespace = vim)]
|
||||
#[serde(deny_unknown_fields)]
|
||||
|
@ -256,6 +266,7 @@ pub(crate) struct Down {
|
|||
pub(crate) display_lines: bool,
|
||||
}
|
||||
|
||||
/// Moves to the first non-whitespace character on the current line.
|
||||
#[derive(Clone, Deserialize, JsonSchema, PartialEq, Action)]
|
||||
#[action(namespace = vim)]
|
||||
#[serde(deny_unknown_fields)]
|
||||
|
@ -264,6 +275,7 @@ struct FirstNonWhitespace {
|
|||
display_lines: bool,
|
||||
}
|
||||
|
||||
/// Moves to the end of the current line.
|
||||
#[derive(Clone, Deserialize, JsonSchema, PartialEq, Action)]
|
||||
#[action(namespace = vim)]
|
||||
#[serde(deny_unknown_fields)]
|
||||
|
@ -272,6 +284,7 @@ struct EndOfLine {
|
|||
display_lines: bool,
|
||||
}
|
||||
|
||||
/// Moves to the start of the current line.
|
||||
#[derive(Clone, Deserialize, JsonSchema, PartialEq, Action)]
|
||||
#[action(namespace = vim)]
|
||||
#[serde(deny_unknown_fields)]
|
||||
|
@ -280,6 +293,7 @@ pub struct StartOfLine {
|
|||
pub(crate) display_lines: bool,
|
||||
}
|
||||
|
||||
/// Moves to the middle of the current line.
|
||||
#[derive(Clone, Deserialize, JsonSchema, PartialEq, Action)]
|
||||
#[action(namespace = vim)]
|
||||
#[serde(deny_unknown_fields)]
|
||||
|
@ -288,6 +302,7 @@ struct MiddleOfLine {
|
|||
display_lines: bool,
|
||||
}
|
||||
|
||||
/// Finds the next unmatched bracket or delimiter.
|
||||
#[derive(Clone, Deserialize, JsonSchema, PartialEq, Action)]
|
||||
#[action(namespace = vim)]
|
||||
#[serde(deny_unknown_fields)]
|
||||
|
@ -296,6 +311,7 @@ struct UnmatchedForward {
|
|||
char: char,
|
||||
}
|
||||
|
||||
/// Finds the previous unmatched bracket or delimiter.
|
||||
#[derive(Clone, Deserialize, JsonSchema, PartialEq, Action)]
|
||||
#[action(namespace = vim)]
|
||||
#[serde(deny_unknown_fields)]
|
||||
|
@ -307,46 +323,85 @@ struct UnmatchedBackward {
|
|||
actions!(
|
||||
vim,
|
||||
[
|
||||
/// Moves cursor left one character.
|
||||
Left,
|
||||
/// Moves cursor left one character, wrapping to previous line.
|
||||
#[action(deprecated_aliases = ["vim::Backspace"])]
|
||||
WrappingLeft,
|
||||
/// Moves cursor right one character.
|
||||
Right,
|
||||
/// Moves cursor right one character, wrapping to next line.
|
||||
#[action(deprecated_aliases = ["vim::Space"])]
|
||||
WrappingRight,
|
||||
/// Selects the current line.
|
||||
CurrentLine,
|
||||
/// Moves to the start of the next sentence.
|
||||
SentenceForward,
|
||||
/// Moves to the start of the previous sentence.
|
||||
SentenceBackward,
|
||||
/// Moves to the start of the paragraph.
|
||||
StartOfParagraph,
|
||||
/// Moves to the end of the paragraph.
|
||||
EndOfParagraph,
|
||||
/// Moves to the start of the document.
|
||||
StartOfDocument,
|
||||
/// Moves to the end of the document.
|
||||
EndOfDocument,
|
||||
/// Moves to the matching bracket or delimiter.
|
||||
Matching,
|
||||
/// Goes to a percentage position in the file.
|
||||
GoToPercentage,
|
||||
/// Moves to the start of the next line.
|
||||
NextLineStart,
|
||||
/// Moves to the start of the previous line.
|
||||
PreviousLineStart,
|
||||
/// Moves to the start of a line downward.
|
||||
StartOfLineDownward,
|
||||
/// Moves to the end of a line downward.
|
||||
EndOfLineDownward,
|
||||
/// Goes to a specific column number.
|
||||
GoToColumn,
|
||||
/// Repeats the last character find.
|
||||
RepeatFind,
|
||||
/// Repeats the last character find in reverse.
|
||||
RepeatFindReversed,
|
||||
/// Moves to the top of the window.
|
||||
WindowTop,
|
||||
/// Moves to the middle of the window.
|
||||
WindowMiddle,
|
||||
/// Moves to the bottom of the window.
|
||||
WindowBottom,
|
||||
/// Moves to the start of the next section.
|
||||
NextSectionStart,
|
||||
/// Moves to the end of the next section.
|
||||
NextSectionEnd,
|
||||
/// Moves to the start of the previous section.
|
||||
PreviousSectionStart,
|
||||
/// Moves to the end of the previous section.
|
||||
PreviousSectionEnd,
|
||||
/// Moves to the start of the next method.
|
||||
NextMethodStart,
|
||||
/// Moves to the end of the next method.
|
||||
NextMethodEnd,
|
||||
/// Moves to the start of the previous method.
|
||||
PreviousMethodStart,
|
||||
/// Moves to the end of the previous method.
|
||||
PreviousMethodEnd,
|
||||
/// Moves to the next comment.
|
||||
NextComment,
|
||||
/// Moves to the previous comment.
|
||||
PreviousComment,
|
||||
/// Moves to the previous line with lesser indentation.
|
||||
PreviousLesserIndent,
|
||||
/// Moves to the previous line with greater indentation.
|
||||
PreviousGreaterIndent,
|
||||
/// Moves to the previous line with the same indentation.
|
||||
PreviousSameIndent,
|
||||
/// Moves to the next line with lesser indentation.
|
||||
NextLesserIndent,
|
||||
/// Moves to the next line with greater indentation.
|
||||
NextGreaterIndent,
|
||||
/// Moves to the next line with the same indentation.
|
||||
NextSameIndent,
|
||||
]
|
||||
);
|
||||
|
|
|
@ -36,32 +36,59 @@ use multi_buffer::MultiBufferRow;
|
|||
actions!(
|
||||
vim,
|
||||
[
|
||||
/// Inserts text after the cursor.
|
||||
InsertAfter,
|
||||
/// Inserts text before the cursor.
|
||||
InsertBefore,
|
||||
/// Inserts at the first non-whitespace character.
|
||||
InsertFirstNonWhitespace,
|
||||
/// Inserts at the end of the line.
|
||||
InsertEndOfLine,
|
||||
/// Inserts a new line above the current line.
|
||||
InsertLineAbove,
|
||||
/// Inserts a new line below the current line.
|
||||
InsertLineBelow,
|
||||
/// Inserts an empty line above without entering insert mode.
|
||||
InsertEmptyLineAbove,
|
||||
/// Inserts an empty line below without entering insert mode.
|
||||
InsertEmptyLineBelow,
|
||||
/// Inserts at the previous insert position.
|
||||
InsertAtPrevious,
|
||||
/// Joins the current line with the next line.
|
||||
JoinLines,
|
||||
/// Joins lines without adding whitespace.
|
||||
JoinLinesNoWhitespace,
|
||||
/// Deletes character to the left.
|
||||
DeleteLeft,
|
||||
/// Deletes character to the right.
|
||||
DeleteRight,
|
||||
/// Deletes using Helix-style behavior.
|
||||
HelixDelete,
|
||||
/// Changes from cursor to end of line.
|
||||
ChangeToEndOfLine,
|
||||
/// Deletes from cursor to end of line.
|
||||
DeleteToEndOfLine,
|
||||
/// Yanks (copies) the selected text.
|
||||
Yank,
|
||||
/// Yanks the entire line.
|
||||
YankLine,
|
||||
/// Toggles the case of selected text.
|
||||
ChangeCase,
|
||||
/// Converts selected text to uppercase.
|
||||
ConvertToUpperCase,
|
||||
/// Converts selected text to lowercase.
|
||||
ConvertToLowerCase,
|
||||
/// Applies ROT13 cipher to selected text.
|
||||
ConvertToRot13,
|
||||
/// Applies ROT47 cipher to selected text.
|
||||
ConvertToRot47,
|
||||
/// Toggles comments for selected lines.
|
||||
ToggleComments,
|
||||
/// Shows the current location in the file.
|
||||
ShowLocation,
|
||||
/// Undoes the last change.
|
||||
Undo,
|
||||
/// Redoes the last undone change.
|
||||
Redo,
|
||||
]
|
||||
);
|
||||
|
|
|
@ -9,6 +9,7 @@ use crate::{Vim, state::Mode};
|
|||
|
||||
const BOOLEAN_PAIRS: &[(&str, &str)] = &[("true", "false"), ("yes", "no"), ("on", "off")];
|
||||
|
||||
/// Increments the number under the cursor or toggles boolean values.
|
||||
#[derive(Clone, Deserialize, JsonSchema, PartialEq, Action)]
|
||||
#[action(namespace = vim)]
|
||||
#[serde(deny_unknown_fields)]
|
||||
|
@ -17,6 +18,7 @@ struct Increment {
|
|||
step: bool,
|
||||
}
|
||||
|
||||
/// Decrements the number under the cursor or toggles boolean values.
|
||||
#[derive(Clone, Deserialize, JsonSchema, PartialEq, Action)]
|
||||
#[action(namespace = vim)]
|
||||
#[serde(deny_unknown_fields)]
|
||||
|
|
|
@ -14,6 +14,7 @@ use crate::{
|
|||
state::{Mode, Register},
|
||||
};
|
||||
|
||||
/// Pastes text from the specified register at the cursor position.
|
||||
#[derive(Clone, Deserialize, JsonSchema, PartialEq, Action)]
|
||||
#[action(namespace = vim)]
|
||||
#[serde(deny_unknown_fields)]
|
||||
|
|
|
@ -11,7 +11,19 @@ use editor::Editor;
|
|||
use gpui::{Action, App, Context, Window, actions};
|
||||
use workspace::Workspace;
|
||||
|
||||
actions!(vim, [Repeat, EndRepeat, ToggleRecord, ReplayLastRecording]);
|
||||
actions!(
|
||||
vim,
|
||||
[
|
||||
/// Repeats the last change.
|
||||
Repeat,
|
||||
/// Ends the repeat recording.
|
||||
EndRepeat,
|
||||
/// Toggles macro recording.
|
||||
ToggleRecord,
|
||||
/// Replays the last recorded macro.
|
||||
ReplayLastRecording
|
||||
]
|
||||
);
|
||||
|
||||
fn should_replay(action: &dyn Action) -> bool {
|
||||
// skip so that we don't leave the character palette open
|
||||
|
|
|
@ -11,13 +11,21 @@ use settings::Settings;
|
|||
actions!(
|
||||
vim,
|
||||
[
|
||||
/// Scrolls up by one line.
|
||||
LineUp,
|
||||
/// Scrolls down by one line.
|
||||
LineDown,
|
||||
/// Scrolls right by one column.
|
||||
ColumnRight,
|
||||
/// Scrolls left by one column.
|
||||
ColumnLeft,
|
||||
/// Scrolls up by half a page.
|
||||
ScrollUp,
|
||||
/// Scrolls down by half a page.
|
||||
ScrollDown,
|
||||
/// Scrolls up by one page.
|
||||
PageUp,
|
||||
/// Scrolls down by one page.
|
||||
PageDown
|
||||
]
|
||||
);
|
||||
|
|
|
@ -16,6 +16,7 @@ use crate::{
|
|||
state::{Mode, SearchState},
|
||||
};
|
||||
|
||||
/// Moves to the next search match.
|
||||
#[derive(Clone, Debug, Deserialize, JsonSchema, PartialEq, Action)]
|
||||
#[action(namespace = vim)]
|
||||
#[serde(deny_unknown_fields)]
|
||||
|
@ -28,6 +29,7 @@ pub(crate) struct MoveToNext {
|
|||
regex: bool,
|
||||
}
|
||||
|
||||
/// Moves to the previous search match.
|
||||
#[derive(Clone, Debug, Deserialize, JsonSchema, PartialEq, Action)]
|
||||
#[action(namespace = vim)]
|
||||
#[serde(deny_unknown_fields)]
|
||||
|
@ -40,6 +42,7 @@ pub(crate) struct MoveToPrevious {
|
|||
regex: bool,
|
||||
}
|
||||
|
||||
/// Initiates a search operation with the specified parameters.
|
||||
#[derive(Clone, Debug, Deserialize, JsonSchema, PartialEq, Action)]
|
||||
#[action(namespace = vim)]
|
||||
#[serde(deny_unknown_fields)]
|
||||
|
@ -50,6 +53,7 @@ pub(crate) struct Search {
|
|||
regex: bool,
|
||||
}
|
||||
|
||||
/// Executes a find command to search for patterns in the buffer.
|
||||
#[derive(Clone, Debug, Deserialize, JsonSchema, PartialEq, Action)]
|
||||
#[action(namespace = vim)]
|
||||
#[serde(deny_unknown_fields)]
|
||||
|
@ -58,6 +62,7 @@ pub struct FindCommand {
|
|||
pub backwards: bool,
|
||||
}
|
||||
|
||||
/// Executes a search and replace command within the specified range.
|
||||
#[derive(Clone, Debug, PartialEq, Action)]
|
||||
#[action(namespace = vim, no_json, no_register)]
|
||||
pub struct ReplaceCommand {
|
||||
|
@ -73,7 +78,17 @@ pub(crate) struct Replacement {
|
|||
is_case_sensitive: bool,
|
||||
}
|
||||
|
||||
actions!(vim, [SearchSubmit, MoveToNextMatch, MoveToPreviousMatch]);
|
||||
actions!(
|
||||
vim,
|
||||
[
|
||||
/// Submits the current search query.
|
||||
SearchSubmit,
|
||||
/// Moves to the next search match.
|
||||
MoveToNextMatch,
|
||||
/// Moves to the previous search match.
|
||||
MoveToPreviousMatch
|
||||
]
|
||||
);
|
||||
|
||||
pub(crate) fn register(editor: &mut Editor, cx: &mut Context<Vim>) {
|
||||
Vim::action(editor, cx, Vim::move_to_next);
|
||||
|
|
|
@ -7,7 +7,15 @@ use crate::{
|
|||
motion::{Motion, MotionKind},
|
||||
};
|
||||
|
||||
actions!(vim, [Substitute, SubstituteLine]);
|
||||
actions!(
|
||||
vim,
|
||||
[
|
||||
/// Substitutes characters in the current selection.
|
||||
Substitute,
|
||||
/// Substitutes the entire line.
|
||||
SubstituteLine
|
||||
]
|
||||
);
|
||||
|
||||
pub(crate) fn register(editor: &mut Editor, cx: &mut Context<Vim>) {
|
||||
Vim::action(editor, cx, |vim, _: &Substitute, window, cx| {
|
||||
|
|
|
@ -46,6 +46,7 @@ pub enum Object {
|
|||
EntireFile,
|
||||
}
|
||||
|
||||
/// Selects a word text object.
|
||||
#[derive(Clone, Deserialize, JsonSchema, PartialEq, Action)]
|
||||
#[action(namespace = vim)]
|
||||
#[serde(deny_unknown_fields)]
|
||||
|
@ -54,6 +55,7 @@ struct Word {
|
|||
ignore_punctuation: bool,
|
||||
}
|
||||
|
||||
/// Selects a subword text object.
|
||||
#[derive(Clone, Deserialize, JsonSchema, PartialEq, Action)]
|
||||
#[action(namespace = vim)]
|
||||
#[serde(deny_unknown_fields)]
|
||||
|
@ -61,6 +63,7 @@ struct Subword {
|
|||
#[serde(default)]
|
||||
ignore_punctuation: bool,
|
||||
}
|
||||
/// Selects text at the same indentation level.
|
||||
#[derive(Clone, Deserialize, JsonSchema, PartialEq, Action)]
|
||||
#[action(namespace = vim)]
|
||||
#[serde(deny_unknown_fields)]
|
||||
|
@ -258,25 +261,45 @@ fn find_mini_brackets(
|
|||
actions!(
|
||||
vim,
|
||||
[
|
||||
/// Selects a sentence text object.
|
||||
Sentence,
|
||||
/// Selects a paragraph text object.
|
||||
Paragraph,
|
||||
/// Selects text within single quotes.
|
||||
Quotes,
|
||||
/// Selects text within backticks.
|
||||
BackQuotes,
|
||||
/// Selects text within the nearest quotes (single or double).
|
||||
MiniQuotes,
|
||||
/// Selects text within any type of quotes.
|
||||
AnyQuotes,
|
||||
/// Selects text within double quotes.
|
||||
DoubleQuotes,
|
||||
/// Selects text within vertical bars (pipes).
|
||||
VerticalBars,
|
||||
/// Selects text within parentheses.
|
||||
Parentheses,
|
||||
/// Selects text within the nearest brackets.
|
||||
MiniBrackets,
|
||||
/// Selects text within any type of brackets.
|
||||
AnyBrackets,
|
||||
/// Selects text within square brackets.
|
||||
SquareBrackets,
|
||||
/// Selects text within curly brackets.
|
||||
CurlyBrackets,
|
||||
/// Selects text within angle brackets.
|
||||
AngleBrackets,
|
||||
/// Selects a function argument.
|
||||
Argument,
|
||||
/// Selects an HTML/XML tag.
|
||||
Tag,
|
||||
/// Selects a method or function.
|
||||
Method,
|
||||
/// Selects a class definition.
|
||||
Class,
|
||||
/// Selects a comment block.
|
||||
Comment,
|
||||
/// Selects the entire file.
|
||||
EntireFile
|
||||
]
|
||||
);
|
||||
|
|
|
@ -13,7 +13,15 @@ use language::{Point, SelectionGoal};
|
|||
use std::ops::Range;
|
||||
use std::sync::Arc;
|
||||
|
||||
actions!(vim, [ToggleReplace, UndoReplace]);
|
||||
actions!(
|
||||
vim,
|
||||
[
|
||||
/// Toggles replace mode.
|
||||
ToggleReplace,
|
||||
/// Undoes the last replacement.
|
||||
UndoReplace
|
||||
]
|
||||
);
|
||||
|
||||
pub fn register(editor: &mut Editor, cx: &mut Context<Vim>) {
|
||||
Vim::action(editor, cx, |vim, _: &ToggleReplace, window, cx| {
|
||||
|
|
|
@ -4,7 +4,13 @@ use editor::{Bias, Editor, RewrapOptions, SelectionEffects, display_map::ToDispl
|
|||
use gpui::{Context, Window, actions};
|
||||
use language::SelectionGoal;
|
||||
|
||||
actions!(vim, [Rewrap]);
|
||||
actions!(
|
||||
vim,
|
||||
[
|
||||
/// Rewraps the selected text to fit within the line width.
|
||||
Rewrap
|
||||
]
|
||||
);
|
||||
|
||||
pub(crate) fn register(editor: &mut Editor, cx: &mut Context<Vim>) {
|
||||
Vim::action(editor, cx, |vim, _: &Rewrap, window, cx| {
|
||||
|
|
|
@ -134,55 +134,105 @@ struct PushLiteral {
|
|||
actions!(
|
||||
vim,
|
||||
[
|
||||
/// Switches to normal mode.
|
||||
SwitchToNormalMode,
|
||||
/// Switches to insert mode.
|
||||
SwitchToInsertMode,
|
||||
/// Switches to replace mode.
|
||||
SwitchToReplaceMode,
|
||||
/// Switches to visual mode.
|
||||
SwitchToVisualMode,
|
||||
/// Switches to visual line mode.
|
||||
SwitchToVisualLineMode,
|
||||
/// Switches to visual block mode.
|
||||
SwitchToVisualBlockMode,
|
||||
/// Switches to Helix-style normal mode.
|
||||
SwitchToHelixNormalMode,
|
||||
/// Clears any pending operators.
|
||||
ClearOperators,
|
||||
/// Clears the exchange register.
|
||||
ClearExchange,
|
||||
/// Inserts a tab character.
|
||||
Tab,
|
||||
/// Inserts a newline.
|
||||
Enter,
|
||||
/// Selects inner text object.
|
||||
InnerObject,
|
||||
/// Maximizes the current pane.
|
||||
MaximizePane,
|
||||
/// Opens the default keymap file.
|
||||
OpenDefaultKeymap,
|
||||
/// Resets all pane sizes to default.
|
||||
ResetPaneSizes,
|
||||
/// Resizes the pane to the right.
|
||||
ResizePaneRight,
|
||||
/// Resizes the pane to the left.
|
||||
ResizePaneLeft,
|
||||
/// Resizes the pane upward.
|
||||
ResizePaneUp,
|
||||
/// Resizes the pane downward.
|
||||
ResizePaneDown,
|
||||
/// Starts a change operation.
|
||||
PushChange,
|
||||
/// Starts a delete operation.
|
||||
PushDelete,
|
||||
/// Exchanges text regions.
|
||||
Exchange,
|
||||
/// Starts a yank operation.
|
||||
PushYank,
|
||||
/// Starts a replace operation.
|
||||
PushReplace,
|
||||
/// Deletes surrounding characters.
|
||||
PushDeleteSurrounds,
|
||||
/// Sets a mark at the current position.
|
||||
PushMark,
|
||||
/// Toggles the marks view.
|
||||
ToggleMarksView,
|
||||
/// Starts a forced motion.
|
||||
PushForcedMotion,
|
||||
/// Starts an indent operation.
|
||||
PushIndent,
|
||||
/// Starts an outdent operation.
|
||||
PushOutdent,
|
||||
/// Starts an auto-indent operation.
|
||||
PushAutoIndent,
|
||||
/// Starts a rewrap operation.
|
||||
PushRewrap,
|
||||
/// Starts a shell command operation.
|
||||
PushShellCommand,
|
||||
/// Converts to lowercase.
|
||||
PushLowercase,
|
||||
/// Converts to uppercase.
|
||||
PushUppercase,
|
||||
/// Toggles case.
|
||||
PushOppositeCase,
|
||||
/// Applies ROT13 encoding.
|
||||
PushRot13,
|
||||
/// Applies ROT47 encoding.
|
||||
PushRot47,
|
||||
/// Toggles the registers view.
|
||||
ToggleRegistersView,
|
||||
/// Selects a register.
|
||||
PushRegister,
|
||||
/// Starts recording to a register.
|
||||
PushRecordRegister,
|
||||
/// Replays a register.
|
||||
PushReplayRegister,
|
||||
/// Replaces with register contents.
|
||||
PushReplaceWithRegister,
|
||||
/// Toggles comments.
|
||||
PushToggleComments,
|
||||
]
|
||||
);
|
||||
|
||||
// in the workspace namespace so it's not filtered out when vim is disabled.
|
||||
actions!(workspace, [ToggleVimMode,]);
|
||||
actions!(
|
||||
workspace,
|
||||
[
|
||||
/// Toggles Vim mode on or off.
|
||||
ToggleVimMode,
|
||||
]
|
||||
);
|
||||
|
||||
/// Initializes the `vim` crate.
|
||||
pub fn init(cx: &mut App) {
|
||||
|
|
|
@ -23,23 +23,41 @@ use crate::{
|
|||
actions!(
|
||||
vim,
|
||||
[
|
||||
/// Toggles visual mode.
|
||||
ToggleVisual,
|
||||
/// Toggles visual line mode.
|
||||
ToggleVisualLine,
|
||||
/// Toggles visual block mode.
|
||||
ToggleVisualBlock,
|
||||
/// Deletes the visual selection.
|
||||
VisualDelete,
|
||||
/// Deletes entire lines in visual selection.
|
||||
VisualDeleteLine,
|
||||
/// Yanks (copies) the visual selection.
|
||||
VisualYank,
|
||||
/// Yanks entire lines in visual selection.
|
||||
VisualYankLine,
|
||||
/// Moves cursor to the other end of the selection.
|
||||
OtherEnd,
|
||||
/// Moves cursor to the other end of the selection (row-aware).
|
||||
OtherEndRowAware,
|
||||
/// Selects the next occurrence of the current selection.
|
||||
SelectNext,
|
||||
/// Selects the previous occurrence of the current selection.
|
||||
SelectPrevious,
|
||||
/// Selects the next match of the current selection.
|
||||
SelectNextMatch,
|
||||
/// Selects the previous match of the current selection.
|
||||
SelectPreviousMatch,
|
||||
/// Selects the next smaller syntax node.
|
||||
SelectSmallerSyntaxNode,
|
||||
/// Selects the next larger syntax node.
|
||||
SelectLargerSyntaxNode,
|
||||
/// Restores the previous visual selection.
|
||||
RestoreVisualSelection,
|
||||
/// Inserts at the end of each line in visual selection.
|
||||
VisualInsertEndOfLine,
|
||||
/// Inserts at the first non-whitespace character of each line.
|
||||
VisualInsertFirstNonWhiteSpace,
|
||||
]
|
||||
);
|
||||
|
|
|
@ -12,7 +12,13 @@ use ui::{ListItem, ListItemSpacing, prelude::*};
|
|||
use util::ResultExt;
|
||||
use workspace::{ModalView, Workspace, ui::HighlightedLabel};
|
||||
|
||||
actions!(welcome, [ToggleBaseKeymapSelector]);
|
||||
actions!(
|
||||
welcome,
|
||||
[
|
||||
/// Toggles the base keymap selector modal.
|
||||
ToggleBaseKeymapSelector
|
||||
]
|
||||
);
|
||||
|
||||
pub fn init(cx: &mut App) {
|
||||
cx.observe_new(|workspace: &mut Workspace, _window, _cx| {
|
||||
|
|
|
@ -25,7 +25,13 @@ mod base_keymap_setting;
|
|||
mod multibuffer_hint;
|
||||
mod welcome_ui;
|
||||
|
||||
actions!(welcome, [ResetHints]);
|
||||
actions!(
|
||||
welcome,
|
||||
[
|
||||
/// Resets the welcome screen hints to their initial state.
|
||||
ResetHints
|
||||
]
|
||||
);
|
||||
|
||||
pub const FIRST_OPEN: &str = "first_open";
|
||||
pub const DOCS_URL: &str = "https://zed.dev/docs/";
|
||||
|
|
|
@ -95,10 +95,12 @@ pub enum SaveIntent {
|
|||
Skip,
|
||||
}
|
||||
|
||||
/// Activates a specific item in the pane by its index.
|
||||
#[derive(Clone, PartialEq, Debug, Deserialize, JsonSchema, Default, Action)]
|
||||
#[action(namespace = pane)]
|
||||
pub struct ActivateItem(pub usize);
|
||||
|
||||
/// Closes the currently active item in the pane.
|
||||
#[derive(Clone, PartialEq, Debug, Deserialize, JsonSchema, Default, Action)]
|
||||
#[action(namespace = pane)]
|
||||
#[serde(deny_unknown_fields)]
|
||||
|
@ -109,6 +111,7 @@ pub struct CloseActiveItem {
|
|||
pub close_pinned: bool,
|
||||
}
|
||||
|
||||
/// Closes all inactive items in the pane.
|
||||
#[derive(Clone, PartialEq, Debug, Deserialize, JsonSchema, Default, Action)]
|
||||
#[action(namespace = pane)]
|
||||
#[serde(deny_unknown_fields)]
|
||||
|
@ -119,6 +122,7 @@ pub struct CloseInactiveItems {
|
|||
pub close_pinned: bool,
|
||||
}
|
||||
|
||||
/// Closes all items in the pane.
|
||||
#[derive(Clone, PartialEq, Debug, Deserialize, JsonSchema, Default, Action)]
|
||||
#[action(namespace = pane)]
|
||||
#[serde(deny_unknown_fields)]
|
||||
|
@ -129,6 +133,7 @@ pub struct CloseAllItems {
|
|||
pub close_pinned: bool,
|
||||
}
|
||||
|
||||
/// Closes all items that have no unsaved changes.
|
||||
#[derive(Clone, PartialEq, Debug, Deserialize, JsonSchema, Default, Action)]
|
||||
#[action(namespace = pane)]
|
||||
#[serde(deny_unknown_fields)]
|
||||
|
@ -137,6 +142,7 @@ pub struct CloseCleanItems {
|
|||
pub close_pinned: bool,
|
||||
}
|
||||
|
||||
/// Closes all items to the right of the current item.
|
||||
#[derive(Clone, PartialEq, Debug, Deserialize, JsonSchema, Default, Action)]
|
||||
#[action(namespace = pane)]
|
||||
#[serde(deny_unknown_fields)]
|
||||
|
@ -145,6 +151,7 @@ pub struct CloseItemsToTheRight {
|
|||
pub close_pinned: bool,
|
||||
}
|
||||
|
||||
/// Closes all items to the left of the current item.
|
||||
#[derive(Clone, PartialEq, Debug, Deserialize, JsonSchema, Default, Action)]
|
||||
#[action(namespace = pane)]
|
||||
#[serde(deny_unknown_fields)]
|
||||
|
@ -153,6 +160,7 @@ pub struct CloseItemsToTheLeft {
|
|||
pub close_pinned: bool,
|
||||
}
|
||||
|
||||
/// Reveals the current item in the project panel.
|
||||
#[derive(Clone, PartialEq, Debug, Deserialize, JsonSchema, Default, Action)]
|
||||
#[action(namespace = pane)]
|
||||
#[serde(deny_unknown_fields)]
|
||||
|
@ -161,6 +169,7 @@ pub struct RevealInProjectPanel {
|
|||
pub entry_id: Option<u64>,
|
||||
}
|
||||
|
||||
/// Opens the search interface with the specified configuration.
|
||||
#[derive(Clone, PartialEq, Debug, Deserialize, JsonSchema, Default, Action)]
|
||||
#[action(namespace = pane)]
|
||||
#[serde(deny_unknown_fields)]
|
||||
|
@ -176,25 +185,45 @@ pub struct DeploySearch {
|
|||
actions!(
|
||||
pane,
|
||||
[
|
||||
/// Activates the previous item in the pane.
|
||||
ActivatePreviousItem,
|
||||
/// Activates the next item in the pane.
|
||||
ActivateNextItem,
|
||||
/// Activates the last item in the pane.
|
||||
ActivateLastItem,
|
||||
/// Switches to the alternate file.
|
||||
AlternateFile,
|
||||
/// Navigates back in history.
|
||||
GoBack,
|
||||
/// Navigates forward in history.
|
||||
GoForward,
|
||||
/// Joins this pane into the next pane.
|
||||
JoinIntoNext,
|
||||
/// Joins all panes into one.
|
||||
JoinAll,
|
||||
/// Reopens the most recently closed item.
|
||||
ReopenClosedItem,
|
||||
/// Splits the pane to the left.
|
||||
SplitLeft,
|
||||
/// Splits the pane upward.
|
||||
SplitUp,
|
||||
/// Splits the pane to the right.
|
||||
SplitRight,
|
||||
/// Splits the pane downward.
|
||||
SplitDown,
|
||||
/// Splits the pane horizontally.
|
||||
SplitHorizontal,
|
||||
/// Splits the pane vertically.
|
||||
SplitVertical,
|
||||
/// Swaps the current item with the one to the left.
|
||||
SwapItemLeft,
|
||||
/// Swaps the current item with the one to the right.
|
||||
SwapItemRight,
|
||||
/// Toggles preview mode for the current tab.
|
||||
TogglePreviewTab,
|
||||
/// Toggles pin status for the current tab.
|
||||
TogglePinTab,
|
||||
/// Unpins all tabs in the pane.
|
||||
UnpinAllTabs,
|
||||
]
|
||||
);
|
||||
|
|
|
@ -11,7 +11,13 @@ use ui::{
|
|||
|
||||
use crate::{Item, Workspace};
|
||||
|
||||
actions!(dev, [OpenThemePreview]);
|
||||
actions!(
|
||||
dev,
|
||||
[
|
||||
/// Opens the theme preview window.
|
||||
OpenThemePreview
|
||||
]
|
||||
);
|
||||
|
||||
pub fn init(cx: &mut App) {
|
||||
cx.observe_new(|workspace: &mut Workspace, _, _| {
|
||||
|
|
|
@ -169,44 +169,83 @@ pub trait DebuggerProvider {
|
|||
actions!(
|
||||
workspace,
|
||||
[
|
||||
/// Activates the next pane in the workspace.
|
||||
ActivateNextPane,
|
||||
/// Activates the previous pane in the workspace.
|
||||
ActivatePreviousPane,
|
||||
/// Switches to the next window.
|
||||
ActivateNextWindow,
|
||||
/// Switches to the previous window.
|
||||
ActivatePreviousWindow,
|
||||
/// Adds a folder to the current project.
|
||||
AddFolderToProject,
|
||||
/// Clears all notifications.
|
||||
ClearAllNotifications,
|
||||
/// Closes the active dock.
|
||||
CloseActiveDock,
|
||||
/// Closes all docks.
|
||||
CloseAllDocks,
|
||||
/// Closes the current window.
|
||||
CloseWindow,
|
||||
/// Opens the feedback dialog.
|
||||
Feedback,
|
||||
/// Follows the next collaborator in the session.
|
||||
FollowNextCollaborator,
|
||||
/// Moves the focused panel to the next position.
|
||||
MoveFocusedPanelToNextPosition,
|
||||
/// Opens a new terminal in the center.
|
||||
NewCenterTerminal,
|
||||
/// Creates a new file.
|
||||
NewFile,
|
||||
/// Creates a new file in a vertical split.
|
||||
NewFileSplitVertical,
|
||||
/// Creates a new file in a horizontal split.
|
||||
NewFileSplitHorizontal,
|
||||
/// Opens a new search.
|
||||
NewSearch,
|
||||
/// Opens a new terminal.
|
||||
NewTerminal,
|
||||
/// Opens a new window.
|
||||
NewWindow,
|
||||
/// Opens a file or directory.
|
||||
Open,
|
||||
/// Opens multiple files.
|
||||
OpenFiles,
|
||||
/// Opens the current location in terminal.
|
||||
OpenInTerminal,
|
||||
/// Opens the component preview.
|
||||
OpenComponentPreview,
|
||||
/// Reloads the active item.
|
||||
ReloadActiveItem,
|
||||
/// Resets the active dock to its default size.
|
||||
ResetActiveDockSize,
|
||||
/// Resets all open docks to their default sizes.
|
||||
ResetOpenDocksSize,
|
||||
/// Saves the current file with a new name.
|
||||
SaveAs,
|
||||
/// Saves without formatting.
|
||||
SaveWithoutFormat,
|
||||
/// Shuts down all debug adapters.
|
||||
ShutdownDebugAdapters,
|
||||
/// Suppresses the current notification.
|
||||
SuppressNotification,
|
||||
/// Toggles the bottom dock.
|
||||
ToggleBottomDock,
|
||||
/// Toggles centered layout mode.
|
||||
ToggleCenteredLayout,
|
||||
/// Toggles the left dock.
|
||||
ToggleLeftDock,
|
||||
/// Toggles the right dock.
|
||||
ToggleRightDock,
|
||||
/// Toggles zoom on the active pane.
|
||||
ToggleZoom,
|
||||
/// Stops following a collaborator.
|
||||
Unfollow,
|
||||
/// Shows the welcome screen.
|
||||
Welcome,
|
||||
/// Restores the banner.
|
||||
RestoreBanner,
|
||||
/// Toggles expansion of the selected item.
|
||||
ToggleExpandItem,
|
||||
]
|
||||
);
|
||||
|
@ -216,10 +255,12 @@ pub struct OpenPaths {
|
|||
pub paths: Vec<PathBuf>,
|
||||
}
|
||||
|
||||
/// Activates a specific pane by its index.
|
||||
#[derive(Clone, Deserialize, PartialEq, JsonSchema, Action)]
|
||||
#[action(namespace = workspace)]
|
||||
pub struct ActivatePane(pub usize);
|
||||
|
||||
/// Moves an item to a specific pane by index.
|
||||
#[derive(Clone, Deserialize, PartialEq, JsonSchema, Action)]
|
||||
#[action(namespace = workspace)]
|
||||
#[serde(deny_unknown_fields)]
|
||||
|
@ -236,6 +277,7 @@ fn default_1() -> usize {
|
|||
1
|
||||
}
|
||||
|
||||
/// Moves an item to a pane in the specified direction.
|
||||
#[derive(Clone, Deserialize, PartialEq, JsonSchema, Action)]
|
||||
#[action(namespace = workspace)]
|
||||
#[serde(deny_unknown_fields)]
|
||||
|
@ -252,6 +294,7 @@ fn default_right() -> SplitDirection {
|
|||
SplitDirection::Right
|
||||
}
|
||||
|
||||
/// Saves all open files in the workspace.
|
||||
#[derive(Clone, PartialEq, Debug, Deserialize, JsonSchema, Action)]
|
||||
#[action(namespace = workspace)]
|
||||
#[serde(deny_unknown_fields)]
|
||||
|
@ -260,6 +303,7 @@ pub struct SaveAll {
|
|||
pub save_intent: Option<SaveIntent>,
|
||||
}
|
||||
|
||||
/// Saves the current file with the specified options.
|
||||
#[derive(Clone, PartialEq, Debug, Deserialize, JsonSchema, Action)]
|
||||
#[action(namespace = workspace)]
|
||||
#[serde(deny_unknown_fields)]
|
||||
|
@ -268,6 +312,7 @@ pub struct Save {
|
|||
pub save_intent: Option<SaveIntent>,
|
||||
}
|
||||
|
||||
/// Closes all items and panes in the workspace.
|
||||
#[derive(Clone, PartialEq, Debug, Deserialize, Default, JsonSchema, Action)]
|
||||
#[action(namespace = workspace)]
|
||||
#[serde(deny_unknown_fields)]
|
||||
|
@ -276,6 +321,7 @@ pub struct CloseAllItemsAndPanes {
|
|||
pub save_intent: Option<SaveIntent>,
|
||||
}
|
||||
|
||||
/// Closes all inactive tabs and panes in the workspace.
|
||||
#[derive(Clone, PartialEq, Debug, Deserialize, Default, JsonSchema, Action)]
|
||||
#[action(namespace = workspace)]
|
||||
#[serde(deny_unknown_fields)]
|
||||
|
@ -284,10 +330,12 @@ pub struct CloseInactiveTabsAndPanes {
|
|||
pub save_intent: Option<SaveIntent>,
|
||||
}
|
||||
|
||||
/// Sends a sequence of keystrokes to the active element.
|
||||
#[derive(Clone, Deserialize, PartialEq, JsonSchema, Action)]
|
||||
#[action(namespace = workspace)]
|
||||
pub struct SendKeystrokes(pub String);
|
||||
|
||||
/// Reloads the active item or workspace.
|
||||
#[derive(Clone, Deserialize, PartialEq, Default, JsonSchema, Action)]
|
||||
#[action(namespace = workspace)]
|
||||
#[serde(deny_unknown_fields)]
|
||||
|
@ -298,11 +346,13 @@ pub struct Reload {
|
|||
actions!(
|
||||
project_symbols,
|
||||
[
|
||||
/// Toggles the project symbols search.
|
||||
#[action(name = "Toggle")]
|
||||
ToggleProjectSymbols
|
||||
]
|
||||
);
|
||||
|
||||
/// Toggles the file finder interface.
|
||||
#[derive(Default, PartialEq, Eq, Clone, Deserialize, JsonSchema, Action)]
|
||||
#[action(namespace = file_finder, name = "Toggle")]
|
||||
#[serde(deny_unknown_fields)]
|
||||
|
@ -354,13 +404,21 @@ pub struct DecreaseOpenDocksSize {
|
|||
actions!(
|
||||
workspace,
|
||||
[
|
||||
/// Activates the pane to the left.
|
||||
ActivatePaneLeft,
|
||||
/// Activates the pane to the right.
|
||||
ActivatePaneRight,
|
||||
/// Activates the pane above.
|
||||
ActivatePaneUp,
|
||||
/// Activates the pane below.
|
||||
ActivatePaneDown,
|
||||
/// Swaps the current pane with the one to the left.
|
||||
SwapPaneLeft,
|
||||
/// Swaps the current pane with the one to the right.
|
||||
SwapPaneRight,
|
||||
/// Swaps the current pane with the one above.
|
||||
SwapPaneUp,
|
||||
/// Swaps the current pane with the one below.
|
||||
SwapPaneDown,
|
||||
]
|
||||
);
|
||||
|
@ -416,6 +474,7 @@ impl PartialEq for Toast {
|
|||
}
|
||||
}
|
||||
|
||||
/// Opens a new terminal with the specified working directory.
|
||||
#[derive(Debug, Default, Clone, Deserialize, PartialEq, JsonSchema, Action)]
|
||||
#[action(namespace = workspace)]
|
||||
#[serde(deny_unknown_fields)]
|
||||
|
@ -6677,14 +6736,25 @@ actions!(
|
|||
/// can be copied via "Copy link to section" in the context menu of the channel notes
|
||||
/// buffer. These URLs look like `https://zed.dev/channel/channel-name-CHANNEL_ID/notes`.
|
||||
OpenChannelNotes,
|
||||
/// Mutes your microphone.
|
||||
Mute,
|
||||
/// Deafens yourself (mute both microphone and speakers).
|
||||
Deafen,
|
||||
/// Leaves the current call.
|
||||
LeaveCall,
|
||||
/// Shares the current project with collaborators.
|
||||
ShareProject,
|
||||
/// Shares your screen with collaborators.
|
||||
ScreenShare
|
||||
]
|
||||
);
|
||||
actions!(zed, [OpenLog]);
|
||||
actions!(
|
||||
zed,
|
||||
[
|
||||
/// Opens the Zed log file.
|
||||
OpenLog
|
||||
]
|
||||
);
|
||||
|
||||
async fn join_channel_internal(
|
||||
channel_id: ChannelId,
|
||||
|
|
|
@ -1368,6 +1368,7 @@ fn dump_all_gpui_actions() {
|
|||
name: &'static str,
|
||||
human_name: String,
|
||||
aliases: &'static [&'static str],
|
||||
documentation: Option<&'static str>,
|
||||
}
|
||||
let mut actions = gpui::generate_list_of_all_registered_actions()
|
||||
.into_iter()
|
||||
|
@ -1375,6 +1376,7 @@ fn dump_all_gpui_actions() {
|
|||
name: action.name,
|
||||
human_name: command_palette::humanize_action_name(action.name),
|
||||
aliases: action.deprecated_aliases,
|
||||
documentation: action.documentation,
|
||||
})
|
||||
.collect::<Vec<ActionDef>>();
|
||||
|
||||
|
|
|
@ -78,19 +78,33 @@ use zed_actions::{
|
|||
actions!(
|
||||
zed,
|
||||
[
|
||||
/// Opens the element inspector for debugging UI.
|
||||
DebugElements,
|
||||
/// Hides the application window.
|
||||
Hide,
|
||||
/// Hides all other application windows.
|
||||
HideOthers,
|
||||
/// Minimizes the current window.
|
||||
Minimize,
|
||||
/// Opens the default settings file.
|
||||
OpenDefaultSettings,
|
||||
/// Opens project-specific settings.
|
||||
OpenProjectSettings,
|
||||
/// Opens the project tasks configuration.
|
||||
OpenProjectTasks,
|
||||
/// Opens the tasks panel.
|
||||
OpenTasks,
|
||||
/// Opens debug tasks configuration.
|
||||
OpenDebugTasks,
|
||||
/// Resets the application database.
|
||||
ResetDatabase,
|
||||
/// Shows all hidden windows.
|
||||
ShowAll,
|
||||
/// Toggles fullscreen mode.
|
||||
ToggleFullScreen,
|
||||
/// Zooms the window.
|
||||
Zoom,
|
||||
/// Triggers a test panic for debugging.
|
||||
TestPanic,
|
||||
]
|
||||
);
|
||||
|
|
|
@ -11,6 +11,7 @@ use serde::{Deserialize, Serialize};
|
|||
// https://github.com/mmastrac/rust-ctor/issues/280
|
||||
pub fn init() {}
|
||||
|
||||
/// Opens a URL in the system's default web browser.
|
||||
#[derive(Clone, PartialEq, Deserialize, JsonSchema, Action)]
|
||||
#[action(namespace = zed)]
|
||||
#[serde(deny_unknown_fields)]
|
||||
|
@ -18,6 +19,7 @@ pub struct OpenBrowser {
|
|||
pub url: String,
|
||||
}
|
||||
|
||||
/// Opens a zed:// URL within the application.
|
||||
#[derive(Clone, PartialEq, Deserialize, JsonSchema, Action)]
|
||||
#[action(namespace = zed)]
|
||||
#[serde(deny_unknown_fields)]
|
||||
|
@ -28,15 +30,25 @@ pub struct OpenZedUrl {
|
|||
actions!(
|
||||
zed,
|
||||
[
|
||||
/// Opens the settings editor.
|
||||
OpenSettings,
|
||||
/// Opens the default keymap file.
|
||||
OpenDefaultKeymap,
|
||||
/// Opens account settings.
|
||||
OpenAccountSettings,
|
||||
/// Opens server settings.
|
||||
OpenServerSettings,
|
||||
/// Quits the application.
|
||||
Quit,
|
||||
/// Opens the user keymap file.
|
||||
OpenKeymap,
|
||||
/// Shows information about Zed.
|
||||
About,
|
||||
/// Opens the documentation website.
|
||||
OpenDocs,
|
||||
/// Views open source licenses.
|
||||
OpenLicenses,
|
||||
/// Opens the telemetry log.
|
||||
OpenTelemetryLog,
|
||||
]
|
||||
);
|
||||
|
@ -56,6 +68,7 @@ pub enum ExtensionCategoryFilter {
|
|||
DebugAdapters,
|
||||
}
|
||||
|
||||
/// Opens the extensions management interface.
|
||||
#[derive(PartialEq, Clone, Default, Debug, Deserialize, JsonSchema, Action)]
|
||||
#[action(namespace = zed)]
|
||||
#[serde(deny_unknown_fields)]
|
||||
|
@ -65,6 +78,7 @@ pub struct Extensions {
|
|||
pub category_filter: Option<ExtensionCategoryFilter>,
|
||||
}
|
||||
|
||||
/// Decreases the font size in the editor buffer.
|
||||
#[derive(PartialEq, Clone, Default, Debug, Deserialize, JsonSchema, Action)]
|
||||
#[action(namespace = zed)]
|
||||
#[serde(deny_unknown_fields)]
|
||||
|
@ -73,6 +87,7 @@ pub struct DecreaseBufferFontSize {
|
|||
pub persist: bool,
|
||||
}
|
||||
|
||||
/// Increases the font size in the editor buffer.
|
||||
#[derive(PartialEq, Clone, Default, Debug, Deserialize, JsonSchema, Action)]
|
||||
#[action(namespace = zed)]
|
||||
#[serde(deny_unknown_fields)]
|
||||
|
@ -81,6 +96,7 @@ pub struct IncreaseBufferFontSize {
|
|||
pub persist: bool,
|
||||
}
|
||||
|
||||
/// Resets the buffer font size to the default value.
|
||||
#[derive(PartialEq, Clone, Default, Debug, Deserialize, JsonSchema, Action)]
|
||||
#[action(namespace = zed)]
|
||||
#[serde(deny_unknown_fields)]
|
||||
|
@ -89,6 +105,7 @@ pub struct ResetBufferFontSize {
|
|||
pub persist: bool,
|
||||
}
|
||||
|
||||
/// Decreases the font size of the user interface.
|
||||
#[derive(PartialEq, Clone, Default, Debug, Deserialize, JsonSchema, Action)]
|
||||
#[action(namespace = zed)]
|
||||
#[serde(deny_unknown_fields)]
|
||||
|
@ -97,6 +114,7 @@ pub struct DecreaseUiFontSize {
|
|||
pub persist: bool,
|
||||
}
|
||||
|
||||
/// Increases the font size of the user interface.
|
||||
#[derive(PartialEq, Clone, Default, Debug, Deserialize, JsonSchema, Action)]
|
||||
#[action(namespace = zed)]
|
||||
#[serde(deny_unknown_fields)]
|
||||
|
@ -105,6 +123,7 @@ pub struct IncreaseUiFontSize {
|
|||
pub persist: bool,
|
||||
}
|
||||
|
||||
/// Resets the UI font size to the default value.
|
||||
#[derive(PartialEq, Clone, Default, Debug, Deserialize, JsonSchema, Action)]
|
||||
#[action(namespace = zed)]
|
||||
#[serde(deny_unknown_fields)]
|
||||
|
@ -116,7 +135,13 @@ pub struct ResetUiFontSize {
|
|||
pub mod dev {
|
||||
use gpui::actions;
|
||||
|
||||
actions!(dev, [ToggleInspector]);
|
||||
actions!(
|
||||
dev,
|
||||
[
|
||||
/// Toggles the developer inspector for debugging UI elements.
|
||||
ToggleInspector
|
||||
]
|
||||
);
|
||||
}
|
||||
|
||||
pub mod workspace {
|
||||
|
@ -139,9 +164,13 @@ pub mod git {
|
|||
actions!(
|
||||
git,
|
||||
[
|
||||
/// Checks out a different git branch.
|
||||
CheckoutBranch,
|
||||
/// Switches to a different git branch.
|
||||
Switch,
|
||||
/// Selects a different repository.
|
||||
SelectRepo,
|
||||
/// Opens the git branch selector.
|
||||
#[action(deprecated_aliases = ["branches::OpenRecent"])]
|
||||
Branch
|
||||
]
|
||||
|
@ -151,25 +180,51 @@ pub mod git {
|
|||
pub mod jj {
|
||||
use gpui::actions;
|
||||
|
||||
actions!(jj, [BookmarkList]);
|
||||
actions!(
|
||||
jj,
|
||||
[
|
||||
/// Opens the Jujutsu bookmark list.
|
||||
BookmarkList
|
||||
]
|
||||
);
|
||||
}
|
||||
|
||||
pub mod toast {
|
||||
use gpui::actions;
|
||||
|
||||
actions!(toast, [RunAction]);
|
||||
actions!(
|
||||
toast,
|
||||
[
|
||||
/// Runs the action associated with a toast notification.
|
||||
RunAction
|
||||
]
|
||||
);
|
||||
}
|
||||
|
||||
pub mod command_palette {
|
||||
use gpui::actions;
|
||||
|
||||
actions!(command_palette, [Toggle]);
|
||||
actions!(
|
||||
command_palette,
|
||||
[
|
||||
/// Toggles the command palette.
|
||||
Toggle
|
||||
]
|
||||
);
|
||||
}
|
||||
|
||||
pub mod feedback {
|
||||
use gpui::actions;
|
||||
|
||||
actions!(feedback, [FileBugReport, GiveFeedback]);
|
||||
actions!(
|
||||
feedback,
|
||||
[
|
||||
/// Opens the bug report form.
|
||||
FileBugReport,
|
||||
/// Opens the feedback form.
|
||||
GiveFeedback
|
||||
]
|
||||
);
|
||||
}
|
||||
|
||||
pub mod theme_selector {
|
||||
|
@ -177,6 +232,7 @@ pub mod theme_selector {
|
|||
use schemars::JsonSchema;
|
||||
use serde::Deserialize;
|
||||
|
||||
/// Toggles the theme selector interface.
|
||||
#[derive(PartialEq, Clone, Default, Debug, Deserialize, JsonSchema, Action)]
|
||||
#[action(namespace = theme_selector)]
|
||||
#[serde(deny_unknown_fields)]
|
||||
|
@ -191,6 +247,7 @@ pub mod icon_theme_selector {
|
|||
use schemars::JsonSchema;
|
||||
use serde::Deserialize;
|
||||
|
||||
/// Toggles the icon theme selector interface.
|
||||
#[derive(PartialEq, Clone, Default, Debug, Deserialize, JsonSchema, Action)]
|
||||
#[action(namespace = icon_theme_selector)]
|
||||
#[serde(deny_unknown_fields)]
|
||||
|
@ -205,7 +262,14 @@ pub mod agent {
|
|||
|
||||
actions!(
|
||||
agent,
|
||||
[OpenConfiguration, OpenOnboardingModal, ResetOnboarding]
|
||||
[
|
||||
/// Opens the agent configuration panel.
|
||||
OpenConfiguration,
|
||||
/// Opens the agent onboarding modal.
|
||||
OpenOnboardingModal,
|
||||
/// Resets the agent onboarding state.
|
||||
ResetOnboarding
|
||||
]
|
||||
);
|
||||
}
|
||||
|
||||
|
@ -223,8 +287,15 @@ pub mod assistant {
|
|||
]
|
||||
);
|
||||
|
||||
actions!(assistant, [ShowConfiguration]);
|
||||
actions!(
|
||||
assistant,
|
||||
[
|
||||
/// Shows the assistant configuration panel.
|
||||
ShowConfiguration
|
||||
]
|
||||
);
|
||||
|
||||
/// Opens the rules library for managing agent rules and prompts.
|
||||
#[derive(PartialEq, Clone, Default, Debug, Deserialize, JsonSchema, Action)]
|
||||
#[action(namespace = agent, deprecated_aliases = ["assistant::OpenRulesLibrary", "assistant::DeployPromptLibrary"])]
|
||||
#[serde(deny_unknown_fields)]
|
||||
|
@ -233,6 +304,7 @@ pub mod assistant {
|
|||
pub prompt_to_select: Option<Uuid>,
|
||||
}
|
||||
|
||||
/// Deploys the assistant interface with the specified configuration.
|
||||
#[derive(Clone, Default, Deserialize, PartialEq, JsonSchema, Action)]
|
||||
#[action(namespace = assistant)]
|
||||
#[serde(deny_unknown_fields)]
|
||||
|
@ -244,9 +316,18 @@ pub mod assistant {
|
|||
pub mod debugger {
|
||||
use gpui::actions;
|
||||
|
||||
actions!(debugger, [OpenOnboardingModal, ResetOnboarding]);
|
||||
actions!(
|
||||
debugger,
|
||||
[
|
||||
/// Opens the debugger onboarding modal.
|
||||
OpenOnboardingModal,
|
||||
/// Resets the debugger onboarding state.
|
||||
ResetOnboarding
|
||||
]
|
||||
);
|
||||
}
|
||||
|
||||
/// Opens the recent projects interface.
|
||||
#[derive(PartialEq, Clone, Deserialize, Default, JsonSchema, Action)]
|
||||
#[action(namespace = projects)]
|
||||
#[serde(deny_unknown_fields)]
|
||||
|
@ -255,6 +336,7 @@ pub struct OpenRecent {
|
|||
pub create_new_window: bool,
|
||||
}
|
||||
|
||||
/// Creates a project from a selected template.
|
||||
#[derive(PartialEq, Clone, Deserialize, Default, JsonSchema, Action)]
|
||||
#[action(namespace = projects)]
|
||||
#[serde(deny_unknown_fields)]
|
||||
|
@ -276,7 +358,7 @@ pub enum RevealTarget {
|
|||
Dock,
|
||||
}
|
||||
|
||||
/// Spawn a task with name or open tasks modal.
|
||||
/// Spawns a task with name or opens tasks modal.
|
||||
#[derive(Debug, PartialEq, Clone, Deserialize, JsonSchema, Action)]
|
||||
#[action(namespace = task)]
|
||||
#[serde(untagged)]
|
||||
|
@ -309,7 +391,7 @@ impl Spawn {
|
|||
}
|
||||
}
|
||||
|
||||
/// Rerun the last task.
|
||||
/// Reruns the last task.
|
||||
#[derive(PartialEq, Clone, Deserialize, Default, JsonSchema, Action)]
|
||||
#[action(namespace = task)]
|
||||
#[serde(deny_unknown_fields)]
|
||||
|
@ -350,15 +432,36 @@ pub mod outline {
|
|||
pub static TOGGLE_OUTLINE: OnceLock<fn(AnyView, &mut Window, &mut App)> = OnceLock::new();
|
||||
}
|
||||
|
||||
actions!(zed_predict_onboarding, [OpenZedPredictOnboarding]);
|
||||
actions!(git_onboarding, [OpenGitIntegrationOnboarding]);
|
||||
actions!(
|
||||
zed_predict_onboarding,
|
||||
[
|
||||
/// Opens the Zed Predict onboarding modal.
|
||||
OpenZedPredictOnboarding
|
||||
]
|
||||
);
|
||||
actions!(
|
||||
git_onboarding,
|
||||
[
|
||||
/// Opens the git integration onboarding modal.
|
||||
OpenGitIntegrationOnboarding
|
||||
]
|
||||
);
|
||||
|
||||
actions!(debug_panel, [ToggleFocus]);
|
||||
actions!(
|
||||
debug_panel,
|
||||
[
|
||||
/// Toggles focus on the debug panel.
|
||||
ToggleFocus
|
||||
]
|
||||
);
|
||||
actions!(
|
||||
debugger,
|
||||
[
|
||||
/// Toggles the enabled state of a breakpoint.
|
||||
ToggleEnableBreakpoint,
|
||||
/// Removes a breakpoint.
|
||||
UnsetBreakpoint,
|
||||
/// Opens the project debug tasks configuration.
|
||||
OpenProjectDebugTasks,
|
||||
]
|
||||
);
|
||||
|
|
|
@ -10,7 +10,15 @@ use workspace::Workspace;
|
|||
|
||||
use crate::{RateCompletionModal, onboarding_modal::ZedPredictModal};
|
||||
|
||||
actions!(edit_prediction, [ResetOnboarding, RateCompletions]);
|
||||
actions!(
|
||||
edit_prediction,
|
||||
[
|
||||
/// Resets the edit prediction onboarding state.
|
||||
ResetOnboarding,
|
||||
/// Opens the rate completions modal.
|
||||
RateCompletions
|
||||
]
|
||||
);
|
||||
|
||||
pub fn init(cx: &mut App) {
|
||||
cx.observe_new(move |workspace: &mut Workspace, _, _cx| {
|
||||
|
|
|
@ -9,11 +9,17 @@ use workspace::{ModalView, Workspace};
|
|||
actions!(
|
||||
zeta,
|
||||
[
|
||||
/// Rates the active completion with a thumbs up.
|
||||
ThumbsUpActiveCompletion,
|
||||
/// Rates the active completion with a thumbs down.
|
||||
ThumbsDownActiveCompletion,
|
||||
/// Navigates to the next edit in the completion history.
|
||||
NextEdit,
|
||||
/// Navigates to the previous edit in the completion history.
|
||||
PreviousEdit,
|
||||
/// Focuses on the completions list.
|
||||
FocusCompletions,
|
||||
/// Previews the selected completion.
|
||||
PreviewCompletion,
|
||||
]
|
||||
);
|
||||
|
|
|
@ -72,7 +72,13 @@ const MAX_EVENT_TOKENS: usize = 500;
|
|||
/// Maximum number of events to track.
|
||||
const MAX_EVENT_COUNT: usize = 16;
|
||||
|
||||
actions!(edit_prediction, [ClearHistory]);
|
||||
actions!(
|
||||
edit_prediction,
|
||||
[
|
||||
/// Clears the edit prediction history.
|
||||
ClearHistory
|
||||
]
|
||||
);
|
||||
|
||||
#[derive(Copy, Clone, Default, Debug, PartialEq, Eq, Hash)]
|
||||
pub struct InlineCompletionId(Uuid);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue