actions.rs

  1//! This module contains all actions supported by [`Editor`].
  2use super::*;
  3use gpui::{Action, actions};
  4use project::project_settings::GoToDiagnosticSeverityFilter;
  5use schemars::JsonSchema;
  6use util::serde::default_true;
  7
  8/// Selects the next occurrence of the current selection.
  9#[derive(PartialEq, Clone, Deserialize, Default, JsonSchema, Action)]
 10#[action(namespace = editor)]
 11#[serde(deny_unknown_fields)]
 12pub struct SelectNext {
 13    #[serde(default)]
 14    pub replace_newest: bool,
 15}
 16
 17/// Selects the previous occurrence of the current selection.
 18#[derive(PartialEq, Clone, Deserialize, Default, JsonSchema, Action)]
 19#[action(namespace = editor)]
 20#[serde(deny_unknown_fields)]
 21pub struct SelectPrevious {
 22    #[serde(default)]
 23    pub replace_newest: bool,
 24}
 25
 26/// Moves the cursor to the beginning of the current line.
 27#[derive(PartialEq, Clone, Deserialize, Default, JsonSchema, Action)]
 28#[action(namespace = editor)]
 29#[serde(deny_unknown_fields)]
 30pub struct MoveToBeginningOfLine {
 31    #[serde(default = "default_true")]
 32    pub stop_at_soft_wraps: bool,
 33    #[serde(default)]
 34    pub stop_at_indent: bool,
 35}
 36
 37/// Selects from the cursor to the beginning of the current line.
 38#[derive(PartialEq, Clone, Deserialize, Default, JsonSchema, Action)]
 39#[action(namespace = editor)]
 40#[serde(deny_unknown_fields)]
 41pub struct SelectToBeginningOfLine {
 42    #[serde(default)]
 43    pub(super) stop_at_soft_wraps: bool,
 44    #[serde(default)]
 45    pub stop_at_indent: bool,
 46}
 47
 48/// Deletes from the cursor to the beginning of the current line.
 49#[derive(PartialEq, Clone, Deserialize, Default, JsonSchema, Action)]
 50#[action(namespace = editor)]
 51#[serde(deny_unknown_fields)]
 52pub struct DeleteToBeginningOfLine {
 53    #[serde(default)]
 54    pub(super) stop_at_indent: bool,
 55}
 56
 57/// Moves the cursor up by one page.
 58#[derive(PartialEq, Clone, Deserialize, Default, JsonSchema, Action)]
 59#[action(namespace = editor)]
 60#[serde(deny_unknown_fields)]
 61pub struct MovePageUp {
 62    #[serde(default)]
 63    pub(super) center_cursor: bool,
 64}
 65
 66/// Moves the cursor down by one page.
 67#[derive(PartialEq, Clone, Deserialize, Default, JsonSchema, Action)]
 68#[action(namespace = editor)]
 69#[serde(deny_unknown_fields)]
 70pub struct MovePageDown {
 71    #[serde(default)]
 72    pub(super) center_cursor: bool,
 73}
 74
 75/// Moves the cursor to the end of the current line.
 76#[derive(PartialEq, Clone, Deserialize, Default, JsonSchema, Action)]
 77#[action(namespace = editor)]
 78#[serde(deny_unknown_fields)]
 79pub struct MoveToEndOfLine {
 80    #[serde(default = "default_true")]
 81    pub stop_at_soft_wraps: bool,
 82}
 83
 84/// Selects from the cursor to the end of the current line.
 85#[derive(PartialEq, Clone, Deserialize, Default, JsonSchema, Action)]
 86#[action(namespace = editor)]
 87#[serde(deny_unknown_fields)]
 88pub struct SelectToEndOfLine {
 89    #[serde(default)]
 90    pub(super) stop_at_soft_wraps: bool,
 91}
 92
 93/// Toggles the display of available code actions at the cursor position.
 94#[derive(PartialEq, Clone, Deserialize, Default, JsonSchema, Action)]
 95#[action(namespace = editor)]
 96#[serde(deny_unknown_fields)]
 97pub struct ToggleCodeActions {
 98    // Source from which the action was deployed.
 99    #[serde(default)]
100    #[serde(skip)]
101    pub deployed_from: Option<CodeActionSource>,
102    // Run first available task if there is only one.
103    #[serde(default)]
104    #[serde(skip)]
105    pub quick_launch: bool,
106}
107
108#[derive(PartialEq, Clone, Debug)]
109pub enum CodeActionSource {
110    Indicator(DisplayRow),
111    RunMenu(DisplayRow),
112    QuickActionBar,
113}
114
115/// Confirms and accepts the currently selected completion suggestion.
116#[derive(PartialEq, Clone, Deserialize, Default, JsonSchema, Action)]
117#[action(namespace = editor)]
118#[serde(deny_unknown_fields)]
119pub struct ConfirmCompletion {
120    #[serde(default)]
121    pub item_ix: Option<usize>,
122}
123
124/// Composes multiple completion suggestions into a single completion.
125#[derive(PartialEq, Clone, Deserialize, Default, JsonSchema, Action)]
126#[action(namespace = editor)]
127#[serde(deny_unknown_fields)]
128pub struct ComposeCompletion {
129    #[serde(default)]
130    pub item_ix: Option<usize>,
131}
132
133/// Confirms and applies the currently selected code action.
134#[derive(PartialEq, Clone, Deserialize, Default, JsonSchema, Action)]
135#[action(namespace = editor)]
136#[serde(deny_unknown_fields)]
137pub struct ConfirmCodeAction {
138    #[serde(default)]
139    pub item_ix: Option<usize>,
140}
141
142/// Toggles comment markers for the selected lines.
143#[derive(PartialEq, Clone, Deserialize, Default, JsonSchema, Action)]
144#[action(namespace = editor)]
145#[serde(deny_unknown_fields)]
146pub struct ToggleComments {
147    #[serde(default)]
148    pub advance_downwards: bool,
149    #[serde(default)]
150    pub ignore_indent: bool,
151}
152
153/// Moves the cursor up by a specified number of lines.
154#[derive(PartialEq, Clone, Deserialize, Default, JsonSchema, Action)]
155#[action(namespace = editor)]
156#[serde(deny_unknown_fields)]
157pub struct MoveUpByLines {
158    #[serde(default)]
159    pub(super) lines: u32,
160}
161
162/// Moves the cursor down by a specified number of lines.
163#[derive(PartialEq, Clone, Deserialize, Default, JsonSchema, Action)]
164#[action(namespace = editor)]
165#[serde(deny_unknown_fields)]
166pub struct MoveDownByLines {
167    #[serde(default)]
168    pub(super) lines: u32,
169}
170
171/// Extends selection up by a specified number of lines.
172#[derive(PartialEq, Clone, Deserialize, Default, JsonSchema, Action)]
173#[action(namespace = editor)]
174#[serde(deny_unknown_fields)]
175pub struct SelectUpByLines {
176    #[serde(default)]
177    pub(super) lines: u32,
178}
179
180/// Extends selection down by a specified number of lines.
181#[derive(PartialEq, Clone, Deserialize, Default, JsonSchema, Action)]
182#[action(namespace = editor)]
183#[serde(deny_unknown_fields)]
184pub struct SelectDownByLines {
185    #[serde(default)]
186    pub(super) lines: u32,
187}
188
189/// Expands all excerpts in the editor.
190#[derive(PartialEq, Clone, Deserialize, Default, JsonSchema, Action)]
191#[action(namespace = editor)]
192#[serde(deny_unknown_fields)]
193pub struct ExpandExcerpts {
194    #[serde(default)]
195    pub(super) lines: u32,
196}
197
198/// Expands excerpts above the current position.
199#[derive(PartialEq, Clone, Deserialize, Default, JsonSchema, Action)]
200#[action(namespace = editor)]
201#[serde(deny_unknown_fields)]
202pub struct ExpandExcerptsUp {
203    #[serde(default)]
204    pub(super) lines: u32,
205}
206
207/// Expands excerpts below the current position.
208#[derive(PartialEq, Clone, Deserialize, Default, JsonSchema, Action)]
209#[action(namespace = editor)]
210#[serde(deny_unknown_fields)]
211pub struct ExpandExcerptsDown {
212    #[serde(default)]
213    pub(super) lines: u32,
214}
215
216/// Shows code completion suggestions at the cursor position.
217#[derive(PartialEq, Clone, Deserialize, Default, JsonSchema, Action)]
218#[action(namespace = editor)]
219#[serde(deny_unknown_fields)]
220pub struct ShowCompletions {
221    #[serde(default)]
222    pub(super) trigger: Option<String>,
223}
224
225/// Handles text input in the editor.
226#[derive(PartialEq, Clone, Deserialize, Default, JsonSchema, Action)]
227#[action(namespace = editor)]
228pub struct HandleInput(pub String);
229
230/// Deletes from the cursor to the end of the next word.
231/// Stops before the end of the next word, if whitespace sequences of length >= 2 are encountered.
232#[derive(PartialEq, Clone, Deserialize, Default, JsonSchema, Action)]
233#[action(namespace = editor)]
234#[serde(deny_unknown_fields)]
235pub struct DeleteToNextWordEnd {
236    #[serde(default)]
237    pub ignore_newlines: bool,
238    // Whether to stop before the end of the next word, if language-defined bracket is encountered.
239    #[serde(default)]
240    pub ignore_brackets: bool,
241}
242
243/// Deletes from the cursor to the start of the previous word.
244/// Stops before the start of the previous word, if whitespace sequences of length >= 2 are encountered.
245#[derive(PartialEq, Clone, Deserialize, Default, JsonSchema, Action)]
246#[action(namespace = editor)]
247#[serde(deny_unknown_fields)]
248pub struct DeleteToPreviousWordStart {
249    #[serde(default)]
250    pub ignore_newlines: bool,
251    // Whether to stop before the start of the previous word, if language-defined bracket is encountered.
252    #[serde(default)]
253    pub ignore_brackets: bool,
254}
255
256/// Cuts from cursor to end of line.
257#[derive(PartialEq, Clone, Deserialize, Default, JsonSchema, Action)]
258#[action(namespace = editor)]
259#[serde(deny_unknown_fields)]
260pub struct CutToEndOfLine {
261    #[serde(default)]
262    pub stop_at_newlines: bool,
263}
264
265/// Folds all code blocks at the specified indentation level.
266#[derive(PartialEq, Clone, Deserialize, Default, JsonSchema, Action)]
267#[action(namespace = editor)]
268pub struct FoldAtLevel(pub u32);
269
270/// Spawns the nearest available task from the current cursor position.
271#[derive(PartialEq, Clone, Deserialize, Default, JsonSchema, Action)]
272#[action(namespace = editor)]
273#[serde(deny_unknown_fields)]
274pub struct SpawnNearestTask {
275    #[serde(default)]
276    pub reveal: task::RevealStrategy,
277}
278
279#[derive(Clone, PartialEq, Action)]
280#[action(no_json, no_register)]
281pub struct DiffClipboardWithSelectionData {
282    pub clipboard_text: String,
283    pub editor: Entity<Editor>,
284}
285
286#[derive(Debug, PartialEq, Eq, Clone, Copy, Deserialize, Default)]
287pub enum UuidVersion {
288    #[default]
289    V4,
290    V7,
291}
292
293/// Splits selection into individual lines.
294#[derive(PartialEq, Clone, Deserialize, Default, JsonSchema, Action)]
295#[action(namespace = editor)]
296#[serde(deny_unknown_fields)]
297pub struct SplitSelectionIntoLines {
298    /// Keep the text selected after splitting instead of collapsing to cursors.
299    #[serde(default)]
300    pub keep_selections: bool,
301}
302
303/// Goes to the next diagnostic in the file.
304#[derive(PartialEq, Clone, Default, Debug, Deserialize, JsonSchema, Action)]
305#[action(namespace = editor)]
306#[serde(deny_unknown_fields)]
307pub struct GoToDiagnostic {
308    #[serde(default)]
309    pub severity: GoToDiagnosticSeverityFilter,
310}
311
312/// Goes to the previous diagnostic in the file.
313#[derive(PartialEq, Clone, Default, Debug, Deserialize, JsonSchema, Action)]
314#[action(namespace = editor)]
315#[serde(deny_unknown_fields)]
316pub struct GoToPreviousDiagnostic {
317    #[serde(default)]
318    pub severity: GoToDiagnosticSeverityFilter,
319}
320
321/// Adds a cursor above the current selection.
322#[derive(PartialEq, Clone, Default, Debug, Deserialize, JsonSchema, Action)]
323#[action(namespace = editor)]
324#[serde(deny_unknown_fields)]
325pub struct AddSelectionAbove {
326    #[serde(default = "default_true")]
327    pub skip_soft_wrap: bool,
328}
329
330/// Adds a cursor below the current selection.
331#[derive(PartialEq, Clone, Default, Debug, Deserialize, JsonSchema, Action)]
332#[action(namespace = editor)]
333#[serde(deny_unknown_fields)]
334pub struct AddSelectionBelow {
335    #[serde(default = "default_true")]
336    pub skip_soft_wrap: bool,
337}
338
339actions!(
340    debugger,
341    [
342        /// Runs program execution to the current cursor position.
343        RunToCursor,
344        /// Evaluates the selected text in the debugger context.
345        EvaluateSelectedText
346    ]
347);
348
349actions!(
350    go_to_line,
351    [
352        /// Toggles the go to line dialog.
353        #[action(name = "Toggle")]
354        ToggleGoToLine
355    ]
356);
357
358actions!(
359    editor,
360    [
361        /// Accepts the full edit prediction.
362        AcceptEditPrediction,
363        /// Accepts a partial edit prediction.
364        #[action(deprecated_aliases = ["editor::AcceptPartialCopilotSuggestion"])]
365        AcceptPartialEditPrediction,
366        /// Applies all diff hunks in the editor.
367        ApplyAllDiffHunks,
368        /// Applies the diff hunk at the current position.
369        ApplyDiffHunk,
370        /// Deletes the character before the cursor.
371        Backspace,
372        /// Shows git blame information for the current line.
373        BlameHover,
374        /// Cancels the current operation.
375        Cancel,
376        /// Cancels the running flycheck operation.
377        CancelFlycheck,
378        /// Cancels pending language server work.
379        CancelLanguageServerWork,
380        /// Clears flycheck results.
381        ClearFlycheck,
382        /// Confirms the rename operation.
383        ConfirmRename,
384        /// Confirms completion by inserting at cursor.
385        ConfirmCompletionInsert,
386        /// Confirms completion by replacing existing text.
387        ConfirmCompletionReplace,
388        /// Navigates to the first item in the context menu.
389        ContextMenuFirst,
390        /// Navigates to the last item in the context menu.
391        ContextMenuLast,
392        /// Navigates to the next item in the context menu.
393        ContextMenuNext,
394        /// Navigates to the previous item in the context menu.
395        ContextMenuPrevious,
396        /// Converts indentation from tabs to spaces.
397        ConvertIndentationToSpaces,
398        /// Converts indentation from spaces to tabs.
399        ConvertIndentationToTabs,
400        /// Converts selected text to kebab-case.
401        ConvertToKebabCase,
402        /// Converts selected text to lowerCamelCase.
403        ConvertToLowerCamelCase,
404        /// Converts selected text to lowercase.
405        ConvertToLowerCase,
406        /// Toggles the case of selected text.
407        ConvertToOppositeCase,
408        /// Converts selected text to sentence case.
409        ConvertToSentenceCase,
410        /// Converts selected text to snake_case.
411        ConvertToSnakeCase,
412        /// Converts selected text to Title Case.
413        ConvertToTitleCase,
414        /// Converts selected text to UpperCamelCase.
415        ConvertToUpperCamelCase,
416        /// Converts selected text to UPPERCASE.
417        ConvertToUpperCase,
418        /// Applies ROT13 cipher to selected text.
419        ConvertToRot13,
420        /// Applies ROT47 cipher to selected text.
421        ConvertToRot47,
422        /// Copies selected text to the clipboard.
423        Copy,
424        /// Copies selected text to the clipboard with leading/trailing whitespace trimmed.
425        CopyAndTrim,
426        /// Copies the current file location to the clipboard.
427        CopyFileLocation,
428        /// Copies the highlighted text as JSON.
429        CopyHighlightJson,
430        /// Copies the current file name to the clipboard.
431        CopyFileName,
432        /// Copies the file name without extension to the clipboard.
433        CopyFileNameWithoutExtension,
434        /// Copies a permalink to the current line.
435        CopyPermalinkToLine,
436        /// Cuts selected text to the clipboard.
437        Cut,
438        /// Deletes the character after the cursor.
439        Delete,
440        /// Deletes the current line.
441        DeleteLine,
442        /// Deletes from cursor to end of line.
443        DeleteToEndOfLine,
444        /// Deletes to the end of the next subword.
445        DeleteToNextSubwordEnd,
446        /// Deletes to the start of the previous subword.
447        DeleteToPreviousSubwordStart,
448        /// Diffs the text stored in the clipboard against the current selection.
449        DiffClipboardWithSelection,
450        /// Displays names of all active cursors.
451        DisplayCursorNames,
452        /// Duplicates the current line below.
453        DuplicateLineDown,
454        /// Duplicates the current line above.
455        DuplicateLineUp,
456        /// Duplicates the current selection.
457        DuplicateSelection,
458        /// Expands all diff hunks in the editor.
459        #[action(deprecated_aliases = ["editor::ExpandAllHunkDiffs"])]
460        ExpandAllDiffHunks,
461        /// Collapses all diff hunks in the editor.
462        CollapseAllDiffHunks,
463        /// Expands macros recursively at cursor position.
464        ExpandMacroRecursively,
465        /// Finds all references to the symbol at cursor.
466        FindAllReferences,
467        /// Finds the next match in the search.
468        FindNextMatch,
469        /// Finds the previous match in the search.
470        FindPreviousMatch,
471        /// Folds the current code block.
472        Fold,
473        /// Folds all foldable regions in the editor.
474        FoldAll,
475        /// Folds all code blocks at indentation level 1.
476        #[action(name = "FoldAtLevel_1")]
477        FoldAtLevel1,
478        /// Folds all code blocks at indentation level 2.
479        #[action(name = "FoldAtLevel_2")]
480        FoldAtLevel2,
481        /// Folds all code blocks at indentation level 3.
482        #[action(name = "FoldAtLevel_3")]
483        FoldAtLevel3,
484        /// Folds all code blocks at indentation level 4.
485        #[action(name = "FoldAtLevel_4")]
486        FoldAtLevel4,
487        /// Folds all code blocks at indentation level 5.
488        #[action(name = "FoldAtLevel_5")]
489        FoldAtLevel5,
490        /// Folds all code blocks at indentation level 6.
491        #[action(name = "FoldAtLevel_6")]
492        FoldAtLevel6,
493        /// Folds all code blocks at indentation level 7.
494        #[action(name = "FoldAtLevel_7")]
495        FoldAtLevel7,
496        /// Folds all code blocks at indentation level 8.
497        #[action(name = "FoldAtLevel_8")]
498        FoldAtLevel8,
499        /// Folds all code blocks at indentation level 9.
500        #[action(name = "FoldAtLevel_9")]
501        FoldAtLevel9,
502        /// Folds all function bodies in the editor.
503        FoldFunctionBodies,
504        /// Folds the current code block and all its children.
505        FoldRecursive,
506        /// Folds the selected ranges.
507        FoldSelectedRanges,
508        /// Toggles focus back to the last active buffer.
509        ToggleFocus,
510        /// Toggles folding at the current position.
511        ToggleFold,
512        /// Toggles recursive folding at the current position.
513        ToggleFoldRecursive,
514        /// Toggles all folds in a buffer or all excerpts in multibuffer.
515        ToggleFoldAll,
516        /// Formats the entire document.
517        Format,
518        /// Formats only the selected text.
519        FormatSelections,
520        /// Goes to the declaration of the symbol at cursor.
521        GoToDeclaration,
522        /// Goes to declaration in a split pane.
523        GoToDeclarationSplit,
524        /// Goes to the definition of the symbol at cursor.
525        GoToDefinition,
526        /// Goes to definition in a split pane.
527        GoToDefinitionSplit,
528        /// Goes to the next diff hunk.
529        GoToHunk,
530        /// Goes to the previous diff hunk.
531        GoToPreviousHunk,
532        /// Goes to the implementation of the symbol at cursor.
533        GoToImplementation,
534        /// Goes to implementation in a split pane.
535        GoToImplementationSplit,
536        /// Goes to the next change in the file.
537        GoToNextChange,
538        /// Goes to the parent module of the current file.
539        GoToParentModule,
540        /// Goes to the previous change in the file.
541        GoToPreviousChange,
542        /// Goes to the next reference to the symbol under the cursor.
543        GoToNextReference,
544        /// Goes to the previous reference to the symbol under the cursor.
545        GoToPreviousReference,
546        /// Goes to the type definition of the symbol at cursor.
547        GoToTypeDefinition,
548        /// Goes to type definition in a split pane.
549        GoToTypeDefinitionSplit,
550        /// Goes to the next document highlight.
551        GoToNextDocumentHighlight,
552        /// Goes to the previous document highlight.
553        GoToPreviousDocumentHighlight,
554        /// Scrolls down by half a page.
555        HalfPageDown,
556        /// Scrolls up by half a page.
557        HalfPageUp,
558        /// Shows hover information for the symbol at cursor.
559        Hover,
560        /// Increases indentation of selected lines.
561        Indent,
562        /// Inserts a UUID v4 at cursor position.
563        InsertUuidV4,
564        /// Inserts a UUID v7 at cursor position.
565        InsertUuidV7,
566        /// Joins the current line with the next line.
567        JoinLines,
568        /// Cuts to kill ring (Emacs-style).
569        KillRingCut,
570        /// Yanks from kill ring (Emacs-style).
571        KillRingYank,
572        /// Moves cursor down one line.
573        LineDown,
574        /// Moves cursor up one line.
575        LineUp,
576        /// Moves cursor down.
577        MoveDown,
578        /// Moves cursor left.
579        MoveLeft,
580        /// Moves the current line down.
581        MoveLineDown,
582        /// Moves the current line up.
583        MoveLineUp,
584        /// Moves cursor right.
585        MoveRight,
586        /// Moves cursor to the beginning of the document.
587        MoveToBeginning,
588        /// Moves cursor to the enclosing bracket.
589        MoveToEnclosingBracket,
590        /// Moves cursor to the end of the document.
591        MoveToEnd,
592        /// Moves cursor to the end of the paragraph.
593        MoveToEndOfParagraph,
594        /// Moves cursor to the end of the next subword.
595        MoveToNextSubwordEnd,
596        /// Moves cursor to the end of the next word.
597        MoveToNextWordEnd,
598        /// Moves cursor to the start of the previous subword.
599        MoveToPreviousSubwordStart,
600        /// Moves cursor to the start of the previous word.
601        MoveToPreviousWordStart,
602        /// Moves cursor to the start of the paragraph.
603        MoveToStartOfParagraph,
604        /// Moves cursor to the start of the current excerpt.
605        MoveToStartOfExcerpt,
606        /// Moves cursor to the start of the next excerpt.
607        MoveToStartOfNextExcerpt,
608        /// Moves cursor to the end of the current excerpt.
609        MoveToEndOfExcerpt,
610        /// Moves cursor to the end of the previous excerpt.
611        MoveToEndOfPreviousExcerpt,
612        /// Moves cursor up.
613        MoveUp,
614        /// Inserts a new line and moves cursor to it.
615        Newline,
616        /// Inserts a new line above the current line.
617        NewlineAbove,
618        /// Inserts a new line below the current line.
619        NewlineBelow,
620        /// Navigates to the next edit prediction.
621        NextEditPrediction,
622        /// Scrolls to the next screen.
623        NextScreen,
624        /// Opens the context menu at cursor position.
625        OpenContextMenu,
626        /// Opens excerpts from the current file.
627        OpenExcerpts,
628        /// Opens excerpts in a split pane.
629        OpenExcerptsSplit,
630        /// Opens the proposed changes editor.
631        OpenProposedChangesEditor,
632        /// Opens documentation for the symbol at cursor.
633        OpenDocs,
634        /// Opens a permalink to the current line.
635        OpenPermalinkToLine,
636        /// Opens the file whose name is selected in the editor.
637        #[action(deprecated_aliases = ["editor::OpenFile"])]
638        OpenSelectedFilename,
639        /// Opens all selections in a multibuffer.
640        OpenSelectionsInMultibuffer,
641        /// Opens the URL at cursor position.
642        OpenUrl,
643        /// Organizes import statements.
644        OrganizeImports,
645        /// Decreases indentation of selected lines.
646        Outdent,
647        /// Automatically adjusts indentation based on context.
648        AutoIndent,
649        /// Scrolls down by one page.
650        PageDown,
651        /// Scrolls up by one page.
652        PageUp,
653        /// Pastes from clipboard.
654        Paste,
655        /// Navigates to the previous edit prediction.
656        PreviousEditPrediction,
657        /// Redoes the last undone edit.
658        Redo,
659        /// Redoes the last selection change.
660        RedoSelection,
661        /// Renames the symbol at cursor.
662        Rename,
663        /// Restarts the language server for the current file.
664        RestartLanguageServer,
665        /// Reveals the current file in the system file manager.
666        RevealInFileManager,
667        /// Reverses the order of selected lines.
668        ReverseLines,
669        /// Reloads the file from disk.
670        ReloadFile,
671        /// Rewraps text to fit within the preferred line length.
672        Rewrap,
673        /// Runs flycheck diagnostics.
674        RunFlycheck,
675        /// Scrolls the cursor to the bottom of the viewport.
676        ScrollCursorBottom,
677        /// Scrolls the cursor to the center of the viewport.
678        ScrollCursorCenter,
679        /// Cycles cursor position between center, top, and bottom.
680        ScrollCursorCenterTopBottom,
681        /// Scrolls the cursor to the top of the viewport.
682        ScrollCursorTop,
683        /// Selects all text in the editor.
684        SelectAll,
685        /// Selects all matches of the current selection.
686        SelectAllMatches,
687        /// Selects to the start of the current excerpt.
688        SelectToStartOfExcerpt,
689        /// Selects to the start of the next excerpt.
690        SelectToStartOfNextExcerpt,
691        /// Selects to the end of the current excerpt.
692        SelectToEndOfExcerpt,
693        /// Selects to the end of the previous excerpt.
694        SelectToEndOfPreviousExcerpt,
695        /// Extends selection down.
696        SelectDown,
697        /// Selects the enclosing symbol.
698        SelectEnclosingSymbol,
699        /// Selects the next larger syntax node.
700        SelectLargerSyntaxNode,
701        /// Selects the next syntax node sibling.
702        SelectNextSyntaxNode,
703        /// Selects the previous syntax node sibling.
704        SelectPreviousSyntaxNode,
705        /// Extends selection left.
706        SelectLeft,
707        /// Selects the current line.
708        SelectLine,
709        /// Extends selection down by one page.
710        SelectPageDown,
711        /// Extends selection up by one page.
712        SelectPageUp,
713        /// Extends selection right.
714        SelectRight,
715        /// Selects the next smaller syntax node.
716        SelectSmallerSyntaxNode,
717        /// Selects to the beginning of the document.
718        SelectToBeginning,
719        /// Selects to the end of the document.
720        SelectToEnd,
721        /// Selects to the end of the paragraph.
722        SelectToEndOfParagraph,
723        /// Selects to the end of the next subword.
724        SelectToNextSubwordEnd,
725        /// Selects to the end of the next word.
726        SelectToNextWordEnd,
727        /// Selects to the start of the previous subword.
728        SelectToPreviousSubwordStart,
729        /// Selects to the start of the previous word.
730        SelectToPreviousWordStart,
731        /// Selects to the start of the paragraph.
732        SelectToStartOfParagraph,
733        /// Extends selection up.
734        SelectUp,
735        /// Shows the system character palette.
736        ShowCharacterPalette,
737        /// Shows edit prediction at cursor.
738        ShowEditPrediction,
739        /// Shows signature help for the current function.
740        ShowSignatureHelp,
741        /// Shows word completions.
742        ShowWordCompletions,
743        /// Randomly shuffles selected lines.
744        ShuffleLines,
745        /// Navigates to the next signature in the signature help popup.
746        SignatureHelpNext,
747        /// Navigates to the previous signature in the signature help popup.
748        SignatureHelpPrevious,
749        /// Sorts selected lines by length.
750        SortLinesByLength,
751        /// Sorts selected lines case-insensitively.
752        SortLinesCaseInsensitive,
753        /// Sorts selected lines case-sensitively.
754        SortLinesCaseSensitive,
755        /// Stops the language server for the current file.
756        StopLanguageServer,
757        /// Switches between source and header files.
758        SwitchSourceHeader,
759        /// Inserts a tab character or indents.
760        Tab,
761        /// Removes a tab character or outdents.
762        Backtab,
763        /// Toggles a breakpoint at the current line.
764        ToggleBreakpoint,
765        /// Toggles the case of selected text.
766        ToggleCase,
767        /// Disables the breakpoint at the current line.
768        DisableBreakpoint,
769        /// Enables the breakpoint at the current line.
770        EnableBreakpoint,
771        /// Edits the log message for a breakpoint.
772        EditLogBreakpoint,
773        /// Toggles automatic signature help.
774        ToggleAutoSignatureHelp,
775        /// Toggles inline git blame display.
776        ToggleGitBlameInline,
777        /// Opens the git commit for the blame at cursor.
778        OpenGitBlameCommit,
779        /// Toggles the diagnostics panel.
780        ToggleDiagnostics,
781        /// Toggles indent guides display.
782        ToggleIndentGuides,
783        /// Toggles inlay hints display.
784        ToggleInlayHints,
785        /// Toggles inline values display.
786        ToggleInlineValues,
787        /// Toggles inline diagnostics display.
788        ToggleInlineDiagnostics,
789        /// Toggles edit prediction feature.
790        ToggleEditPrediction,
791        /// Toggles line numbers display.
792        ToggleLineNumbers,
793        /// Toggles the minimap display.
794        ToggleMinimap,
795        /// Swaps the start and end of the current selection.
796        SwapSelectionEnds,
797        /// Sets a mark at the current position.
798        SetMark,
799        /// Toggles relative line numbers display.
800        ToggleRelativeLineNumbers,
801        /// Toggles diff display for selected hunks.
802        #[action(deprecated_aliases = ["editor::ToggleHunkDiff"])]
803        ToggleSelectedDiffHunks,
804        /// Toggles the selection menu.
805        ToggleSelectionMenu,
806        /// Toggles soft wrap mode.
807        ToggleSoftWrap,
808        /// Toggles the tab bar display.
809        ToggleTabBar,
810        /// Transposes characters around cursor.
811        Transpose,
812        /// Undoes the last edit.
813        Undo,
814        /// Undoes the last selection change.
815        UndoSelection,
816        /// Unfolds all folded regions.
817        UnfoldAll,
818        /// Unfolds lines at cursor.
819        UnfoldLines,
820        /// Unfolds recursively at cursor.
821        UnfoldRecursive,
822        /// Removes duplicate lines (case-insensitive).
823        UniqueLinesCaseInsensitive,
824        /// Removes duplicate lines (case-sensitive).
825        UniqueLinesCaseSensitive,
826        /// Removes the surrounding syntax node (for example brackets, or closures)
827        /// from the current selections.
828        UnwrapSyntaxNode,
829        /// Wraps selections in tag specified by language.
830        WrapSelectionsInTag
831    ]
832);