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