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