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:
parent
def8bab5a8
commit
6cd4dbdea1
96 changed files with 1467 additions and 78 deletions
|
@ -28,10 +28,26 @@ use crate::{
|
|||
ui_components::table::{Table, TableInteractionState},
|
||||
};
|
||||
|
||||
actions!(zed, [OpenKeymapEditor]);
|
||||
actions!(
|
||||
zed,
|
||||
[
|
||||
/// Opens the keymap editor.
|
||||
OpenKeymapEditor
|
||||
]
|
||||
);
|
||||
|
||||
const KEYMAP_EDITOR_NAMESPACE: &'static str = "keymap_editor";
|
||||
actions!(keymap_editor, [EditBinding, CopyAction, CopyContext]);
|
||||
actions!(
|
||||
keymap_editor,
|
||||
[
|
||||
/// Edits the selected key binding.
|
||||
EditBinding,
|
||||
/// Copies the action name to clipboard.
|
||||
CopyAction,
|
||||
/// Copies the context predicate to clipboard.
|
||||
CopyContext
|
||||
]
|
||||
);
|
||||
|
||||
pub fn init(cx: &mut App) {
|
||||
let keymap_event_channel = KeymapEventChannel::new();
|
||||
|
|
|
@ -29,6 +29,7 @@ impl FeatureFlag for SettingsUiFeatureFlag {
|
|||
const NAME: &'static str = "settings-ui";
|
||||
}
|
||||
|
||||
/// Imports settings from Visual Studio Code.
|
||||
#[derive(Copy, Clone, Debug, Default, PartialEq, Deserialize, JsonSchema, Action)]
|
||||
#[action(namespace = zed)]
|
||||
#[serde(deny_unknown_fields)]
|
||||
|
@ -37,6 +38,7 @@ pub struct ImportVsCodeSettings {
|
|||
pub skip_prompt: bool,
|
||||
}
|
||||
|
||||
/// Imports settings from Cursor editor.
|
||||
#[derive(Copy, Clone, Debug, Default, PartialEq, Deserialize, JsonSchema, Action)]
|
||||
#[action(namespace = zed)]
|
||||
#[serde(deny_unknown_fields)]
|
||||
|
@ -44,7 +46,13 @@ pub struct ImportCursorSettings {
|
|||
#[serde(default)]
|
||||
pub skip_prompt: bool,
|
||||
}
|
||||
actions!(zed, [OpenSettingsEditor]);
|
||||
actions!(
|
||||
zed,
|
||||
[
|
||||
/// Opens the settings editor.
|
||||
OpenSettingsEditor
|
||||
]
|
||||
);
|
||||
|
||||
pub fn init(cx: &mut App) {
|
||||
cx.on_action(|_: &OpenSettingsEditor, cx| {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue