lib.rs

 1use gpui::{actions, impl_actions};
 2use serde::Deserialize;
 3
 4// If the zed binary doesn't use anything in this crate, it will be optimized away
 5// and the actions won't initialize. So we just provide an empty initialization function
 6// to be called from main.
 7//
 8// These may provide relevant context:
 9// https://github.com/rust-lang/rust/issues/47384
10// https://github.com/mmastrac/rust-ctor/issues/280
11pub fn init() {}
12
13#[derive(Clone, PartialEq, Deserialize)]
14pub struct OpenBrowser {
15    pub url: String,
16}
17
18#[derive(Clone, PartialEq, Deserialize)]
19pub struct OpenZedUrl {
20    pub url: String,
21}
22
23impl_actions!(zed, [OpenBrowser, OpenZedUrl]);
24
25actions!(
26    zed,
27    [
28        OpenSettings,
29        OpenDefaultKeymap,
30        OpenAccountSettings,
31        OpenServerSettings,
32        Quit,
33        OpenKeymap,
34        About,
35        OpenLicenses,
36        OpenTelemetryLog,
37        DecreaseBufferFontSize,
38        IncreaseBufferFontSize,
39        ResetBufferFontSize,
40        DecreaseUiFontSize,
41        IncreaseUiFontSize,
42        ResetUiFontSize
43    ]
44);
45
46#[derive(Clone, Default, Deserialize, PartialEq)]
47pub struct InlineAssist {
48    pub prompt: Option<String>,
49}
50
51impl_actions!(assistant, [InlineAssist]);