diff --git a/lapce-core/src/register.rs b/lapce-core/src/register.rs index 1a760f1f..a28a999c 100644 --- a/lapce-core/src/register.rs +++ b/lapce-core/src/register.rs @@ -15,12 +15,6 @@ pub struct RegisterData { pub struct Register { pub unamed: RegisterData, last_yank: RegisterData, - - #[allow(dead_code)] - last_deletes: [RegisterData; 10], - - #[allow(dead_code)] - newest_delete: usize, } pub enum RegisterKind { diff --git a/lapce-data/src/completion.rs b/lapce-data/src/completion.rs index c40a2e09..4f58a279 100644 --- a/lapce-data/src/completion.rs +++ b/lapce-data/src/completion.rs @@ -381,7 +381,6 @@ pub fn receive( item: i.to_owned(), score: 0, label_score: 0, - index: 0, indices: Vec::new(), }) .collect(); @@ -459,9 +458,6 @@ fn default() -> Self { pub struct ScoredCompletionItem { pub item: CompletionItem, - #[allow(dead_code)] - pub index: usize, - pub score: i64, pub label_score: i64, pub indices: Vec, diff --git a/lapce-data/src/explorer.rs b/lapce-data/src/explorer.rs index 5904ad84..f8eb5007 100644 --- a/lapce-data/src/explorer.rs +++ b/lapce-data/src/explorer.rs @@ -6,7 +6,6 @@ use druid::ExtEventSink; use druid::{Target, WidgetId}; -use include_dir::{include_dir, Dir}; use lapce_rpc::file::FileNodeItem; use lapce_rpc::proxy::ReadDirResponse; @@ -15,18 +14,12 @@ use crate::{command::LapceUICommand, command::LAPCE_UI_COMMAND}; -#[allow(dead_code)] -const ICONS_DIR: Dir = include_dir!("../icons"); - #[derive(Clone)] pub struct FileExplorerData { pub tab_id: WidgetId, pub widget_id: WidgetId, pub workspace: Option, pub active_selected: Option, - - #[allow(dead_code)] - count: usize, } impl FileExplorerData { @@ -64,7 +57,6 @@ pub fn new( children_open_count: 0, }), active_selected: None, - count: 0, } } diff --git a/lapce-data/src/lib.rs b/lapce-data/src/lib.rs index f2a63fb2..e6935963 100644 --- a/lapce-data/src/lib.rs +++ b/lapce-data/src/lib.rs @@ -13,7 +13,6 @@ pub mod hover; pub mod keypress; pub mod menu; -pub mod outline; pub mod palette; pub mod panel; pub mod picker; diff --git a/lapce-data/src/outline.rs b/lapce-data/src/outline.rs deleted file mode 100644 index d5b0c0c7..00000000 --- a/lapce-data/src/outline.rs +++ /dev/null @@ -1,20 +0,0 @@ -use druid::WidgetId; - -pub struct OutlineState { - #[allow(dead_code)] - widget_id: WidgetId, -} - -impl OutlineState { - pub fn new() -> Self { - Self { - widget_id: WidgetId::next(), - } - } -} - -impl Default for OutlineState { - fn default() -> Self { - Self::new() - } -} diff --git a/lapce-proxy/src/terminal.rs b/lapce-proxy/src/terminal.rs index 94baf879..45d877f1 100644 --- a/lapce-proxy/src/terminal.rs +++ b/lapce-proxy/src/terminal.rs @@ -6,7 +6,6 @@ }; use alacritty_terminal::{ - ansi, config::Program, event::OnResize, event_loop::Msg, @@ -277,9 +276,6 @@ fn finished(&self) -> bool { pub struct State { write_list: VecDeque>, writing: Option, - - #[allow(dead_code)] - parser: ansi::Processor, } impl State { @@ -311,7 +307,7 @@ fn set_current(&mut self, new: Option) { } } -#[allow(dead_code)] +#[cfg(target_os = "macos")] fn set_locale_environment() { let locale = locale_config::Locale::global_default() .to_string() diff --git a/lapce-ui/src/completion.rs b/lapce-ui/src/completion.rs index 9e732d62..46a24ac7 100644 --- a/lapce-ui/src/completion.rs +++ b/lapce-ui/src/completion.rs @@ -643,7 +643,6 @@ pub fn update(&mut self, input: String, completion_items: Vec) { item: item.to_owned(), score: -1 - index as i64, label_score: -1 - index as i64, - index, indices: Vec::new(), }) .collect(); diff --git a/lapce-ui/src/palette.rs b/lapce-ui/src/palette.rs index 5e6ab15d..beef1c39 100644 --- a/lapce-ui/src/palette.rs +++ b/lapce-ui/src/palette.rs @@ -8,7 +8,7 @@ piet::{Text, TextLayoutBuilder}, BoxConstraints, Command, Data, Env, Event, EventCtx, FontFamily, LayoutCtx, LifeCycle, LifeCycleCtx, PaintCtx, Point, RenderContext, Size, Target, - UpdateCtx, Widget, WidgetExt, WidgetId, WidgetPod, WindowId, + UpdateCtx, Widget, WidgetExt, WidgetId, WidgetPod, }; use druid::{FontWeight, Modifiers}; use lapce_data::command::LAPCE_COMMAND; @@ -22,7 +22,6 @@ keypress::KeyPressFocus, palette::{PaletteStatus, PaletteType, PaletteViewData, PaletteViewLens}, }; -use lsp_types::SymbolKind; use crate::{ editor::view::LapceEditorView, @@ -30,13 +29,6 @@ svg::{file_svg_new, symbol_svg_new}, }; -#[derive(Clone, Debug, PartialEq)] -pub enum PaletteIcon { - File(String), - Symbol(SymbolKind), - None, -} - pub struct NewPalette { widget_id: WidgetId, container: WidgetPod>>, @@ -426,25 +418,6 @@ fn paint(&mut self, ctx: &mut PaintCtx, data: &LapceTabData, env: &Env) { } } -pub struct PaletteInput { - #[allow(dead_code)] - window_id: WindowId, - - #[allow(dead_code)] - tab_id: WidgetId, -} - -pub struct PaletteContent { - #[allow(dead_code)] - window_id: WindowId, - - #[allow(dead_code)] - tab_id: WidgetId, - - #[allow(dead_code)] - max_items: usize, -} - pub struct NewPaletteInput {} impl NewPaletteInput { @@ -937,23 +910,3 @@ fn layout( fn paint(&mut self, _ctx: &mut PaintCtx, _data: &PaletteViewData, _env: &Env) {} } - -impl PaletteInput { - pub fn new(window_id: WindowId, tab_id: WidgetId) -> PaletteInput { - PaletteInput { window_id, tab_id } - } -} - -impl PaletteContent { - pub fn new( - window_id: WindowId, - tab_id: WidgetId, - max_items: usize, - ) -> PaletteContent { - PaletteContent { - window_id, - tab_id, - max_items, - } - } -} diff --git a/lapce-ui/src/panel.rs b/lapce-ui/src/panel.rs index bbaa31d6..2b6694d5 100644 --- a/lapce-ui/src/panel.rs +++ b/lapce-ui/src/panel.rs @@ -20,8 +20,6 @@ }; pub struct LapcePanel { - #[allow(dead_code)] - widget_id: WidgetId, header: WidgetPod>>, split: WidgetPod, } @@ -132,7 +130,6 @@ pub fn new( PanelHeaderKind::Widget(w) => w, }; Self { - widget_id, split: WidgetPod::new(split), header: WidgetPod::new(header), } @@ -174,8 +171,6 @@ pub enum PanelHeaderKind { } pub struct PanelSection { - #[allow(dead_code)] - widget_id: WidgetId, header: Option>>>, content: WidgetPod< LapceTabData, @@ -185,13 +180,12 @@ pub struct PanelSection { impl PanelSection { pub fn new( - widget_id: WidgetId, + _widget_id: WidgetId, header: Option>>, content: Box>, ) -> Self { let content = LapceScrollNew::new(content).vertical(); Self { - widget_id, header: header.map(WidgetPod::new), content: WidgetPod::new(content), } @@ -380,20 +374,17 @@ pub struct PanelMainHeader { text: ReadOnlyString, icons: Vec, - #[allow(dead_code)] - panel_widget_id: WidgetId, kind: PanelKind, mouse_pos: Point, } impl PanelMainHeader { pub fn new( - panel_widget_id: WidgetId, + _panel_widget_id: WidgetId, kind: PanelKind, text: ReadOnlyString, ) -> Self { Self { - panel_widget_id, kind, text, icons: Vec::new(), diff --git a/lapce-ui/src/scroll.rs b/lapce-ui/src/scroll.rs index 7bba0b66..670d7da3 100644 --- a/lapce-ui/src/scroll.rs +++ b/lapce-ui/src/scroll.rs @@ -81,16 +81,6 @@ pub fn force_pan_to(&mut self, origin: Point) -> bool { } } -#[derive(Debug, Clone)] -enum ScrollDirection { - #[allow(dead_code)] - Bidirectional, - #[allow(dead_code)] - Vertical, - #[allow(dead_code)] - Horizontal, -} - /// Minimum length for any scrollbar to be when measured on that /// scrollbar's primary axis. pub const SCROLLBAR_MIN_SIZE: f64 = 45.0;