mirror of
https://github.com/zed-industries/zed.git
synced 2025-01-12 13:24:19 +00:00
linux: various fixes across the crates to make it compile
This commit is contained in:
parent
7c7aad5e76
commit
2e32f5867e
7 changed files with 11 additions and 9 deletions
|
@ -3,13 +3,13 @@ use crate::{
|
||||||
PlatformTextSystem, RenderGlyphParams, Size,
|
PlatformTextSystem, RenderGlyphParams, Size,
|
||||||
};
|
};
|
||||||
use anyhow::Result;
|
use anyhow::Result;
|
||||||
use std::sync::Arc;
|
use std::borrow::Cow;
|
||||||
|
|
||||||
pub(crate) struct TestTextSystem {}
|
pub(crate) struct TestTextSystem {}
|
||||||
|
|
||||||
#[allow(unused)]
|
#[allow(unused)]
|
||||||
impl PlatformTextSystem for TestTextSystem {
|
impl PlatformTextSystem for TestTextSystem {
|
||||||
fn add_fonts(&self, fonts: &[Arc<Vec<u8>>]) -> Result<()> {
|
fn add_fonts(&self, fonts: Vec<Cow<'static, [u8]>>) -> Result<()> {
|
||||||
unimplemented!()
|
unimplemented!()
|
||||||
}
|
}
|
||||||
fn all_font_names(&self) -> Vec<String> {
|
fn all_font_names(&self) -> Vec<String> {
|
||||||
|
|
|
@ -19,7 +19,7 @@ test-support = [
|
||||||
"collections/test-support",
|
"collections/test-support",
|
||||||
"gpui/test-support",
|
"gpui/test-support",
|
||||||
"live_kit_server",
|
"live_kit_server",
|
||||||
"nanoid",
|
#"nanoid",
|
||||||
]
|
]
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
|
@ -32,7 +32,7 @@ gpui = { path = "../gpui", optional = true }
|
||||||
live_kit_server = { path = "../live_kit_server", optional = true }
|
live_kit_server = { path = "../live_kit_server", optional = true }
|
||||||
log.workspace = true
|
log.workspace = true
|
||||||
media = { path = "../media" }
|
media = { path = "../media" }
|
||||||
nanoid = { version ="0.4", optional = true}
|
nanoid = "0.4" #TODO: optional
|
||||||
parking_lot.workspace = true
|
parking_lot.workspace = true
|
||||||
postage.workspace = true
|
postage.workspace = true
|
||||||
|
|
||||||
|
|
|
@ -3,7 +3,7 @@ use anyhow::{anyhow, Context, Result};
|
||||||
use async_trait::async_trait;
|
use async_trait::async_trait;
|
||||||
use collections::{BTreeMap, HashMap, HashSet};
|
use collections::{BTreeMap, HashMap, HashSet};
|
||||||
use futures::Stream;
|
use futures::Stream;
|
||||||
use gpui::BackgroundExecutor;
|
use gpui::{BackgroundExecutor, ImageSource};
|
||||||
use live_kit_server::{proto, token};
|
use live_kit_server::{proto, token};
|
||||||
#[cfg(target_os = "macos")]
|
#[cfg(target_os = "macos")]
|
||||||
use media::core_video::CVImageBuffer;
|
use media::core_video::CVImageBuffer;
|
||||||
|
@ -846,8 +846,7 @@ impl Frame {
|
||||||
self.height
|
self.height
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(target_os = "macos")]
|
pub fn image(&self) -> ImageSource {
|
||||||
pub fn image(&self) -> CVImageBuffer {
|
|
||||||
unimplemented!("you can't call this in test mode")
|
unimplemented!("you can't call this in test mode")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -8,6 +8,7 @@ use core_foundation::{
|
||||||
base::{CFTypeID, TCFType},
|
base::{CFTypeID, TCFType},
|
||||||
declare_TCFType, impl_CFTypeDescription, impl_TCFType,
|
declare_TCFType, impl_CFTypeDescription, impl_TCFType,
|
||||||
};
|
};
|
||||||
|
#[cfg(target_os = "macos")]
|
||||||
use std::ffi::c_void;
|
use std::ffi::c_void;
|
||||||
|
|
||||||
#[cfg(target_os = "macos")]
|
#[cfg(target_os = "macos")]
|
||||||
|
|
|
@ -124,7 +124,7 @@ impl Project {
|
||||||
// Paths are not strings so we need to jump through some hoops to format the command without `format!`
|
// 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());
|
let mut command = Vec::from(activate_command.as_bytes());
|
||||||
command.push(b' ');
|
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');
|
command.push(b'\n');
|
||||||
|
|
||||||
terminal_handle.update(cx, |this, _| this.input_bytes(command));
|
terminal_handle.update(cx, |this, _| this.input_bytes(command));
|
||||||
|
|
|
@ -1,6 +1,5 @@
|
||||||
use gpui::{Menu, MenuItem, OsAction};
|
use gpui::{Menu, MenuItem, OsAction};
|
||||||
|
|
||||||
#[cfg(target_os = "macos")]
|
|
||||||
pub fn app_menus() -> Vec<Menu<'static>> {
|
pub fn app_menus() -> Vec<Menu<'static>> {
|
||||||
use zed_actions::Quit;
|
use zed_actions::Quit;
|
||||||
|
|
||||||
|
|
|
@ -11,6 +11,7 @@ use db::kvp::KEY_VALUE_STORE;
|
||||||
use editor::Editor;
|
use editor::Editor;
|
||||||
use env_logger::Builder;
|
use env_logger::Builder;
|
||||||
use fs::RealFs;
|
use fs::RealFs;
|
||||||
|
#[cfg(target_os = "macos")]
|
||||||
use fsevent::StreamFlags;
|
use fsevent::StreamFlags;
|
||||||
use futures::StreamExt;
|
use futures::StreamExt;
|
||||||
use gpui::{App, AppContext, AsyncAppContext, Context, SemanticVersion, Task};
|
use gpui::{App, AppContext, AsyncAppContext, Context, SemanticVersion, Task};
|
||||||
|
@ -173,6 +174,7 @@ fn main() {
|
||||||
assistant::init(cx);
|
assistant::init(cx);
|
||||||
|
|
||||||
load_user_themes_in_background(fs.clone(), cx);
|
load_user_themes_in_background(fs.clone(), cx);
|
||||||
|
#[cfg(target_os = "macos")]
|
||||||
watch_themes(fs.clone(), cx);
|
watch_themes(fs.clone(), cx);
|
||||||
|
|
||||||
cx.spawn(|_| watch_languages(fs.clone(), languages.clone()))
|
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.
|
/// 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) {
|
fn watch_themes(fs: Arc<dyn fs::Fs>, cx: &mut AppContext) {
|
||||||
cx.spawn(|cx| async move {
|
cx.spawn(|cx| async move {
|
||||||
let mut events = fs
|
let mut events = fs
|
||||||
|
|
Loading…
Reference in a new issue