ZIm/crates/svg_preview/src/svg_preview.rs
Ben Kunkle 6cd4dbdea1
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 ...
2025-07-02 21:14:33 -04:00

26 lines
637 B
Rust

use gpui::{App, actions};
use workspace::Workspace;
pub mod svg_preview_view;
actions!(
svg,
[
/// Opens an SVG preview for the current file.
OpenPreview,
/// Opens an SVG preview in a split pane.
OpenPreviewToTheSide,
/// Opens a following SVG preview that syncs with the editor.
OpenFollowingPreview
]
);
pub fn init(cx: &mut App) {
cx.observe_new(|workspace: &mut Workspace, window, cx| {
let Some(window) = window else {
return;
};
crate::svg_preview_view::SvgPreviewView::register(workspace, window, cx);
})
.detach();
}