2023-12-11 18:00:55 +00:00
|
|
|
use gpui::{actions, impl_actions};
|
2023-11-17 01:32:02 +00:00
|
|
|
use serde::Deserialize;
|
2023-11-09 16:54:05 +00:00
|
|
|
|
2023-11-14 01:34:12 +00:00
|
|
|
// If the zed binary doesn't use anything in this crate, it will be optimized away
|
|
|
|
// and the actions won't initialize. So we just provide an empty initialization function
|
|
|
|
// to be called from main.
|
|
|
|
//
|
|
|
|
// These may provide relevant context:
|
|
|
|
// https://github.com/rust-lang/rust/issues/47384
|
|
|
|
// https://github.com/mmastrac/rust-ctor/issues/280
|
|
|
|
pub fn init() {}
|
|
|
|
|
2023-12-11 02:33:38 +00:00
|
|
|
#[derive(Clone, PartialEq, Deserialize)]
|
2023-11-09 16:54:05 +00:00
|
|
|
pub struct OpenBrowser {
|
|
|
|
pub url: String,
|
|
|
|
}
|
2023-11-14 08:06:33 +00:00
|
|
|
|
2023-12-11 02:33:38 +00:00
|
|
|
#[derive(Clone, PartialEq, Deserialize)]
|
2024-01-30 04:50:31 +00:00
|
|
|
pub struct OpenZedUrl {
|
2023-11-09 16:54:05 +00:00
|
|
|
pub url: String,
|
|
|
|
}
|
2023-12-11 02:33:38 +00:00
|
|
|
|
2024-01-30 04:50:31 +00:00
|
|
|
impl_actions!(zed, [OpenBrowser, OpenZedUrl]);
|
2023-12-11 18:00:55 +00:00
|
|
|
|
2023-12-13 21:12:59 +00:00
|
|
|
actions!(zed, [OpenSettings, Quit]);
|