gpui: Store action documentation (#33809)

Closes #ISSUE

Adds a new `documentation` method to actions, that is extracted from doc
comments when using the `actions!` or derive macros.

Additionally, this PR adds doc comments to as many action definitions in
Zed as possible.

Release Notes:

- N/A *or* Added/Fixed/Improved ...
This commit is contained in:
Ben Kunkle
2025-07-02 21:14:33 -04:00
committed by GitHub
parent def8bab5a8
commit 6cd4dbdea1
96 changed files with 1467 additions and 78 deletions
@@ -33,7 +33,12 @@ use zed_actions::{ToggleEnableBreakpoint, UnsetBreakpoint};
actions!(
debugger,
[PreviousBreakpointProperty, NextBreakpointProperty]
[
/// Navigates to the previous breakpoint property in the list.
PreviousBreakpointProperty,
/// Navigates to the next breakpoint property in the list.
NextBreakpointProperty
]
);
#[derive(Clone, Copy, PartialEq)]
pub(crate) enum SelectedBreakpointKind {
@@ -23,7 +23,13 @@ use std::{cell::RefCell, ops::Range, rc::Rc, usize};
use theme::{Theme, ThemeSettings};
use ui::{ContextMenu, Divider, PopoverMenu, SplitButton, Tooltip, prelude::*};
actions!(console, [WatchExpression]);
actions!(
console,
[
/// Adds an expression to the watch list.
WatchExpression
]
);
pub struct Console {
console: Entity<Editor>,
@@ -18,12 +18,19 @@ use util::debug_panic;
actions!(
variable_list,
[
/// Expands the selected variable entry to show its children.
ExpandSelectedEntry,
/// Collapses the selected variable entry to hide its children.
CollapseSelectedEntry,
/// Copies the variable name to the clipboard.
CopyVariableName,
/// Copies the variable value to the clipboard.
CopyVariableValue,
/// Edits the value of the selected variable.
EditVariable,
/// Adds the selected variable to the watch list.
AddWatch,
/// Removes the selected variable from the watch list.
RemoveWatch,
]
);