From 3734a390b2757aa221b752f93c7219a816b0cefa Mon Sep 17 00:00:00 2001 From: Mikayla Date: Wed, 7 Feb 2024 11:39:26 -0800 Subject: [PATCH] Mark TODOs and prep for merging main --- Cargo.toml | 2 +- crates/gpui/screenshot.png | Bin 9562 -> 0 bytes crates/gpui/src/platform/linux/blade_belt.rs | 4 +-- .../gpui/src/platform/linux/blade_renderer.rs | 2 +- crates/gpui/src/platform/linux/dispatcher.rs | 2 +- crates/gpui/src/platform/linux/platform.rs | 15 ++++++++-- crates/gpui/src/platform/linux/text_system.rs | 28 ++++++++++++++++-- crates/gpui/src/platform/linux/window.rs | 22 ++++++++++++++ crates/gpui/src/platform/test/platform.rs | 6 +++- crates/gpui/src/platform/test/text_system.rs | 1 + crates/project/src/terminals.rs | 4 +-- crates/zed/src/languages.rs | 3 +- crates/zed/src/main.rs | 3 +- 13 files changed, 77 insertions(+), 15 deletions(-) delete mode 100644 crates/gpui/screenshot.png diff --git a/Cargo.toml b/Cargo.toml index 26cd9ab039..a4e51e6aae 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -185,7 +185,7 @@ wasmtime = { git = "https://github.com/bytecodealliance/wasmtime", rev = "v16.0. split-debuginfo = "unpacked" debug = "limited" -# TODO - Remove this +# todo!(linux) - Remove this [profile.dev.package.blade-graphics] split-debuginfo = "off" debug = "full" diff --git a/crates/gpui/screenshot.png b/crates/gpui/screenshot.png deleted file mode 100644 index 50597680f03024039943557738252f4270e19c3f..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 9562 zcmaKSbyQT}7w;XqYv>k5Qc6091__657*a*LOBgyVqyzyOKw#()6{I_*yFp5j5@CQL z-r)DG-+%ATT4(mzpL2HJd)7MV>>Cf&RVO84Bmw|{R8vDm9{{j0T`YhA8$&t@@AYB` z$Xj1s38)xi{)J(1o+#=l0zma!;!9gx0Kf*I+J>sPlRzLsLP8=UA_4*ee0+RtY-}tn zEHD_nx3~A_&!3~Cqn|&2wzsz@CnrC9_D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;0Ywnuqz)gUr!X(@94M;KlR_Fzxm?W{`YKG*xv~ JDwJRm{|DkQwW$CA diff --git a/crates/gpui/src/platform/linux/blade_belt.rs b/crates/gpui/src/platform/linux/blade_belt.rs index b0e4be5893..2562097cbb 100644 --- a/crates/gpui/src/platform/linux/blade_belt.rs +++ b/crates/gpui/src/platform/linux/blade_belt.rs @@ -75,11 +75,11 @@ impl BladeBelt { chunk.into() } - //Note: assuming T: bytemuck::Zeroable + //todo!(linux): enforce T: bytemuck::Zeroable pub fn alloc_data(&mut self, data: &[T], gpu: &gpu::Context) -> gpu::BufferPiece { assert!(!data.is_empty()); let type_alignment = mem::align_of::() as u64; - assert_eq!( + debug_assert_eq!( self.desc.alignment % type_alignment, 0, "Type alignment {} is too big", diff --git a/crates/gpui/src/platform/linux/blade_renderer.rs b/crates/gpui/src/platform/linux/blade_renderer.rs index 492b135cde..128b918ef7 100644 --- a/crates/gpui/src/platform/linux/blade_renderer.rs +++ b/crates/gpui/src/platform/linux/blade_renderer.rs @@ -411,7 +411,7 @@ impl BladeRenderer { } PrimitiveBatch::Paths(paths) => { let mut encoder = pass.with(&self.pipelines.paths); - //TODO: group by texture ID + //todo!(linux): group by texture ID for path in paths { let tile = &self.path_tiles[&path.id]; let tex_info = self.atlas.get_texture_info(tile.texture_id); diff --git a/crates/gpui/src/platform/linux/dispatcher.rs b/crates/gpui/src/platform/linux/dispatcher.rs index 28526d360a..108b8ed354 100644 --- a/crates/gpui/src/platform/linux/dispatcher.rs +++ b/crates/gpui/src/platform/linux/dispatcher.rs @@ -90,7 +90,7 @@ impl PlatformDispatcher for LinuxDispatcher { fn dispatch_on_main_thread(&self, runnable: Runnable) { self.main_sender.send(runnable).unwrap(); // Send a message to the invisible window, forcing - // tha main loop to wake up and dispatch the runnable. + // the main loop to wake up and dispatch the runnable. self.xcb_connection.send_request(&x::SendEvent { propagate: false, destination: x::SendEventDest::Window(self.x_listener_window), diff --git a/crates/gpui/src/platform/linux/platform.rs b/crates/gpui/src/platform/linux/platform.rs index eae7893054..30d2b66bf0 100644 --- a/crates/gpui/src/platform/linux/platform.rs +++ b/crates/gpui/src/platform/linux/platform.rs @@ -170,14 +170,19 @@ impl Platform for LinuxPlatform { self.state.lock().quit_requested = true; } + //todo!(linux) fn restart(&self) {} + //todo!(linux) fn activate(&self, ignoring_other_apps: bool) {} + //todo!(linux) fn hide(&self) {} + //todo!(linux) fn hide_other_apps(&self) {} + //todo!(linux) fn unhide_other_apps(&self) {} fn displays(&self) -> Vec> { @@ -199,6 +204,7 @@ impl Platform for LinuxPlatform { ))) } + //todo!(linux) fn active_window(&self) -> Option { None } @@ -324,6 +330,7 @@ impl Platform for LinuxPlatform { unimplemented!() } + //todo!(linux) fn set_menus(&self, menus: Vec, keymap: &Keymap) {} fn local_timezone(&self) -> UtcOffset { @@ -334,14 +341,16 @@ impl Platform for LinuxPlatform { unimplemented!() } + //todo!(linux) fn set_cursor_style(&self, style: CursorStyle) {} - fn should_auto_hide_scrollbars(&self) -> bool { - false - } + //todo!(linux) + fn should_auto_hide_scrollbars(&self) -> bool {} + //todo!(linux) fn write_to_clipboard(&self, item: ClipboardItem) {} + //todo!(linux) fn read_from_clipboard(&self) -> Option { None } diff --git a/crates/gpui/src/platform/linux/text_system.rs b/crates/gpui/src/platform/linux/text_system.rs index 187ffb526a..53faa936bc 100644 --- a/crates/gpui/src/platform/linux/text_system.rs +++ b/crates/gpui/src/platform/linux/text_system.rs @@ -29,6 +29,7 @@ struct LinuxTextSystemState { postscript_names_by_font_id: HashMap, } +// todo!(linux): Double check this unsafe impl Send for LinuxTextSystemState {} unsafe impl Sync for LinuxTextSystemState {} @@ -54,33 +55,52 @@ impl Default for LinuxTextSystem { #[allow(unused)] impl PlatformTextSystem for LinuxTextSystem { + // todo!(linux) fn add_fonts(&self, fonts: Vec>) -> Result<()> { - Ok(()) //TODO + Ok(()) } + + // todo!(linux) fn all_font_names(&self) -> Vec { Vec::new() } + + // todo!(linux) fn all_font_families(&self) -> Vec { Vec::new() } + + // todo!(linux) fn font_id(&self, descriptor: &Font) -> Result { - Ok(FontId(0)) //TODO + Ok(FontId(0)) } + + // todo!(linux) fn font_metrics(&self, font_id: FontId) -> FontMetrics { unimplemented!() } + + // todo!(linux) fn typographic_bounds(&self, font_id: FontId, glyph_id: GlyphId) -> Result> { unimplemented!() } + + // todo!(linux) fn advance(&self, font_id: FontId, glyph_id: GlyphId) -> Result> { unimplemented!() } + + // todo!(linux) fn glyph_for_char(&self, font_id: FontId, ch: char) -> Option { None } + + // todo!(linux) fn glyph_raster_bounds(&self, params: &RenderGlyphParams) -> Result> { unimplemented!() } + + // todo!(linux) fn rasterize_glyph( &self, params: &RenderGlyphParams, @@ -88,9 +108,13 @@ impl PlatformTextSystem for LinuxTextSystem { ) -> Result<(Size, Vec)> { unimplemented!() } + + // todo!(linux) fn layout_line(&self, text: &str, font_size: Pixels, runs: &[FontRun]) -> LineLayout { LineLayout::default() //TODO } + + // todo!(linux) fn wrap_line( &self, text: &str, diff --git a/crates/gpui/src/platform/linux/window.rs b/crates/gpui/src/platform/linux/window.rs index 7ac7ebf9b4..9ad02039e8 100644 --- a/crates/gpui/src/platform/linux/window.rs +++ b/crates/gpui/src/platform/linux/window.rs @@ -77,6 +77,7 @@ pub(crate) struct LinuxWindowState { #[derive(Clone)] pub(crate) struct LinuxWindow(pub(crate) Arc); +//todo!(linux): Remove other RawWindowHandle implementation unsafe impl blade_rwh::HasRawWindowHandle for RawWindow { fn raw_window_handle(&self) -> blade_rwh::RawWindowHandle { let mut wh = blade_rwh::XcbWindowHandle::empty(); @@ -287,10 +288,12 @@ impl PlatformWindow for LinuxWindow { self.0.inner.lock().scale_factor } + //todo!(linux) fn titlebar_height(&self) -> Pixels { unimplemented!() } + //todo!(linux) fn appearance(&self) -> WindowAppearance { unimplemented!() } @@ -299,10 +302,12 @@ impl PlatformWindow for LinuxWindow { Rc::clone(&self.0.display) } + //todo!(linux) fn mouse_position(&self) -> Point { Point::default() } + //todo!(linux) fn modifiers(&self) -> crate::Modifiers { crate::Modifiers::default() } @@ -311,12 +316,15 @@ impl PlatformWindow for LinuxWindow { self } + //todo!(linux) fn set_input_handler(&mut self, input_handler: PlatformInputHandler) {} + //todo!(linux) fn take_input_handler(&mut self) -> Option { None } + //todo!(linux) fn prompt( &self, _level: crate::PromptLevel, @@ -327,24 +335,36 @@ impl PlatformWindow for LinuxWindow { unimplemented!() } + //todo!(linux) fn activate(&self) {} + //todo!(linux) fn set_title(&mut self, title: &str) {} + //todo!(linux) fn set_edited(&mut self, edited: bool) {} + //todo!(linux), this corresponds to `orderFrontCharacterPalette` on macOS, + // but it looks like the equivalent for Linux is GTK specific: + // + // https://docs.gtk.org/gtk3/signal.Entry.insert-emoji.html + // + // This API might need to change, or we might need to build an emoji picker into GPUI fn show_character_palette(&self) { unimplemented!() } + //todo!(linux) fn minimize(&self) { unimplemented!() } + //todo!(linux) fn zoom(&self) { unimplemented!() } + //todo!(linux) fn toggle_full_screen(&self) { unimplemented!() } @@ -385,10 +405,12 @@ impl PlatformWindow for LinuxWindow { self.0.callbacks.lock().appearance_changed = Some(callback); } + //todo!(linux) fn is_topmost_for_position(&self, _position: crate::Point) -> bool { unimplemented!() } + //todo!(linux) fn invalidate(&self) {} fn draw(&self, scene: &crate::Scene) { diff --git a/crates/gpui/src/platform/test/platform.rs b/crates/gpui/src/platform/test/platform.rs index 464e38b0c4..7052377a00 100644 --- a/crates/gpui/src/platform/test/platform.rs +++ b/crates/gpui/src/platform/test/platform.rs @@ -118,7 +118,11 @@ impl Platform for TestPlatform { } fn text_system(&self) -> Arc { - Arc::new(TestTextSystem {}) + #[cfg(target_os = "linux")] + return Arc::new(TestTextSystem {}); + + #[cfg(target_os = "macos")] + return Arc::new(crate::platform::mac::MacTextSystem::new()); } fn run(&self, _on_finish_launching: Box) { diff --git a/crates/gpui/src/platform/test/text_system.rs b/crates/gpui/src/platform/test/text_system.rs index d7847f1012..0e877aabbd 100644 --- a/crates/gpui/src/platform/test/text_system.rs +++ b/crates/gpui/src/platform/test/text_system.rs @@ -7,6 +7,7 @@ use std::borrow::Cow; pub(crate) struct TestTextSystem {} +//todo!(linux) #[allow(unused)] impl PlatformTextSystem for TestTextSystem { fn add_fonts(&self, fonts: Vec>) -> Result<()> { diff --git a/crates/project/src/terminals.rs b/crates/project/src/terminals.rs index 8c5156f3cb..e125af052d 100644 --- a/crates/project/src/terminals.rs +++ b/crates/project/src/terminals.rs @@ -7,8 +7,8 @@ use terminal::{ Terminal, TerminalBuilder, }; -#[cfg(target_os = "macos")] -use std::os::unix::ffi::OsStrExt; +// #[cfg(target_os = "macos")] +// use std::os::unix::ffi::OsStrExt; pub struct Terminals { pub(crate) local_handles: Vec>, diff --git a/crates/zed/src/languages.rs b/crates/zed/src/languages.rs index 0448cb8ec6..e191ff1b66 100644 --- a/crates/zed/src/languages.rs +++ b/crates/zed/src/languages.rs @@ -280,7 +280,8 @@ pub fn init( ], ); - /// Produces a link error on linux due to duplicated `state_new` symbol + // Produces a link error on linux due to duplicated `state_new` symbol + // todo!(linux): Restore purescript #[cfg(not(target_os = "linux"))] language( "purescript", diff --git a/crates/zed/src/main.rs b/crates/zed/src/main.rs index 73acfdef34..c291773e4a 100644 --- a/crates/zed/src/main.rs +++ b/crates/zed/src/main.rs @@ -257,7 +257,7 @@ fn main() { initialize_workspace(app_state.clone(), cx); if stdout_is_a_pty() { - //TODO: unblock this + //todo!(linux): unblock this #[cfg(not(target_os = "linux"))] upload_panics_and_crashes(http.clone(), cx); cx.activate(true); @@ -919,6 +919,7 @@ fn load_user_themes_in_background(fs: Arc, cx: &mut AppContext) { .detach(); } +//todo!(linux): Port fsevents to linux /// Spawns a background task to watch the themes directory for changes. #[cfg(target_os = "macos")] fn watch_themes(fs: Arc, cx: &mut AppContext) {