mirror of
https://github.com/zed-industries/zed.git
synced 2024-12-28 01:34:16 +03:00
Remove ! from todo!() in comments (#8643)
This practice makes it difficult to locate todo!s in my code when I'm working. Let's take out the bang if we want to keep doing this. Release Notes: - N/A
This commit is contained in:
parent
dab886f479
commit
4cc4f08a53
4
.github/workflows/ci.yml
vendored
4
.github/workflows/ci.yml
vendored
@ -99,7 +99,7 @@ jobs:
|
|||||||
- name: Build other binaries and features
|
- name: Build other binaries and features
|
||||||
run: cargo build --workspace --bins --all-features; cargo check -p gpui --features "macos-blade"
|
run: cargo build --workspace --bins --all-features; cargo check -p gpui --features "macos-blade"
|
||||||
|
|
||||||
# todo!(linux): Actually run the tests
|
# todo(linux): Actually run the tests
|
||||||
linux_tests:
|
linux_tests:
|
||||||
name: (Linux) Run Clippy and tests
|
name: (Linux) Run Clippy and tests
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
@ -126,7 +126,7 @@ jobs:
|
|||||||
- name: Build Zed
|
- name: Build Zed
|
||||||
run: cargo build -p zed
|
run: cargo build -p zed
|
||||||
|
|
||||||
# todo!(windows): Actually run the tests
|
# todo(windows): Actually run the tests
|
||||||
windows_tests:
|
windows_tests:
|
||||||
name: (Windows) Run Clippy and tests
|
name: (Windows) Run Clippy and tests
|
||||||
runs-on: windows-latest
|
runs-on: windows-latest
|
||||||
|
@ -310,7 +310,7 @@ pathfinder_simd = { git = "https://github.com/servo/pathfinder.git", rev = "e4fc
|
|||||||
split-debuginfo = "unpacked"
|
split-debuginfo = "unpacked"
|
||||||
debug = "limited"
|
debug = "limited"
|
||||||
|
|
||||||
# todo!(linux) - Remove this
|
# todo(linux) - Remove this
|
||||||
[profile.dev.package.blade-graphics]
|
[profile.dev.package.blade-graphics]
|
||||||
split-debuginfo = "off"
|
split-debuginfo = "off"
|
||||||
debug = "full"
|
debug = "full"
|
||||||
|
@ -73,7 +73,7 @@
|
|||||||
"ctrl-n": "editor::MoveDown",
|
"ctrl-n": "editor::MoveDown",
|
||||||
"ctrl-b": "editor::MoveLeft",
|
"ctrl-b": "editor::MoveLeft",
|
||||||
"ctrl-f": "editor::MoveRight",
|
"ctrl-f": "editor::MoveRight",
|
||||||
"ctrl-shift-l": "editor::NextScreen", // todo!(linux): What is this
|
"ctrl-shift-l": "editor::NextScreen", // todo(linux): What is this
|
||||||
"alt-left": "editor::MoveToPreviousWordStart",
|
"alt-left": "editor::MoveToPreviousWordStart",
|
||||||
"alt-b": "editor::MoveToPreviousWordStart",
|
"alt-b": "editor::MoveToPreviousWordStart",
|
||||||
"alt-right": "editor::MoveToNextWordEnd",
|
"alt-right": "editor::MoveToNextWordEnd",
|
||||||
@ -388,7 +388,7 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
// Bindings from Sublime Text
|
// Bindings from Sublime Text
|
||||||
// todo!(linux) make sure these match linux bindings or remove above comment?
|
// todo(linux) make sure these match linux bindings or remove above comment?
|
||||||
{
|
{
|
||||||
"context": "Editor",
|
"context": "Editor",
|
||||||
"bindings": {
|
"bindings": {
|
||||||
@ -412,7 +412,7 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
// Bindings from Atom
|
// Bindings from Atom
|
||||||
// todo!(linux) make sure these match linux bindings or remove above comment?
|
// todo(linux) make sure these match linux bindings or remove above comment?
|
||||||
{
|
{
|
||||||
"context": "Pane",
|
"context": "Pane",
|
||||||
"bindings": {
|
"bindings": {
|
||||||
|
@ -774,7 +774,7 @@ impl AssistantPanel {
|
|||||||
} else {
|
} else {
|
||||||
editor.highlight_background::<PendingInlineAssist>(
|
editor.highlight_background::<PendingInlineAssist>(
|
||||||
background_ranges,
|
background_ranges,
|
||||||
|theme| theme.editor_active_line_background, // todo!("use the appropriate color")
|
|theme| theme.editor_active_line_background, // todo("use the appropriate color")
|
||||||
cx,
|
cx,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
@ -156,7 +156,7 @@ mod linux {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// todo!("windows")
|
// todo("windows")
|
||||||
#[cfg(target_os = "windows")]
|
#[cfg(target_os = "windows")]
|
||||||
mod windows {
|
mod windows {
|
||||||
use std::path::Path;
|
use std::path::Path;
|
||||||
|
@ -130,7 +130,7 @@ async fn main() -> Result<()> {
|
|||||||
})
|
})
|
||||||
.await?;
|
.await?;
|
||||||
|
|
||||||
// todo!("windows")
|
// todo("windows")
|
||||||
#[cfg(windows)]
|
#[cfg(windows)]
|
||||||
unimplemented!();
|
unimplemented!();
|
||||||
}
|
}
|
||||||
|
@ -1052,7 +1052,7 @@ impl CollabPanel {
|
|||||||
.indent_step_size(px(20.))
|
.indent_step_size(px(20.))
|
||||||
.selected(is_selected)
|
.selected(is_selected)
|
||||||
.on_click(cx.listener(move |_this, _, _cx| {
|
.on_click(cx.listener(move |_this, _, _cx| {
|
||||||
// todo!()
|
// todo()
|
||||||
}))
|
}))
|
||||||
.start_slot(
|
.start_slot(
|
||||||
h_flex()
|
h_flex()
|
||||||
@ -1531,7 +1531,7 @@ impl CollabPanel {
|
|||||||
id: _id,
|
id: _id,
|
||||||
name: _name,
|
name: _name,
|
||||||
} => {
|
} => {
|
||||||
// todo!()
|
// todo()
|
||||||
}
|
}
|
||||||
|
|
||||||
ListEntry::OutgoingRequest(_) => {}
|
ListEntry::OutgoingRequest(_) => {}
|
||||||
|
@ -197,7 +197,7 @@ pub struct ColorStates {
|
|||||||
|
|
||||||
/// Returns a set of colors for different states of an element.
|
/// Returns a set of colors for different states of an element.
|
||||||
///
|
///
|
||||||
/// todo!("This should take a theme and use appropriate colors from it")
|
/// todo("This should take a theme and use appropriate colors from it")
|
||||||
pub fn states_for_color(color: RGBAColor, is_light: bool) -> ColorStates {
|
pub fn states_for_color(color: RGBAColor, is_light: bool) -> ColorStates {
|
||||||
let adjustment_factor = if is_light { 0.1 } else { -0.1 };
|
let adjustment_factor = if is_light { 0.1 } else { -0.1 };
|
||||||
let hover_adjustment = 1.0 - adjustment_factor;
|
let hover_adjustment = 1.0 - adjustment_factor;
|
||||||
|
@ -117,7 +117,7 @@ pub fn hover_at_inlay(editor: &mut Editor, inlay_hover: InlayHover, cx: &mut Vie
|
|||||||
// Highlight the selected symbol using a background highlight
|
// Highlight the selected symbol using a background highlight
|
||||||
this.highlight_inlay_background::<HoverState>(
|
this.highlight_inlay_background::<HoverState>(
|
||||||
vec![inlay_hover.range],
|
vec![inlay_hover.range],
|
||||||
|theme| theme.element_hover, // todo!("use a proper background here")
|
|theme| theme.element_hover, // todo("use a proper background here")
|
||||||
cx,
|
cx,
|
||||||
);
|
);
|
||||||
this.hover_state.info_popover = Some(hover_popover);
|
this.hover_state.info_popover = Some(hover_popover);
|
||||||
@ -332,7 +332,7 @@ fn show_hover(
|
|||||||
// Highlight the selected symbol using a background highlight
|
// Highlight the selected symbol using a background highlight
|
||||||
this.highlight_background::<HoverState>(
|
this.highlight_background::<HoverState>(
|
||||||
vec![symbol_range],
|
vec![symbol_range],
|
||||||
|theme| theme.element_hover, // todo! update theme
|
|theme| theme.element_hover, // todo update theme
|
||||||
cx,
|
cx,
|
||||||
);
|
);
|
||||||
} else {
|
} else {
|
||||||
|
@ -1343,7 +1343,7 @@ pub fn copy_recursive<'a>(
|
|||||||
.boxed()
|
.boxed()
|
||||||
}
|
}
|
||||||
|
|
||||||
// todo!(windows)
|
// todo(windows)
|
||||||
// can we get file id not open the file twice?
|
// can we get file id not open the file twice?
|
||||||
// https://github.com/rust-lang/rust/issues/63010
|
// https://github.com/rust-lang/rust/issues/63010
|
||||||
#[cfg(target_os = "windows")]
|
#[cfg(target_os = "windows")]
|
||||||
|
@ -96,7 +96,7 @@ objc = "0.2"
|
|||||||
flume = "0.11"
|
flume = "0.11"
|
||||||
open = "5.0.1"
|
open = "5.0.1"
|
||||||
ashpd = "0.7.0"
|
ashpd = "0.7.0"
|
||||||
# todo!(linux) - Technically do not use `randr`, but it doesn't compile otherwise
|
# todo(linux) - Technically do not use `randr`, but it doesn't compile otherwise
|
||||||
xcb = { version = "1.3", features = ["as-raw-xcb-connection", "present", "randr", "xkb"] }
|
xcb = { version = "1.3", features = ["as-raw-xcb-connection", "present", "randr", "xkb"] }
|
||||||
wayland-client= { version = "0.31.2" }
|
wayland-client= { version = "0.31.2" }
|
||||||
wayland-protocols = { version = "0.31.2", features = ["client", "staging", "unstable"] }
|
wayland-protocols = { version = "0.31.2", features = ["client", "staging", "unstable"] }
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
// todo!(linux): remove
|
// todo(linux): remove
|
||||||
#![cfg_attr(target_os = "linux", allow(dead_code))]
|
#![cfg_attr(target_os = "linux", allow(dead_code))]
|
||||||
// todo!("windows"): remove
|
// todo("windows"): remove
|
||||||
#![cfg_attr(windows, allow(dead_code))]
|
#![cfg_attr(windows, allow(dead_code))]
|
||||||
|
|
||||||
mod app_menu;
|
mod app_menu;
|
||||||
@ -63,7 +63,7 @@ pub(crate) fn current_platform() -> Rc<dyn Platform> {
|
|||||||
pub(crate) fn current_platform() -> Rc<dyn Platform> {
|
pub(crate) fn current_platform() -> Rc<dyn Platform> {
|
||||||
Rc::new(LinuxPlatform::new())
|
Rc::new(LinuxPlatform::new())
|
||||||
}
|
}
|
||||||
// todo!("windows")
|
// todo("windows")
|
||||||
#[cfg(target_os = "windows")]
|
#[cfg(target_os = "windows")]
|
||||||
pub(crate) fn current_platform() -> Rc<dyn Platform> {
|
pub(crate) fn current_platform() -> Rc<dyn Platform> {
|
||||||
unimplemented!()
|
unimplemented!()
|
||||||
|
@ -564,7 +564,7 @@ impl BladeRenderer {
|
|||||||
}
|
}
|
||||||
PrimitiveBatch::Paths(paths) => {
|
PrimitiveBatch::Paths(paths) => {
|
||||||
let mut encoder = pass.with(&self.pipelines.paths);
|
let mut encoder = pass.with(&self.pipelines.paths);
|
||||||
//todo!(linux): group by texture ID
|
// todo(linux): group by texture ID
|
||||||
for path in paths {
|
for path in paths {
|
||||||
let tile = &self.path_tiles[&path.id];
|
let tile = &self.path_tiles[&path.id];
|
||||||
let tex_info = self.atlas.get_texture_info(tile.texture_id);
|
let tex_info = self.atlas.get_texture_info(tile.texture_id);
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
#![allow(non_upper_case_globals)]
|
#![allow(non_upper_case_globals)]
|
||||||
#![allow(non_camel_case_types)]
|
#![allow(non_camel_case_types)]
|
||||||
#![allow(non_snake_case)]
|
#![allow(non_snake_case)]
|
||||||
//todo!(linux): remove
|
// todo(linux): remove
|
||||||
#![allow(unused_variables)]
|
#![allow(unused_variables)]
|
||||||
|
|
||||||
use crate::{PlatformDispatcher, TaskLabel};
|
use crate::{PlatformDispatcher, TaskLabel};
|
||||||
|
@ -141,19 +141,19 @@ impl Platform for LinuxPlatform {
|
|||||||
self.inner.loop_signal.stop();
|
self.inner.loop_signal.stop();
|
||||||
}
|
}
|
||||||
|
|
||||||
//todo!(linux)
|
// todo(linux)
|
||||||
fn restart(&self) {}
|
fn restart(&self) {}
|
||||||
|
|
||||||
//todo!(linux)
|
// todo(linux)
|
||||||
fn activate(&self, ignoring_other_apps: bool) {}
|
fn activate(&self, ignoring_other_apps: bool) {}
|
||||||
|
|
||||||
//todo!(linux)
|
// todo(linux)
|
||||||
fn hide(&self) {}
|
fn hide(&self) {}
|
||||||
|
|
||||||
//todo!(linux)
|
// todo(linux)
|
||||||
fn hide_other_apps(&self) {}
|
fn hide_other_apps(&self) {}
|
||||||
|
|
||||||
//todo!(linux)
|
// todo(linux)
|
||||||
fn unhide_other_apps(&self) {}
|
fn unhide_other_apps(&self) {}
|
||||||
|
|
||||||
fn displays(&self) -> Vec<Rc<dyn PlatformDisplay>> {
|
fn displays(&self) -> Vec<Rc<dyn PlatformDisplay>> {
|
||||||
@ -164,7 +164,7 @@ impl Platform for LinuxPlatform {
|
|||||||
self.client.display(id)
|
self.client.display(id)
|
||||||
}
|
}
|
||||||
|
|
||||||
//todo!(linux)
|
// todo(linux)
|
||||||
fn active_window(&self) -> Option<AnyWindowHandle> {
|
fn active_window(&self) -> Option<AnyWindowHandle> {
|
||||||
None
|
None
|
||||||
}
|
}
|
||||||
@ -328,7 +328,7 @@ impl Platform for LinuxPlatform {
|
|||||||
unimplemented!()
|
unimplemented!()
|
||||||
}
|
}
|
||||||
|
|
||||||
//todo!(linux)
|
// todo(linux)
|
||||||
fn set_menus(&self, menus: Vec<Menu>, keymap: &Keymap) {}
|
fn set_menus(&self, menus: Vec<Menu>, keymap: &Keymap) {}
|
||||||
|
|
||||||
fn local_timezone(&self) -> UtcOffset {
|
fn local_timezone(&self) -> UtcOffset {
|
||||||
@ -339,18 +339,18 @@ impl Platform for LinuxPlatform {
|
|||||||
unimplemented!()
|
unimplemented!()
|
||||||
}
|
}
|
||||||
|
|
||||||
//todo!(linux)
|
// todo(linux)
|
||||||
fn set_cursor_style(&self, style: CursorStyle) {}
|
fn set_cursor_style(&self, style: CursorStyle) {}
|
||||||
|
|
||||||
//todo!(linux)
|
// todo(linux)
|
||||||
fn should_auto_hide_scrollbars(&self) -> bool {
|
fn should_auto_hide_scrollbars(&self) -> bool {
|
||||||
false
|
false
|
||||||
}
|
}
|
||||||
|
|
||||||
//todo!(linux)
|
// todo(linux)
|
||||||
fn write_to_clipboard(&self, item: ClipboardItem) {}
|
fn write_to_clipboard(&self, item: ClipboardItem) {}
|
||||||
|
|
||||||
//todo!(linux)
|
// todo(linux)
|
||||||
fn read_from_clipboard(&self) -> Option<ClipboardItem> {
|
fn read_from_clipboard(&self) -> Option<ClipboardItem> {
|
||||||
None
|
None
|
||||||
}
|
}
|
||||||
|
@ -32,7 +32,7 @@ impl LinuxTextSystem {
|
|||||||
pub(crate) fn new() -> Self {
|
pub(crate) fn new() -> Self {
|
||||||
let mut font_system = FontSystem::new();
|
let mut font_system = FontSystem::new();
|
||||||
|
|
||||||
// todo!(linux) make font loading non-blocking
|
// todo(linux) make font loading non-blocking
|
||||||
font_system.db_mut().load_system_fonts();
|
font_system.db_mut().load_system_fonts();
|
||||||
|
|
||||||
Self(RwLock::new(LinuxTextSystemState {
|
Self(RwLock::new(LinuxTextSystemState {
|
||||||
@ -59,7 +59,7 @@ impl PlatformTextSystem for LinuxTextSystem {
|
|||||||
self.0.write().add_fonts(fonts)
|
self.0.write().add_fonts(fonts)
|
||||||
}
|
}
|
||||||
|
|
||||||
// todo!(linux) ensure that this integrates with platform font loading
|
// todo(linux) ensure that this integrates with platform font loading
|
||||||
// do we need to do more than call load_system_fonts()?
|
// do we need to do more than call load_system_fonts()?
|
||||||
fn all_font_names(&self) -> Vec<String> {
|
fn all_font_names(&self) -> Vec<String> {
|
||||||
self.0
|
self.0
|
||||||
@ -71,13 +71,13 @@ impl PlatformTextSystem for LinuxTextSystem {
|
|||||||
.collect()
|
.collect()
|
||||||
}
|
}
|
||||||
|
|
||||||
// todo!(linux)
|
// todo(linux)
|
||||||
fn all_font_families(&self) -> Vec<String> {
|
fn all_font_families(&self) -> Vec<String> {
|
||||||
Vec::new()
|
Vec::new()
|
||||||
}
|
}
|
||||||
|
|
||||||
fn font_id(&self, font: &Font) -> Result<FontId> {
|
fn font_id(&self, font: &Font) -> Result<FontId> {
|
||||||
// todo!(linux): Do we need to use CosmicText's Font APIs? Can we consolidate this to use font_kit?
|
// todo(linux): Do we need to use CosmicText's Font APIs? Can we consolidate this to use font_kit?
|
||||||
let lock = self.0.upgradable_read();
|
let lock = self.0.upgradable_read();
|
||||||
if let Some(font_id) = lock.font_selections.get(font) {
|
if let Some(font_id) = lock.font_selections.get(font) {
|
||||||
Ok(*font_id)
|
Ok(*font_id)
|
||||||
@ -127,13 +127,13 @@ impl PlatformTextSystem for LinuxTextSystem {
|
|||||||
FontMetrics {
|
FontMetrics {
|
||||||
units_per_em: metrics.units_per_em as u32,
|
units_per_em: metrics.units_per_em as u32,
|
||||||
ascent: metrics.ascent,
|
ascent: metrics.ascent,
|
||||||
descent: -metrics.descent, // todo!(linux) confirm this is correct
|
descent: -metrics.descent, // todo(linux) confirm this is correct
|
||||||
line_gap: metrics.leading,
|
line_gap: metrics.leading,
|
||||||
underline_position: metrics.underline_offset,
|
underline_position: metrics.underline_offset,
|
||||||
underline_thickness: metrics.stroke_size,
|
underline_thickness: metrics.stroke_size,
|
||||||
cap_height: metrics.cap_height,
|
cap_height: metrics.cap_height,
|
||||||
x_height: metrics.x_height,
|
x_height: metrics.x_height,
|
||||||
// todo!(linux): Compute this correctly
|
// todo(linux): Compute this correctly
|
||||||
bounding_box: Bounds {
|
bounding_box: Bounds {
|
||||||
origin: point(0.0, 0.0),
|
origin: point(0.0, 0.0),
|
||||||
size: size(metrics.max_width, metrics.ascent + metrics.descent),
|
size: size(metrics.max_width, metrics.ascent + metrics.descent),
|
||||||
@ -146,7 +146,7 @@ impl PlatformTextSystem for LinuxTextSystem {
|
|||||||
let metrics = lock.fonts[font_id.0].as_swash().metrics(&[]);
|
let metrics = lock.fonts[font_id.0].as_swash().metrics(&[]);
|
||||||
let glyph_metrics = lock.fonts[font_id.0].as_swash().glyph_metrics(&[]);
|
let glyph_metrics = lock.fonts[font_id.0].as_swash().glyph_metrics(&[]);
|
||||||
let glyph_id = glyph_id.0 as u16;
|
let glyph_id = glyph_id.0 as u16;
|
||||||
// todo!(linux): Compute this correctly
|
// todo(linux): Compute this correctly
|
||||||
// see https://github.com/servo/font-kit/blob/master/src/loaders/freetype.rs#L614-L620
|
// see https://github.com/servo/font-kit/blob/master/src/loaders/freetype.rs#L614-L620
|
||||||
Ok(Bounds {
|
Ok(Bounds {
|
||||||
origin: point(0.0, 0.0),
|
origin: point(0.0, 0.0),
|
||||||
@ -181,7 +181,7 @@ impl PlatformTextSystem for LinuxTextSystem {
|
|||||||
self.0.write().layout_line(text, font_size, runs)
|
self.0.write().layout_line(text, font_size, runs)
|
||||||
}
|
}
|
||||||
|
|
||||||
// todo!(linux) Confirm that this has been superseded by the LineWrapper
|
// todo(linux) Confirm that this has been superseded by the LineWrapper
|
||||||
fn wrap_line(
|
fn wrap_line(
|
||||||
&self,
|
&self,
|
||||||
text: &str,
|
text: &str,
|
||||||
@ -256,7 +256,7 @@ impl LinuxTextSystemState {
|
|||||||
}
|
}
|
||||||
|
|
||||||
fn is_emoji(&self, font_id: FontId) -> bool {
|
fn is_emoji(&self, font_id: FontId) -> bool {
|
||||||
// todo!(linux): implement this correctly
|
// todo(linux): implement this correctly
|
||||||
self.postscript_names_by_font_id
|
self.postscript_names_by_font_id
|
||||||
.get(&font_id)
|
.get(&font_id)
|
||||||
.map_or(false, |postscript_name| {
|
.map_or(false, |postscript_name| {
|
||||||
@ -264,7 +264,7 @@ impl LinuxTextSystemState {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
// todo!(linux) both raster functions have problems because I am not sure this is the correct mapping from cosmic text to gpui system
|
// todo(linux) both raster functions have problems because I am not sure this is the correct mapping from cosmic text to gpui system
|
||||||
fn raster_bounds(&mut self, params: &RenderGlyphParams) -> Result<Bounds<DevicePixels>> {
|
fn raster_bounds(&mut self, params: &RenderGlyphParams) -> Result<Bounds<DevicePixels>> {
|
||||||
let font = &self.fonts[params.font_id.0];
|
let font = &self.fonts[params.font_id.0];
|
||||||
let font_system = &mut self.font_system;
|
let font_system = &mut self.font_system;
|
||||||
@ -297,7 +297,7 @@ impl LinuxTextSystemState {
|
|||||||
if glyph_bounds.size.width.0 == 0 || glyph_bounds.size.height.0 == 0 {
|
if glyph_bounds.size.width.0 == 0 || glyph_bounds.size.height.0 == 0 {
|
||||||
Err(anyhow!("glyph bounds are empty"))
|
Err(anyhow!("glyph bounds are empty"))
|
||||||
} else {
|
} else {
|
||||||
// todo!(linux) handle subpixel variants
|
// todo(linux) handle subpixel variants
|
||||||
let bitmap_size = glyph_bounds.size;
|
let bitmap_size = glyph_bounds.size;
|
||||||
let font = &self.fonts[params.font_id.0];
|
let font = &self.fonts[params.font_id.0];
|
||||||
let font_system = &mut self.font_system;
|
let font_system = &mut self.font_system;
|
||||||
@ -320,13 +320,13 @@ impl LinuxTextSystemState {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// todo!(linux) This is all a quick first pass, maybe we should be using cosmic_text::Buffer
|
// todo(linux) This is all a quick first pass, maybe we should be using cosmic_text::Buffer
|
||||||
#[profiling::function]
|
#[profiling::function]
|
||||||
fn layout_line(&mut self, text: &str, font_size: Pixels, font_runs: &[FontRun]) -> LineLayout {
|
fn layout_line(&mut self, text: &str, font_size: Pixels, font_runs: &[FontRun]) -> LineLayout {
|
||||||
let mut attrs_list = AttrsList::new(Attrs::new());
|
let mut attrs_list = AttrsList::new(Attrs::new());
|
||||||
let mut offs = 0;
|
let mut offs = 0;
|
||||||
for run in font_runs {
|
for run in font_runs {
|
||||||
// todo!(linux) We need to check we are doing utf properly
|
// todo(linux) We need to check we are doing utf properly
|
||||||
let font = &self.fonts[run.font_id.0];
|
let font = &self.fonts[run.font_id.0];
|
||||||
let font = self.font_system.db().face(font.id()).unwrap();
|
let font = self.font_system.db().face(font.id()).unwrap();
|
||||||
attrs_list.add_span(
|
attrs_list.add_span(
|
||||||
@ -343,11 +343,11 @@ impl LinuxTextSystemState {
|
|||||||
let layout = line.layout(
|
let layout = line.layout(
|
||||||
&mut self.font_system,
|
&mut self.font_system,
|
||||||
font_size.0,
|
font_size.0,
|
||||||
f32::MAX, // todo!(linux) we don't have a width cause this should technically not be wrapped I believe
|
f32::MAX, // todo(linux) we don't have a width cause this should technically not be wrapped I believe
|
||||||
cosmic_text::Wrap::None,
|
cosmic_text::Wrap::None,
|
||||||
);
|
);
|
||||||
let mut runs = Vec::new();
|
let mut runs = Vec::new();
|
||||||
// todo!(linux) what I think can happen is layout returns possibly multiple lines which means we should be probably working with it higher up in the text rendering
|
// todo(linux) what I think can happen is layout returns possibly multiple lines which means we should be probably working with it higher up in the text rendering
|
||||||
let layout = layout.first().unwrap();
|
let layout = layout.first().unwrap();
|
||||||
for glyph in &layout.glyphs {
|
for glyph in &layout.glyphs {
|
||||||
let font_id = glyph.font_id;
|
let font_id = glyph.font_id;
|
||||||
@ -358,7 +358,7 @@ impl LinuxTextSystemState {
|
|||||||
.unwrap(),
|
.unwrap(),
|
||||||
);
|
);
|
||||||
let mut glyphs = SmallVec::new();
|
let mut glyphs = SmallVec::new();
|
||||||
// todo!(linux) this is definitely wrong, each glyph in glyphs from cosmic-text is a cluster with one glyph, ShapedRun takes a run of glyphs with the same font and direction
|
// todo(linux) this is definitely wrong, each glyph in glyphs from cosmic-text is a cluster with one glyph, ShapedRun takes a run of glyphs with the same font and direction
|
||||||
glyphs.push(ShapedGlyph {
|
glyphs.push(ShapedGlyph {
|
||||||
id: GlyphId(glyph.glyph_id as u32),
|
id: GlyphId(glyph.glyph_id as u32),
|
||||||
position: point((glyph.x).into(), glyph.y.into()),
|
position: point((glyph.x).into(), glyph.y.into()),
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
//todo!(linux): remove this once the relevant functionality has been implemented
|
// todo(linux): remove this once the relevant functionality has been implemented
|
||||||
#![allow(unused_variables)]
|
#![allow(unused_variables)]
|
||||||
|
|
||||||
pub(crate) use client::*;
|
pub(crate) use client::*;
|
||||||
|
@ -183,7 +183,7 @@ impl Client for WaylandClient {
|
|||||||
let decoration =
|
let decoration =
|
||||||
decoration_manager.get_toplevel_decoration(&toplevel, &self.qh, xdg_surface.id());
|
decoration_manager.get_toplevel_decoration(&toplevel, &self.qh, xdg_surface.id());
|
||||||
|
|
||||||
// todo!(linux) - options.titlebar is lacking information required for wayland.
|
// todo(linux) - options.titlebar is lacking information required for wayland.
|
||||||
// Especially, whether a titlebar is wanted in itself.
|
// Especially, whether a titlebar is wanted in itself.
|
||||||
//
|
//
|
||||||
// Removing the titlebar also removes the entire window frame (ie. the ability to
|
// Removing the titlebar also removes the entire window frame (ie. the ability to
|
||||||
@ -482,7 +482,7 @@ impl Dispatch<wl_keyboard::WlKeyboard, ()> for WaylandClientState {
|
|||||||
wl_keyboard::KeyState::Pressed => {
|
wl_keyboard::KeyState::Pressed => {
|
||||||
let input = PlatformInput::KeyDown(KeyDownEvent {
|
let input = PlatformInput::KeyDown(KeyDownEvent {
|
||||||
keystroke: Keystroke::from_xkb(keymap_state, state.modifiers, keycode),
|
keystroke: Keystroke::from_xkb(keymap_state, state.modifiers, keycode),
|
||||||
is_held: false, // todo!(linux)
|
is_held: false, // todo(linux)
|
||||||
});
|
});
|
||||||
|
|
||||||
focused_window.handle_input(input.clone());
|
focused_window.handle_input(input.clone());
|
||||||
|
@ -8,17 +8,17 @@ use crate::{Bounds, DisplayId, GlobalPixels, PlatformDisplay, Size};
|
|||||||
pub(crate) struct WaylandDisplay {}
|
pub(crate) struct WaylandDisplay {}
|
||||||
|
|
||||||
impl PlatformDisplay for WaylandDisplay {
|
impl PlatformDisplay for WaylandDisplay {
|
||||||
// todo!(linux)
|
// todo(linux)
|
||||||
fn id(&self) -> DisplayId {
|
fn id(&self) -> DisplayId {
|
||||||
DisplayId(123) // return some fake data so it doesn't panic
|
DisplayId(123) // return some fake data so it doesn't panic
|
||||||
}
|
}
|
||||||
|
|
||||||
// todo!(linux)
|
// todo(linux)
|
||||||
fn uuid(&self) -> anyhow::Result<Uuid> {
|
fn uuid(&self) -> anyhow::Result<Uuid> {
|
||||||
Ok(Uuid::from_bytes([0; 16])) // return some fake data so it doesn't panic
|
Ok(Uuid::from_bytes([0; 16])) // return some fake data so it doesn't panic
|
||||||
}
|
}
|
||||||
|
|
||||||
// todo!(linux)
|
// todo(linux)
|
||||||
fn bounds(&self) -> Bounds<GlobalPixels> {
|
fn bounds(&self) -> Bounds<GlobalPixels> {
|
||||||
Bounds {
|
Bounds {
|
||||||
origin: Default::default(),
|
origin: Default::default(),
|
||||||
|
@ -132,7 +132,7 @@ impl WaylandWindowState {
|
|||||||
size: Size {
|
size: Size {
|
||||||
width: 500,
|
width: 500,
|
||||||
height: 500,
|
height: 500,
|
||||||
}, //todo!(implement)
|
}, // todo(implement)
|
||||||
},
|
},
|
||||||
WindowBounds::Fixed(bounds) => bounds.map(|p| p.0 as i32),
|
WindowBounds::Fixed(bounds) => bounds.map(|p| p.0 as i32),
|
||||||
};
|
};
|
||||||
@ -200,7 +200,7 @@ impl WaylandWindowState {
|
|||||||
pub fn set_decoration_state(&self, state: WaylandDecorationState) {
|
pub fn set_decoration_state(&self, state: WaylandDecorationState) {
|
||||||
self.inner.borrow_mut().decoration_state = state;
|
self.inner.borrow_mut().decoration_state = state;
|
||||||
log::trace!("Window decorations are now handled by {:?}", state);
|
log::trace!("Window decorations are now handled by {:?}", state);
|
||||||
// todo!(linux) - Handle this properly
|
// todo(linux) - Handle this properly
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn close(&self) {
|
pub fn close(&self) {
|
||||||
@ -250,7 +250,7 @@ impl HasDisplayHandle for WaylandWindow {
|
|||||||
}
|
}
|
||||||
|
|
||||||
impl PlatformWindow for WaylandWindow {
|
impl PlatformWindow for WaylandWindow {
|
||||||
//todo!(linux)
|
// todo(linux)
|
||||||
fn bounds(&self) -> WindowBounds {
|
fn bounds(&self) -> WindowBounds {
|
||||||
WindowBounds::Maximized
|
WindowBounds::Maximized
|
||||||
}
|
}
|
||||||
@ -267,32 +267,32 @@ impl PlatformWindow for WaylandWindow {
|
|||||||
self.0.inner.borrow_mut().scale
|
self.0.inner.borrow_mut().scale
|
||||||
}
|
}
|
||||||
|
|
||||||
//todo!(linux)
|
// todo(linux)
|
||||||
fn titlebar_height(&self) -> Pixels {
|
fn titlebar_height(&self) -> Pixels {
|
||||||
unimplemented!()
|
unimplemented!()
|
||||||
}
|
}
|
||||||
|
|
||||||
// todo!(linux)
|
// todo(linux)
|
||||||
fn appearance(&self) -> WindowAppearance {
|
fn appearance(&self) -> WindowAppearance {
|
||||||
WindowAppearance::Light
|
WindowAppearance::Light
|
||||||
}
|
}
|
||||||
|
|
||||||
// todo!(linux)
|
// todo(linux)
|
||||||
fn display(&self) -> Rc<dyn PlatformDisplay> {
|
fn display(&self) -> Rc<dyn PlatformDisplay> {
|
||||||
Rc::new(WaylandDisplay {})
|
Rc::new(WaylandDisplay {})
|
||||||
}
|
}
|
||||||
|
|
||||||
// todo!(linux)
|
// todo(linux)
|
||||||
fn mouse_position(&self) -> Point<Pixels> {
|
fn mouse_position(&self) -> Point<Pixels> {
|
||||||
Point::default()
|
Point::default()
|
||||||
}
|
}
|
||||||
|
|
||||||
//todo!(linux)
|
// todo(linux)
|
||||||
fn modifiers(&self) -> Modifiers {
|
fn modifiers(&self) -> Modifiers {
|
||||||
crate::Modifiers::default()
|
crate::Modifiers::default()
|
||||||
}
|
}
|
||||||
|
|
||||||
//todo!(linux)
|
// todo(linux)
|
||||||
fn as_any_mut(&mut self) -> &mut dyn Any {
|
fn as_any_mut(&mut self) -> &mut dyn Any {
|
||||||
unimplemented!()
|
unimplemented!()
|
||||||
}
|
}
|
||||||
@ -305,7 +305,7 @@ impl PlatformWindow for WaylandWindow {
|
|||||||
self.0.inner.borrow_mut().input_handler.take()
|
self.0.inner.borrow_mut().input_handler.take()
|
||||||
}
|
}
|
||||||
|
|
||||||
//todo!(linux)
|
// todo(linux)
|
||||||
fn prompt(
|
fn prompt(
|
||||||
&self,
|
&self,
|
||||||
level: PromptLevel,
|
level: PromptLevel,
|
||||||
@ -317,7 +317,7 @@ impl PlatformWindow for WaylandWindow {
|
|||||||
}
|
}
|
||||||
|
|
||||||
fn activate(&self) {
|
fn activate(&self) {
|
||||||
//todo!(linux)
|
// todo(linux)
|
||||||
}
|
}
|
||||||
|
|
||||||
fn set_title(&mut self, title: &str) {
|
fn set_title(&mut self, title: &str) {
|
||||||
@ -325,23 +325,23 @@ impl PlatformWindow for WaylandWindow {
|
|||||||
}
|
}
|
||||||
|
|
||||||
fn set_edited(&mut self, edited: bool) {
|
fn set_edited(&mut self, edited: bool) {
|
||||||
//todo!(linux)
|
// todo(linux)
|
||||||
}
|
}
|
||||||
|
|
||||||
fn show_character_palette(&self) {
|
fn show_character_palette(&self) {
|
||||||
//todo!(linux)
|
// todo(linux)
|
||||||
}
|
}
|
||||||
|
|
||||||
fn minimize(&self) {
|
fn minimize(&self) {
|
||||||
//todo!(linux)
|
// todo(linux)
|
||||||
}
|
}
|
||||||
|
|
||||||
fn zoom(&self) {
|
fn zoom(&self) {
|
||||||
//todo!(linux)
|
// todo(linux)
|
||||||
}
|
}
|
||||||
|
|
||||||
fn toggle_full_screen(&self) {
|
fn toggle_full_screen(&self) {
|
||||||
//todo!(linux)
|
// todo(linux)
|
||||||
}
|
}
|
||||||
|
|
||||||
fn on_request_frame(&self, callback: Box<dyn FnMut()>) {
|
fn on_request_frame(&self, callback: Box<dyn FnMut()>) {
|
||||||
@ -361,7 +361,7 @@ impl PlatformWindow for WaylandWindow {
|
|||||||
}
|
}
|
||||||
|
|
||||||
fn on_fullscreen(&self, callback: Box<dyn FnMut(bool)>) {
|
fn on_fullscreen(&self, callback: Box<dyn FnMut(bool)>) {
|
||||||
//todo!(linux)
|
// todo(linux)
|
||||||
}
|
}
|
||||||
|
|
||||||
fn on_moved(&self, callback: Box<dyn FnMut()>) {
|
fn on_moved(&self, callback: Box<dyn FnMut()>) {
|
||||||
@ -377,10 +377,10 @@ impl PlatformWindow for WaylandWindow {
|
|||||||
}
|
}
|
||||||
|
|
||||||
fn on_appearance_changed(&self, callback: Box<dyn FnMut()>) {
|
fn on_appearance_changed(&self, callback: Box<dyn FnMut()>) {
|
||||||
//todo!(linux)
|
// todo(linux)
|
||||||
}
|
}
|
||||||
|
|
||||||
// todo!(linux)
|
// todo(linux)
|
||||||
fn is_topmost_for_position(&self, position: Point<Pixels>) -> bool {
|
fn is_topmost_for_position(&self, position: Point<Pixels>) -> bool {
|
||||||
false
|
false
|
||||||
}
|
}
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
//todo!(linux): remove
|
// todo(linux): remove
|
||||||
#![allow(unused)]
|
#![allow(unused)]
|
||||||
|
|
||||||
use crate::{
|
use crate::{
|
||||||
@ -99,7 +99,7 @@ pub(crate) struct X11WindowState {
|
|||||||
#[derive(Clone)]
|
#[derive(Clone)]
|
||||||
pub(crate) struct X11Window(pub(crate) Rc<X11WindowState>);
|
pub(crate) struct X11Window(pub(crate) Rc<X11WindowState>);
|
||||||
|
|
||||||
//todo!(linux): Remove other RawWindowHandle implementation
|
// todo(linux): Remove other RawWindowHandle implementation
|
||||||
unsafe impl blade_rwh::HasRawWindowHandle for RawWindow {
|
unsafe impl blade_rwh::HasRawWindowHandle for RawWindow {
|
||||||
fn raw_window_handle(&self) -> blade_rwh::RawWindowHandle {
|
fn raw_window_handle(&self) -> blade_rwh::RawWindowHandle {
|
||||||
let mut wh = blade_rwh::XcbWindowHandle::empty();
|
let mut wh = blade_rwh::XcbWindowHandle::empty();
|
||||||
@ -301,7 +301,7 @@ impl X11WindowState {
|
|||||||
let mut inner = self.inner.borrow_mut();
|
let mut inner = self.inner.borrow_mut();
|
||||||
let old_bounds = mem::replace(&mut inner.bounds, bounds);
|
let old_bounds = mem::replace(&mut inner.bounds, bounds);
|
||||||
do_move = old_bounds.origin != bounds.origin;
|
do_move = old_bounds.origin != bounds.origin;
|
||||||
//todo!(linux): use normal GPUI types here, refactor out the double
|
// todo(linux): use normal GPUI types here, refactor out the double
|
||||||
// viewport check and extra casts ( )
|
// viewport check and extra casts ( )
|
||||||
let gpu_size = query_render_extent(&self.xcb_connection, self.x_window);
|
let gpu_size = query_render_extent(&self.xcb_connection, self.x_window);
|
||||||
if inner.renderer.viewport_size() != gpu_size {
|
if inner.renderer.viewport_size() != gpu_size {
|
||||||
@ -377,12 +377,12 @@ impl PlatformWindow for X11Window {
|
|||||||
self.0.inner.borrow_mut().scale_factor
|
self.0.inner.borrow_mut().scale_factor
|
||||||
}
|
}
|
||||||
|
|
||||||
//todo!(linux)
|
// todo(linux)
|
||||||
fn titlebar_height(&self) -> Pixels {
|
fn titlebar_height(&self) -> Pixels {
|
||||||
unimplemented!()
|
unimplemented!()
|
||||||
}
|
}
|
||||||
|
|
||||||
//todo!(linux)
|
// todo(linux)
|
||||||
fn appearance(&self) -> WindowAppearance {
|
fn appearance(&self) -> WindowAppearance {
|
||||||
WindowAppearance::Light
|
WindowAppearance::Light
|
||||||
}
|
}
|
||||||
@ -402,7 +402,7 @@ impl PlatformWindow for X11Window {
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
//todo!(linux)
|
// todo(linux)
|
||||||
fn modifiers(&self) -> Modifiers {
|
fn modifiers(&self) -> Modifiers {
|
||||||
Modifiers::default()
|
Modifiers::default()
|
||||||
}
|
}
|
||||||
@ -419,7 +419,7 @@ impl PlatformWindow for X11Window {
|
|||||||
self.0.inner.borrow_mut().input_handler.take()
|
self.0.inner.borrow_mut().input_handler.take()
|
||||||
}
|
}
|
||||||
|
|
||||||
//todo!(linux)
|
// todo(linux)
|
||||||
fn prompt(
|
fn prompt(
|
||||||
&self,
|
&self,
|
||||||
_level: PromptLevel,
|
_level: PromptLevel,
|
||||||
@ -447,10 +447,10 @@ impl PlatformWindow for X11Window {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
//todo!(linux)
|
// todo(linux)
|
||||||
fn set_edited(&mut self, edited: bool) {}
|
fn set_edited(&mut self, edited: bool) {}
|
||||||
|
|
||||||
//todo!(linux), this corresponds to `orderFrontCharacterPalette` on macOS,
|
// todo(linux), this corresponds to `orderFrontCharacterPalette` on macOS,
|
||||||
// but it looks like the equivalent for Linux is GTK specific:
|
// but it looks like the equivalent for Linux is GTK specific:
|
||||||
//
|
//
|
||||||
// https://docs.gtk.org/gtk3/signal.Entry.insert-emoji.html
|
// https://docs.gtk.org/gtk3/signal.Entry.insert-emoji.html
|
||||||
@ -460,17 +460,17 @@ impl PlatformWindow for X11Window {
|
|||||||
unimplemented!()
|
unimplemented!()
|
||||||
}
|
}
|
||||||
|
|
||||||
//todo!(linux)
|
// todo(linux)
|
||||||
fn minimize(&self) {
|
fn minimize(&self) {
|
||||||
unimplemented!()
|
unimplemented!()
|
||||||
}
|
}
|
||||||
|
|
||||||
//todo!(linux)
|
// todo(linux)
|
||||||
fn zoom(&self) {
|
fn zoom(&self) {
|
||||||
unimplemented!()
|
unimplemented!()
|
||||||
}
|
}
|
||||||
|
|
||||||
//todo!(linux)
|
// todo(linux)
|
||||||
fn toggle_full_screen(&self) {
|
fn toggle_full_screen(&self) {
|
||||||
unimplemented!()
|
unimplemented!()
|
||||||
}
|
}
|
||||||
@ -511,7 +511,7 @@ impl PlatformWindow for X11Window {
|
|||||||
self.0.callbacks.borrow_mut().appearance_changed = Some(callback);
|
self.0.callbacks.borrow_mut().appearance_changed = Some(callback);
|
||||||
}
|
}
|
||||||
|
|
||||||
//todo!(linux)
|
// todo(linux)
|
||||||
fn is_topmost_for_position(&self, _position: Point<Pixels>) -> bool {
|
fn is_topmost_for_position(&self, _position: Point<Pixels>) -> bool {
|
||||||
unimplemented!()
|
unimplemented!()
|
||||||
}
|
}
|
||||||
|
@ -126,7 +126,7 @@ impl Platform for TestPlatform {
|
|||||||
#[cfg(target_os = "macos")]
|
#[cfg(target_os = "macos")]
|
||||||
return Arc::new(crate::platform::mac::MacTextSystem::new());
|
return Arc::new(crate::platform::mac::MacTextSystem::new());
|
||||||
|
|
||||||
// todo!("windows")
|
// todo("windows")
|
||||||
#[cfg(target_os = "windows")]
|
#[cfg(target_os = "windows")]
|
||||||
unimplemented!()
|
unimplemented!()
|
||||||
}
|
}
|
||||||
|
@ -7,7 +7,7 @@ use std::borrow::Cow;
|
|||||||
|
|
||||||
pub(crate) struct TestTextSystem {}
|
pub(crate) struct TestTextSystem {}
|
||||||
|
|
||||||
//todo!(linux)
|
// todo(linux)
|
||||||
#[allow(unused)]
|
#[allow(unused)]
|
||||||
impl PlatformTextSystem for TestTextSystem {
|
impl PlatformTextSystem for TestTextSystem {
|
||||||
fn add_fonts(&self, fonts: Vec<Cow<'static, [u8]>>) -> Result<()> {
|
fn add_fonts(&self, fonts: Vec<Cow<'static, [u8]>>) -> Result<()> {
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
// todo!("windows"): remove
|
// todo("windows"): remove
|
||||||
#![cfg_attr(windows, allow(dead_code))]
|
#![cfg_attr(windows, allow(dead_code))]
|
||||||
|
|
||||||
use crate::{
|
use crate::{
|
||||||
|
@ -208,7 +208,7 @@ impl Default for TextStyle {
|
|||||||
fn default() -> Self {
|
fn default() -> Self {
|
||||||
TextStyle {
|
TextStyle {
|
||||||
color: black(),
|
color: black(),
|
||||||
// todo!(linux) make this configurable or choose better default
|
// todo(linux) make this configurable or choose better default
|
||||||
font_family: if cfg!(target_os = "linux") {
|
font_family: if cfg!(target_os = "linux") {
|
||||||
"FreeMono".into()
|
"FreeMono".into()
|
||||||
} else {
|
} else {
|
||||||
|
@ -18,7 +18,7 @@ pub async fn install_cli(cx: &AsyncAppContext) -> Result<()> {
|
|||||||
// If the symlink is not there or is outdated, first try replacing it
|
// If the symlink is not there or is outdated, first try replacing it
|
||||||
// without escalating.
|
// without escalating.
|
||||||
smol::fs::remove_file(link_path).await.log_err();
|
smol::fs::remove_file(link_path).await.log_err();
|
||||||
// todo!("windows")
|
// todo("windows")
|
||||||
#[cfg(not(windows))]
|
#[cfg(not(windows))]
|
||||||
{
|
{
|
||||||
if smol::fs::unix::symlink(&cli_path, link_path)
|
if smol::fs::unix::symlink(&cli_path, link_path)
|
||||||
|
@ -81,7 +81,7 @@ impl super::LspAdapter for OmniSharpAdapter {
|
|||||||
archive.unpack(container_dir).await?;
|
archive.unpack(container_dir).await?;
|
||||||
}
|
}
|
||||||
|
|
||||||
// todo!("windows")
|
// todo("windows")
|
||||||
#[cfg(not(windows))]
|
#[cfg(not(windows))]
|
||||||
{
|
{
|
||||||
fs::set_permissions(
|
fs::set_permissions(
|
||||||
|
@ -358,7 +358,7 @@ impl LspAdapter for NextLspAdapter {
|
|||||||
}
|
}
|
||||||
futures::io::copy(response.body_mut(), &mut file).await?;
|
futures::io::copy(response.body_mut(), &mut file).await?;
|
||||||
|
|
||||||
// todo!("windows")
|
// todo("windows")
|
||||||
#[cfg(not(windows))]
|
#[cfg(not(windows))]
|
||||||
{
|
{
|
||||||
fs::set_permissions(
|
fs::set_permissions(
|
||||||
|
@ -83,7 +83,7 @@ impl super::LspAdapter for LuaLspAdapter {
|
|||||||
archive.unpack(container_dir).await?;
|
archive.unpack(container_dir).await?;
|
||||||
}
|
}
|
||||||
|
|
||||||
// todo!("windows")
|
// todo("windows")
|
||||||
#[cfg(not(windows))]
|
#[cfg(not(windows))]
|
||||||
{
|
{
|
||||||
fs::set_permissions(
|
fs::set_permissions(
|
||||||
|
@ -26,7 +26,7 @@ pub struct PurescriptLspAdapter {
|
|||||||
}
|
}
|
||||||
|
|
||||||
impl PurescriptLspAdapter {
|
impl PurescriptLspAdapter {
|
||||||
// todo!(linux): remove
|
// todo(linux): remove
|
||||||
#[cfg_attr(target_os = "linux", allow(dead_code))]
|
#[cfg_attr(target_os = "linux", allow(dead_code))]
|
||||||
pub fn new(node: Arc<dyn NodeRuntime>) -> Self {
|
pub fn new(node: Arc<dyn NodeRuntime>) -> Self {
|
||||||
Self { node }
|
Self { node }
|
||||||
|
@ -74,7 +74,7 @@ impl LspAdapter for RustLspAdapter {
|
|||||||
let decompressed_bytes = GzipDecoder::new(BufReader::new(response.body_mut()));
|
let decompressed_bytes = GzipDecoder::new(BufReader::new(response.body_mut()));
|
||||||
let mut file = File::create(&destination_path).await?;
|
let mut file = File::create(&destination_path).await?;
|
||||||
futures::io::copy(decompressed_bytes, &mut file).await?;
|
futures::io::copy(decompressed_bytes, &mut file).await?;
|
||||||
// todo!("windows")
|
// todo("windows")
|
||||||
#[cfg(not(windows))]
|
#[cfg(not(windows))]
|
||||||
{
|
{
|
||||||
fs::set_permissions(
|
fs::set_permissions(
|
||||||
|
@ -72,7 +72,7 @@ impl LspAdapter for TaploLspAdapter {
|
|||||||
|
|
||||||
futures::io::copy(decompressed_bytes, &mut file).await?;
|
futures::io::copy(decompressed_bytes, &mut file).await?;
|
||||||
|
|
||||||
// todo!("windows")
|
// todo("windows")
|
||||||
#[cfg(not(windows))]
|
#[cfg(not(windows))]
|
||||||
{
|
{
|
||||||
fs::set_permissions(
|
fs::set_permissions(
|
||||||
|
@ -86,7 +86,7 @@ impl LspAdapter for ZlsAdapter {
|
|||||||
archive.unpack(container_dir).await?;
|
archive.unpack(container_dir).await?;
|
||||||
}
|
}
|
||||||
|
|
||||||
// todo!("windows")
|
// todo("windows")
|
||||||
#[cfg(not(windows))]
|
#[cfg(not(windows))]
|
||||||
{
|
{
|
||||||
fs::set_permissions(
|
fs::set_permissions(
|
||||||
|
@ -73,7 +73,7 @@ impl TestServer {
|
|||||||
}
|
}
|
||||||
|
|
||||||
pub async fn create_room(&self, room: String) -> Result<()> {
|
pub async fn create_room(&self, room: String) -> Result<()> {
|
||||||
//todo!(linux): Remove this once the cross-platform LiveKit implementation is merged
|
// todo(linux): Remove this once the cross-platform LiveKit implementation is merged
|
||||||
#[cfg(any(test, feature = "test-support"))]
|
#[cfg(any(test, feature = "test-support"))]
|
||||||
self.executor.simulate_random_delay().await;
|
self.executor.simulate_random_delay().await;
|
||||||
let mut server_rooms = self.rooms.lock();
|
let mut server_rooms = self.rooms.lock();
|
||||||
@ -87,7 +87,7 @@ impl TestServer {
|
|||||||
|
|
||||||
async fn delete_room(&self, room: String) -> Result<()> {
|
async fn delete_room(&self, room: String) -> Result<()> {
|
||||||
// TODO: clear state associated with all `Room`s.
|
// TODO: clear state associated with all `Room`s.
|
||||||
//todo!(linux): Remove this once the cross-platform LiveKit implementation is merged
|
// todo(linux): Remove this once the cross-platform LiveKit implementation is merged
|
||||||
#[cfg(any(test, feature = "test-support"))]
|
#[cfg(any(test, feature = "test-support"))]
|
||||||
self.executor.simulate_random_delay().await;
|
self.executor.simulate_random_delay().await;
|
||||||
let mut server_rooms = self.rooms.lock();
|
let mut server_rooms = self.rooms.lock();
|
||||||
@ -98,7 +98,7 @@ impl TestServer {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async fn join_room(&self, token: String, client_room: Arc<Room>) -> Result<()> {
|
async fn join_room(&self, token: String, client_room: Arc<Room>) -> Result<()> {
|
||||||
//todo!(linux): Remove this once the cross-platform LiveKit implementation is merged
|
// todo(linux): Remove this once the cross-platform LiveKit implementation is merged
|
||||||
#[cfg(any(test, feature = "test-support"))]
|
#[cfg(any(test, feature = "test-support"))]
|
||||||
self.executor.simulate_random_delay().await;
|
self.executor.simulate_random_delay().await;
|
||||||
|
|
||||||
@ -147,7 +147,7 @@ impl TestServer {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async fn leave_room(&self, token: String) -> Result<()> {
|
async fn leave_room(&self, token: String) -> Result<()> {
|
||||||
//todo!(linux): Remove this once the cross-platform LiveKit implementation is merged
|
// todo(linux): Remove this once the cross-platform LiveKit implementation is merged
|
||||||
#[cfg(any(test, feature = "test-support"))]
|
#[cfg(any(test, feature = "test-support"))]
|
||||||
self.executor.simulate_random_delay().await;
|
self.executor.simulate_random_delay().await;
|
||||||
let claims = live_kit_server::token::validate(&token, &self.secret_key)?;
|
let claims = live_kit_server::token::validate(&token, &self.secret_key)?;
|
||||||
@ -169,7 +169,7 @@ impl TestServer {
|
|||||||
|
|
||||||
async fn remove_participant(&self, room_name: String, identity: String) -> Result<()> {
|
async fn remove_participant(&self, room_name: String, identity: String) -> Result<()> {
|
||||||
// TODO: clear state associated with the `Room`.
|
// TODO: clear state associated with the `Room`.
|
||||||
//todo!(linux): Remove this once the cross-platform LiveKit implementation is merged
|
// todo(linux): Remove this once the cross-platform LiveKit implementation is merged
|
||||||
#[cfg(any(test, feature = "test-support"))]
|
#[cfg(any(test, feature = "test-support"))]
|
||||||
self.executor.simulate_random_delay().await;
|
self.executor.simulate_random_delay().await;
|
||||||
|
|
||||||
@ -193,7 +193,7 @@ impl TestServer {
|
|||||||
identity: String,
|
identity: String,
|
||||||
permission: proto::ParticipantPermission,
|
permission: proto::ParticipantPermission,
|
||||||
) -> Result<()> {
|
) -> Result<()> {
|
||||||
//todo!(linux): Remove this once the cross-platform LiveKit implementation is merged
|
// todo(linux): Remove this once the cross-platform LiveKit implementation is merged
|
||||||
#[cfg(any(test, feature = "test-support"))]
|
#[cfg(any(test, feature = "test-support"))]
|
||||||
self.executor.simulate_random_delay().await;
|
self.executor.simulate_random_delay().await;
|
||||||
let mut server_rooms = self.rooms.lock();
|
let mut server_rooms = self.rooms.lock();
|
||||||
@ -205,7 +205,7 @@ impl TestServer {
|
|||||||
}
|
}
|
||||||
|
|
||||||
pub async fn disconnect_client(&self, client_identity: String) {
|
pub async fn disconnect_client(&self, client_identity: String) {
|
||||||
//todo!(linux): Remove this once the cross-platform LiveKit implementation is merged
|
// todo(linux): Remove this once the cross-platform LiveKit implementation is merged
|
||||||
#[cfg(any(test, feature = "test-support"))]
|
#[cfg(any(test, feature = "test-support"))]
|
||||||
self.executor.simulate_random_delay().await;
|
self.executor.simulate_random_delay().await;
|
||||||
let mut server_rooms = self.rooms.lock();
|
let mut server_rooms = self.rooms.lock();
|
||||||
@ -221,7 +221,7 @@ impl TestServer {
|
|||||||
token: String,
|
token: String,
|
||||||
local_track: LocalVideoTrack,
|
local_track: LocalVideoTrack,
|
||||||
) -> Result<Sid> {
|
) -> Result<Sid> {
|
||||||
//todo!(linux): Remove this once the cross-platform LiveKit implementation is merged
|
// todo(linux): Remove this once the cross-platform LiveKit implementation is merged
|
||||||
#[cfg(any(test, feature = "test-support"))]
|
#[cfg(any(test, feature = "test-support"))]
|
||||||
self.executor.simulate_random_delay().await;
|
self.executor.simulate_random_delay().await;
|
||||||
let claims = live_kit_server::token::validate(&token, &self.secret_key)?;
|
let claims = live_kit_server::token::validate(&token, &self.secret_key)?;
|
||||||
@ -276,7 +276,7 @@ impl TestServer {
|
|||||||
token: String,
|
token: String,
|
||||||
_local_track: &LocalAudioTrack,
|
_local_track: &LocalAudioTrack,
|
||||||
) -> Result<Sid> {
|
) -> Result<Sid> {
|
||||||
//todo!(linux): Remove this once the cross-platform LiveKit implementation is merged
|
// todo(linux): Remove this once the cross-platform LiveKit implementation is merged
|
||||||
#[cfg(any(test, feature = "test-support"))]
|
#[cfg(any(test, feature = "test-support"))]
|
||||||
self.executor.simulate_random_delay().await;
|
self.executor.simulate_random_delay().await;
|
||||||
|
|
||||||
@ -559,7 +559,7 @@ impl Room {
|
|||||||
pub fn display_sources(self: &Arc<Self>) -> impl Future<Output = Result<Vec<MacOSDisplay>>> {
|
pub fn display_sources(self: &Arc<Self>) -> impl Future<Output = Result<Vec<MacOSDisplay>>> {
|
||||||
let this = self.clone();
|
let this = self.clone();
|
||||||
async move {
|
async move {
|
||||||
//todo!(linux): Remove this once the cross-platform LiveKit implementation is merged
|
// todo(linux): Remove this once the cross-platform LiveKit implementation is merged
|
||||||
#[cfg(any(test, feature = "test-support"))]
|
#[cfg(any(test, feature = "test-support"))]
|
||||||
{
|
{
|
||||||
let server = this.test_server();
|
let server = this.test_server();
|
||||||
|
@ -399,7 +399,7 @@ impl TerminalBuilder {
|
|||||||
#[cfg(unix)]
|
#[cfg(unix)]
|
||||||
let (fd, shell_pid) = (pty.file().as_raw_fd(), pty.child().id());
|
let (fd, shell_pid) = (pty.file().as_raw_fd(), pty.child().id());
|
||||||
|
|
||||||
// todo!("windows")
|
// todo("windows")
|
||||||
#[cfg(windows)]
|
#[cfg(windows)]
|
||||||
let (fd, shell_pid) = (-1, 0);
|
let (fd, shell_pid) = (-1, 0);
|
||||||
|
|
||||||
@ -667,7 +667,7 @@ impl Terminal {
|
|||||||
fn update_process_info(&mut self) -> bool {
|
fn update_process_info(&mut self) -> bool {
|
||||||
#[cfg(unix)]
|
#[cfg(unix)]
|
||||||
let mut pid = unsafe { libc::tcgetpgrp(self.shell_fd as i32) };
|
let mut pid = unsafe { libc::tcgetpgrp(self.shell_fd as i32) };
|
||||||
// todo!("windows")
|
// todo("windows")
|
||||||
#[cfg(windows)]
|
#[cfg(windows)]
|
||||||
let mut pid = -1;
|
let mut pid = -1;
|
||||||
if pid < 0 {
|
if pid < 0 {
|
||||||
|
@ -100,7 +100,7 @@ pub(crate) fn one_dark() -> Theme {
|
|||||||
editor_document_highlight_write_background: gpui::red(),
|
editor_document_highlight_write_background: gpui::red(),
|
||||||
|
|
||||||
terminal_background: bg,
|
terminal_background: bg,
|
||||||
// todo!("Use one colors for terminal")
|
// todo("Use one colors for terminal")
|
||||||
terminal_foreground: crate::white().dark().step_12(),
|
terminal_foreground: crate::white().dark().step_12(),
|
||||||
terminal_bright_foreground: crate::white().dark().step_11(),
|
terminal_bright_foreground: crate::white().dark().step_11(),
|
||||||
terminal_dim_foreground: crate::white().dark().step_10(),
|
terminal_dim_foreground: crate::white().dark().step_10(),
|
||||||
|
@ -130,7 +130,7 @@ pub struct ThemeColors {
|
|||||||
/// The border color of the scrollbar track.
|
/// The border color of the scrollbar track.
|
||||||
pub scrollbar_track_border: Hsla,
|
pub scrollbar_track_border: Hsla,
|
||||||
// /// The opacity of the scrollbar status marks, like diagnostic states and git status.
|
// /// The opacity of the scrollbar status marks, like diagnostic states and git status.
|
||||||
// todo!()
|
// todo()
|
||||||
// pub scrollbar_status_opacity: Hsla,
|
// pub scrollbar_status_opacity: Hsla,
|
||||||
|
|
||||||
// ===
|
// ===
|
||||||
|
@ -25,8 +25,8 @@ pub fn format_localized_timestamp(
|
|||||||
}
|
}
|
||||||
#[cfg(not(target_os = "macos"))]
|
#[cfg(not(target_os = "macos"))]
|
||||||
{
|
{
|
||||||
//todo!(linux) respect user's date/time preferences
|
// todo(linux) respect user's date/time preferences
|
||||||
//todo!(windows) respect user's date/time preferences
|
// todo(windows) respect user's date/time preferences
|
||||||
format_timestamp_fallback(reference, timestamp, timezone)
|
format_timestamp_fallback(reference, timestamp, timezone)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -268,7 +268,7 @@ fn main() {
|
|||||||
initialize_workspace(app_state.clone(), cx);
|
initialize_workspace(app_state.clone(), cx);
|
||||||
|
|
||||||
if stdout_is_a_pty() {
|
if stdout_is_a_pty() {
|
||||||
//todo!(linux): unblock this
|
// todo(linux): unblock this
|
||||||
#[cfg(not(target_os = "linux"))]
|
#[cfg(not(target_os = "linux"))]
|
||||||
upload_panics_and_crashes(http.clone(), cx);
|
upload_panics_and_crashes(http.clone(), cx);
|
||||||
cx.activate(true);
|
cx.activate(true);
|
||||||
@ -997,7 +997,7 @@ fn load_user_themes_in_background(fs: Arc<dyn fs::Fs>, cx: &mut AppContext) {
|
|||||||
.detach_and_log_err(cx);
|
.detach_and_log_err(cx);
|
||||||
}
|
}
|
||||||
|
|
||||||
//todo!(linux): Port fsevents to linux
|
// todo(linux): Port fsevents to linux
|
||||||
/// 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")]
|
#[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) {
|
||||||
|
Loading…
Reference in New Issue
Block a user