Code at the speed of thought – Zed is a high-performance, multiplayer code editor from the creators of Atom and Tree-sitter.
linux: various fixes across the crates to make it compile
Dzmitry Malyshau2e32f5867ef1
diff --git a/crates/gpui/src/platform/test/text_system.rs b/crates/gpui/src/platform/test/text_system.rsindex c72ee6f00c1..d7847f10128 100644--- a/crates/gpui/src/platform/test/text_system.rs+++ b/crates/gpui/src/platform/test/text_system.rs@@ -3,13 +3,13 @@ use crate::{PlatformTextSystem, RenderGlyphParams, Size,};use anyhow::Result;-use std::sync::Arc;+use std::borrow::Cow;pub(crate) struct TestTextSystem {}#[allow(unused)]impl PlatformTextSystem for TestTextSystem {- fn add_fonts(&self, fonts: &[Arc<Vec<u8>>]) -> Result<()> {+ fn add_fonts(&self, fonts: Vec<Cow<'static, [u8]>>) -> Result<()> {unimplemented!()}fn all_font_names(&self) -> Vec<String> {diff --git a/crates/live_kit_client/Cargo.toml b/crates/live_kit_client/Cargo.tomlindex 3aeba54af04..a187a172929 100644--- a/crates/live_kit_client/Cargo.toml+++ b/crates/live_kit_client/Cargo.toml@@ -19,7 +19,7 @@ test-support = ["collections/test-support","gpui/test-support","live_kit_server",- "nanoid",+ #"nanoid",][dependencies]@@ -32,7 +32,7 @@ gpui = { path = "../gpui", optional = true }live_kit_server = { path = "../live_kit_server", optional = true }log.workspace = truemedia = { path = "../media" }-nanoid = { version ="0.4", optional = true}+nanoid = "0.4" #TODO: optionalparking_lot.workspace = truepostage.workspace = truediff --git a/crates/live_kit_client/src/test.rs b/crates/live_kit_client/src/test.rsindex 0de5bada341..aa2c91febb9 100644--- a/crates/live_kit_client/src/test.rs+++ b/crates/live_kit_client/src/test.rs@@ -3,7 +3,7 @@ use anyhow::{anyhow, Context, Result};use async_trait::async_trait;use collections::{BTreeMap, HashMap, HashSet};use futures::Stream;-use gpui::BackgroundExecutor;+use gpui::{BackgroundExecutor, ImageSource};use live_kit_server::{proto, token};#[cfg(target_os = "macos")]use media::core_video::CVImageBuffer;@@ -846,8 +846,7 @@ impl Frame {self.height}- #[cfg(target_os = "macos")]- pub fn image(&self) -> CVImageBuffer {+ pub fn image(&self) -> ImageSource {unimplemented!("you can't call this in test mode")}}diff --git a/crates/media/src/media.rs b/crates/media/src/media.rsindex 8d24e45cf21..8757249c319 100644--- a/crates/media/src/media.rs+++ b/crates/media/src/media.rs@@ -8,6 +8,7 @@ use core_foundation::{base::{CFTypeID, TCFType},declare_TCFType, impl_CFTypeDescription, impl_TCFType,};+#[cfg(target_os = "macos")]use std::ffi::c_void;#[cfg(target_os = "macos")]diff --git a/crates/project/src/terminals.rs b/crates/project/src/terminals.rsindex 0f314f50335..8c5156f3cbe 100644--- a/crates/project/src/terminals.rs+++ b/crates/project/src/terminals.rs@@ -124,7 +124,7 @@ impl Project {// Paths are not strings so we need to jump through some hoops to format the command without `format!`let mut command = Vec::from(activate_command.as_bytes());command.push(b' ');- command.extend_from_slice(activate_script.as_os_str().as_bytes());+ command.extend_from_slice(activate_script.as_os_str().as_encoded_bytes());command.push(b'\n');terminal_handle.update(cx, |this, _| this.input_bytes(command));diff --git a/crates/zed/src/app_menus.rs b/crates/zed/src/app_menus.rsindex fc063a620f1..40d20d61ef3 100644--- a/crates/zed/src/app_menus.rs+++ b/crates/zed/src/app_menus.rs@@ -1,6 +1,5 @@use gpui::{Menu, MenuItem, OsAction};-#[cfg(target_os = "macos")]pub fn app_menus() -> Vec<Menu<'static>> {use zed_actions::Quit;diff --git a/crates/zed/src/main.rs b/crates/zed/src/main.rsindex 1666b23f07a..1ae1feffde6 100644--- a/crates/zed/src/main.rs+++ b/crates/zed/src/main.rs@@ -11,6 +11,7 @@ use db::kvp::KEY_VALUE_STORE;use editor::Editor;use env_logger::Builder;use fs::RealFs;+#[cfg(target_os = "macos")]use fsevent::StreamFlags;use futures::StreamExt;use gpui::{App, AppContext, AsyncAppContext, Context, SemanticVersion, Task};@@ -173,6 +174,7 @@ fn main() {assistant::init(cx);load_user_themes_in_background(fs.clone(), cx);+ #[cfg(target_os = "macos")]watch_themes(fs.clone(), cx);cx.spawn(|_| watch_languages(fs.clone(), languages.clone()))@@ -916,6 +918,7 @@ fn load_user_themes_in_background(fs: Arc<dyn fs::Fs>, cx: &mut AppContext) {}/// Spawns a background task to watch the themes directory for changes.+#[cfg(target_os = "macos")]fn watch_themes(fs: Arc<dyn fs::Fs>, cx: &mut AppContext) {cx.spawn(|cx| async move {let mut events = fs