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        /// Goes to the next snippet tabstop if one exists.
625        NextSnippetTabstop,
626        /// Opens the context menu at cursor position.
627        OpenContextMenu,
628        /// Opens excerpts from the current file.
629        OpenExcerpts,
630        /// Opens excerpts in a split pane.
631        OpenExcerptsSplit,
632        /// Opens the proposed changes editor.
633        OpenProposedChangesEditor,
634        /// Opens documentation for the symbol at cursor.
635        OpenDocs,
636        /// Opens a permalink to the current line.
637        OpenPermalinkToLine,
638        /// Opens the file whose name is selected in the editor.
639        #[action(deprecated_aliases = ["editor::OpenFile"])]
640        OpenSelectedFilename,
641        /// Opens all selections in a multibuffer.
642        OpenSelectionsInMultibuffer,
643        /// Opens the URL at cursor position.
644        OpenUrl,
645        /// Organizes import statements.
646        OrganizeImports,
647        /// Decreases indentation of selected lines.
648        Outdent,
649        /// Automatically adjusts indentation based on context.
650        AutoIndent,
651        /// Scrolls down by one page.
652        PageDown,
653        /// Scrolls up by one page.
654        PageUp,
655        /// Pastes from clipboard.
656        Paste,
657        /// Navigates to the previous edit prediction.
658        PreviousEditPrediction,
659        /// Goes to the previous snippet tabstop if one exists.
660        PreviousSnippetTabstop,
661        /// Redoes the last undone edit.
662        Redo,
663        /// Redoes the last selection change.
664        RedoSelection,
665        /// Renames the symbol at cursor.
666        Rename,
667        /// Restarts the language server for the current file.
668        RestartLanguageServer,
669        /// Reveals the current file in the system file manager.
670        RevealInFileManager,
671        /// Reverses the order of selected lines.
672        ReverseLines,
673        /// Reloads the file from disk.
674        ReloadFile,
675        /// Rewraps text to fit within the preferred line length.
676        Rewrap,
677        /// Runs flycheck diagnostics.
678        RunFlycheck,
679        /// Scrolls the cursor to the bottom of the viewport.
680        ScrollCursorBottom,
681        /// Scrolls the cursor to the center of the viewport.
682        ScrollCursorCenter,
683        /// Cycles cursor position between center, top, and bottom.
684        ScrollCursorCenterTopBottom,
685        /// Scrolls the cursor to the top of the viewport.
686        ScrollCursorTop,
687        /// Selects all text in the editor.
688        SelectAll,
689        /// Selects all matches of the current selection.
690        SelectAllMatches,
691        /// Selects to the start of the current excerpt.
692        SelectToStartOfExcerpt,
693        /// Selects to the start of the next excerpt.
694        SelectToStartOfNextExcerpt,
695        /// Selects to the end of the current excerpt.
696        SelectToEndOfExcerpt,
697        /// Selects to the end of the previous excerpt.
698        SelectToEndOfPreviousExcerpt,
699        /// Extends selection down.
700        SelectDown,
701        /// Selects the enclosing symbol.
702        SelectEnclosingSymbol,
703        /// Selects the next larger syntax node.
704        SelectLargerSyntaxNode,
705        /// Selects the next syntax node sibling.
706        SelectNextSyntaxNode,
707        /// Selects the previous syntax node sibling.
708        SelectPreviousSyntaxNode,
709        /// Extends selection left.
710        SelectLeft,
711        /// Selects the current line.
712        SelectLine,
713        /// Extends selection down by one page.
714        SelectPageDown,
715        /// Extends selection up by one page.
716        SelectPageUp,
717        /// Extends selection right.
718        SelectRight,
719        /// Selects the next smaller syntax node.
720        SelectSmallerSyntaxNode,
721        /// Selects to the beginning of the document.
722        SelectToBeginning,
723        /// Selects to the end of the document.
724        SelectToEnd,
725        /// Selects to the end of the paragraph.
726        SelectToEndOfParagraph,
727        /// Selects to the end of the next subword.
728        SelectToNextSubwordEnd,
729        /// Selects to the end of the next word.
730        SelectToNextWordEnd,
731        /// Selects to the start of the previous subword.
732        SelectToPreviousSubwordStart,
733        /// Selects to the start of the previous word.
734        SelectToPreviousWordStart,
735        /// Selects to the start of the paragraph.
736        SelectToStartOfParagraph,
737        /// Extends selection up.
738        SelectUp,
739        /// Shows the system character palette.
740        ShowCharacterPalette,
741        /// Shows edit prediction at cursor.
742        ShowEditPrediction,
743        /// Shows signature help for the current function.
744        ShowSignatureHelp,
745        /// Shows word completions.
746        ShowWordCompletions,
747        /// Randomly shuffles selected lines.
748        ShuffleLines,
749        /// Navigates to the next signature in the signature help popup.
750        SignatureHelpNext,
751        /// Navigates to the previous signature in the signature help popup.
752        SignatureHelpPrevious,
753        /// Sorts selected lines by length.
754        SortLinesByLength,
755        /// Sorts selected lines case-insensitively.
756        SortLinesCaseInsensitive,
757        /// Sorts selected lines case-sensitively.
758        SortLinesCaseSensitive,
759        /// Stops the language server for the current file.
760        StopLanguageServer,
761        /// Switches between source and header files.
762        SwitchSourceHeader,
763        /// Inserts a tab character or indents.
764        Tab,
765        /// Removes a tab character or outdents.
766        Backtab,
767        /// Toggles a breakpoint at the current line.
768        ToggleBreakpoint,
769        /// Toggles the case of selected text.
770        ToggleCase,
771        /// Disables the breakpoint at the current line.
772        DisableBreakpoint,
773        /// Enables the breakpoint at the current line.
774        EnableBreakpoint,
775        /// Edits the log message for a breakpoint.
776        EditLogBreakpoint,
777        /// Toggles automatic signature help.
778        ToggleAutoSignatureHelp,
779        /// Toggles inline git blame display.
780        ToggleGitBlameInline,
781        /// Opens the git commit for the blame at cursor.
782        OpenGitBlameCommit,
783        /// Toggles the diagnostics panel.
784        ToggleDiagnostics,
785        /// Toggles indent guides display.
786        ToggleIndentGuides,
787        /// Toggles inlay hints display.
788        ToggleInlayHints,
789        /// Toggles inline values display.
790        ToggleInlineValues,
791        /// Toggles inline diagnostics display.
792        ToggleInlineDiagnostics,
793        /// Toggles edit prediction feature.
794        ToggleEditPrediction,
795        /// Toggles line numbers display.
796        ToggleLineNumbers,
797        /// Toggles the minimap display.
798        ToggleMinimap,
799        /// Swaps the start and end of the current selection.
800        SwapSelectionEnds,
801        /// Sets a mark at the current position.
802        SetMark,
803        /// Toggles relative line numbers display.
804        ToggleRelativeLineNumbers,
805        /// Toggles diff display for selected hunks.
806        #[action(deprecated_aliases = ["editor::ToggleHunkDiff"])]
807        ToggleSelectedDiffHunks,
808        /// Toggles the selection menu.
809        ToggleSelectionMenu,
810        /// Toggles soft wrap mode.
811        ToggleSoftWrap,
812        /// Toggles the tab bar display.
813        ToggleTabBar,
814        /// Transposes characters around cursor.
815        Transpose,
816        /// Undoes the last edit.
817        Undo,
818        /// Undoes the last selection change.
819        UndoSelection,
820        /// Unfolds all folded regions.
821        UnfoldAll,
822        /// Unfolds lines at cursor.
823        UnfoldLines,
824        /// Unfolds recursively at cursor.
825        UnfoldRecursive,
826        /// Removes duplicate lines (case-insensitive).
827        UniqueLinesCaseInsensitive,
828        /// Removes duplicate lines (case-sensitive).
829        UniqueLinesCaseSensitive,
830        /// Removes the surrounding syntax node (for example brackets, or closures)
831        /// from the current selections.
832        UnwrapSyntaxNode,
833        /// Wraps selections in tag specified by language.
834        WrapSelectionsInTag
835    ]
836);