diff --git a/Cargo.toml b/Cargo.toml index fc8025b..e1cebe6 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -5,7 +5,7 @@ edition = "2024" [[bin]] name = "clide" -path = "src/main.rs" +path = "src/bin/clide/main.rs" [workspace] resolver = "3" diff --git a/build.rs b/build.rs index 9b37fb0..9e8e8e9 100644 --- a/build.rs +++ b/build.rs @@ -28,6 +28,6 @@ fn main() { .qt_module("Svg") .qt_module("Xml") .qrc("./resources.qrc") - .files(["src/ide/gui/colors.rs", "src/ide/gui/filesystem.rs"]) + .files(["src/bin/clide/gui/colors.rs", "src/bin/clide/gui/filesystem.rs"]) .build(); } diff --git a/libclide-macros/src/lib.rs b/libclide-macros/src/lib.rs index b133d4f..57fba49 100644 --- a/libclide-macros/src/lib.rs +++ b/libclide-macros/src/lib.rs @@ -15,7 +15,7 @@ pub fn loggable(item: TokenStream) -> TokenStream { let (impl_generics, type_generics, where_clause) = generics.split_for_impl(); let struct_name_str = struct_name.to_string(); let expanded = quote! { - impl #impl_generics crate::logging::Loggable for #struct_name #type_generics #where_clause { + impl #impl_generics clide::logging::Loggable for #struct_name #type_generics #where_clause { const ID: &'static str = #struct_name_str; } }; diff --git a/src/ide/cli.rs b/src/bin/clide/cli.rs similarity index 97% rename from src/ide/cli.rs rename to src/bin/clide/cli.rs index 97721a3..b2f12e9 100644 --- a/src/ide/cli.rs +++ b/src/bin/clide/cli.rs @@ -4,7 +4,7 @@ pub mod app_context; -use crate::ide::cli::app_context::RunMode; +use crate::cli::app_context::RunMode; use anyhow::{Result, anyhow}; use clap::Parser; diff --git a/src/ide/cli/app_context.rs b/src/bin/clide/cli/app_context.rs similarity index 90% rename from src/ide/cli/app_context.rs rename to src/bin/clide/cli/app_context.rs index 084d340..81e79e3 100644 --- a/src/ide/cli/app_context.rs +++ b/src/bin/clide/cli/app_context.rs @@ -2,7 +2,7 @@ // // SPDX-License-Identifier: GNU General Public License v3.0 or later -use crate::ide::cli::Cli; +use crate::cli::Cli; use anyhow::{Context, Result}; pub struct AppContext { @@ -18,7 +18,7 @@ impl AppContext { // If no path was provided, use the current directory. None => std::env::current_dir().context("Failed to obtain current directory")?, }; - crate::info!(target:"main()", "Root path detected: {path:?}"); + clide::info!(target:"main()", "Root path detected: {path:?}"); Ok(Self { path, diff --git a/src/ide/gui.rs b/src/bin/clide/gui.rs similarity index 91% rename from src/ide/gui.rs rename to src/bin/clide/gui.rs index 16ca946..398c40a 100644 --- a/src/ide/gui.rs +++ b/src/bin/clide/gui.rs @@ -6,12 +6,12 @@ pub mod colors; pub mod filesystem; pub mod icon_provider; -use crate::ide::cli::app_context::AppContext; +use crate::cli::app_context::AppContext; use anyhow::Result; use cxx_qt_lib::{QMapPair, QMapPair_QString_QVariant, QString, QVariant}; pub fn run(app_context: AppContext) -> Result<()> { - crate::trace!(target:"gui::run()", "Starting the GUI editor at {:?}", app_context.path); + clide::trace!(target:"gui::run()", "Starting the GUI editor at {:?}", app_context.path); use cxx_qt_lib::{QGuiApplication, QQmlApplicationEngine, QUrl}; diff --git a/src/ide/gui/colors.rs b/src/bin/clide/gui/colors.rs similarity index 99% rename from src/ide/gui/colors.rs rename to src/bin/clide/gui/colors.rs index a60f50c..0cac2c7 100644 --- a/src/ide/gui/colors.rs +++ b/src/bin/clide/gui/colors.rs @@ -2,7 +2,7 @@ // // SPDX-License-Identifier: GNU General Public License v3.0 or later -use crate::theme::colors::Colors; +use clide::theme::colors::Colors; use cxx_qt_lib::QColor; #[cxx_qt::bridge] diff --git a/src/ide/gui/filesystem.rs b/src/bin/clide/gui/filesystem.rs similarity index 97% rename from src/ide/gui/filesystem.rs rename to src/bin/clide/gui/filesystem.rs index 6daed5b..6ee9079 100644 --- a/src/ide/gui/filesystem.rs +++ b/src/bin/clide/gui/filesystem.rs @@ -76,7 +76,7 @@ impl qobject::FileSystem { let meta = fs::metadata(path.to_string()) .unwrap_or_else(|_| panic!("Failed to get file metadata {path:?}")); if !meta.is_file() { - crate::warn!(target:"FileSystem", "Attempted to open file {path:?} that is not a valid file"); + clide::warn!(target:"FileSystem", "Attempted to open file {path:?} that is not a valid file"); return QString::default(); } let path_str = path.to_string(); @@ -141,6 +141,6 @@ impl qobject::FileSystem { } fn icon(self: std::pin::Pin<&mut Self>, path: &QString) -> QString { - QString::from(crate::fs::icon(path.to_string().as_str()).to_string()) + QString::from(clide::fs::icon(path.to_string().as_str()).to_string()) } } diff --git a/src/main.rs b/src/bin/clide/main.rs similarity index 79% rename from src/main.rs rename to src/bin/clide/main.rs index 0711527..ae4f14c 100644 --- a/src/main.rs +++ b/src/bin/clide/main.rs @@ -2,18 +2,22 @@ // // SPDX-License-Identifier: GNU General Public License v3.0 or later +mod cli; +mod gui; +mod tui; + use anyhow::{Context, Result}; use clap::Parser; -use clide::ide::cli::Cli; -use clide::ide::cli::app_context::{AppContext, RunMode}; +use cli::Cli; +use cli::app_context::{AppContext, RunMode}; use std::process::{Command, Stdio}; fn main() -> Result<()> { let args = Cli::parse(); let app_context = AppContext::new(args)?; match app_context.run_mode { - RunMode::GuiAttached => clide::ide::gui::run(app_context), - RunMode::Tui => clide::ide::tui::run(app_context), + RunMode::GuiAttached => gui::run(app_context), + RunMode::Tui => tui::run(app_context), RunMode::Gui => { clide::trace!(target:"main()", "Starting GUI in a new process"); Command::new(std::env::current_exe()?) diff --git a/src/ide/tui.rs b/src/bin/clide/tui.rs similarity index 87% rename from src/ide/tui.rs rename to src/bin/clide/tui.rs index 1f16143..42473d0 100644 --- a/src/ide/tui.rs +++ b/src/bin/clide/tui.rs @@ -11,10 +11,10 @@ pub mod explorer; pub mod logger; pub mod menu_bar; -use crate::ide::cli::app_context::AppContext; -use crate::logging::Loggable; +use crate::cli::app_context::AppContext; use ::log::LevelFilter; use anyhow::{Context, Result}; +use clide::logging::Loggable; use ratatui::Terminal; use ratatui::backend::CrosstermBackend; use ratatui::crossterm::event::{ @@ -36,7 +36,7 @@ struct Tui { } pub fn run(app_context: AppContext) -> Result<()> { - crate::trace!(target: "clide::tui::run", "Starting TUI"); + clide::trace!(target: "clide::tui::run", "Starting TUI"); Tui::new(app_context)?.start() } @@ -44,7 +44,7 @@ impl Tui { fn new(app_context: AppContext) -> Result { init_logger(LevelFilter::Trace)?; set_default_level(LevelFilter::Trace); - crate::debug!("Logging initialized"); + clide::debug!("Logging initialized"); let mut dir = env::temp_dir(); dir.push("clide.log"); @@ -56,7 +56,7 @@ impl Tui { .output_file(false) .output_separator(':'); set_log_file(file_options); - crate::debug!("Logging to file: {dir:?}"); + clide::debug!("Logging to file: {dir:?}"); Ok(Self { terminal: Terminal::new(CrosstermBackend::new(stdout()))?, @@ -65,7 +65,7 @@ impl Tui { } fn start(self) -> Result<()> { - crate::info!("Starting the TUI editor at {:?}", self.root_path); + clide::info!("Starting the TUI editor at {:?}", self.root_path); ratatui::crossterm::execute!( stdout(), EnterAlternateScreen, @@ -82,7 +82,7 @@ impl Tui { } fn stop() -> Result<()> { - crate::info!("Stopping the TUI editor"); + clide::info!("Stopping the TUI editor"); disable_raw_mode()?; ratatui::crossterm::execute!( stdout(), diff --git a/src/ide/tui/about.rs b/src/bin/clide/tui/about.rs similarity index 97% rename from src/ide/tui/about.rs rename to src/bin/clide/tui/about.rs index 8ba4768..47c5bd4 100644 --- a/src/ide/tui/about.rs +++ b/src/bin/clide/tui/about.rs @@ -2,7 +2,7 @@ // // SPDX-License-Identifier: GNU General Public License v3.0 or later -use crate::logging::Loggable; +use clide::logging::Loggable; use ratatui::buffer::Buffer; use ratatui::layout::{Constraint, Direction, Layout, Rect}; use ratatui::text::{Line, Span}; @@ -13,7 +13,7 @@ pub struct About {} impl About { pub fn new() -> Self { - // crate::trace!("Building {}", Self::id()); + // clide::trace!("Building {}", Self::id()); Self {} } } diff --git a/src/ide/tui/app.rs b/src/bin/clide/tui/app.rs similarity index 93% rename from src/ide/tui/app.rs rename to src/bin/clide/tui/app.rs index 04a4719..3a2e8e3 100644 --- a/src/ide/tui/app.rs +++ b/src/bin/clide/tui/app.rs @@ -2,13 +2,13 @@ // // SPDX-License-Identifier: GNU General Public License v3.0 or later -use crate::ide::tui::about::About; -use crate::ide::tui::component::{Action, Component, Focus, FocusState, Visibility, VisibleState}; -use crate::ide::tui::editor_tab::EditorTab; -use crate::ide::tui::explorer::Explorer; -use crate::ide::tui::logger::Logger; -use crate::ide::tui::menu_bar::MenuBar; -use crate::logging::Loggable; +use crate::tui::about::About; +use crate::tui::component::{Action, Component, Focus, FocusState, Visibility, VisibleState}; +use crate::tui::editor_tab::EditorTab; +use crate::tui::explorer::Explorer; +use crate::tui::logger::Logger; +use crate::tui::menu_bar::MenuBar; +use clide::logging::Loggable; use anyhow::{Context, Result}; use ratatui::DefaultTerminal; use ratatui::buffer::Buffer; @@ -42,7 +42,7 @@ pub struct App<'a> { impl<'a> App<'a> { pub fn new(root_path: PathBuf) -> Result { - crate::trace!("Building {}", Self::ID); + clide::trace!("Building"); let app = Self { editor_tab: EditorTab::new(), explorer: Explorer::new(&root_path)?, @@ -56,13 +56,13 @@ impl<'a> App<'a> { /// Logic that should be executed once on application startup. pub fn start(&mut self) -> Result<()> { - crate::trace!("Starting App"); + clide::trace!("Starting App"); Ok(()) } pub fn run(mut self, mut terminal: DefaultTerminal) -> Result<()> { self.start()?; - crate::trace!("Entering App run loop"); + clide::trace!("Entering App run loop"); loop { terminal.draw(|f| { f.render_widget(&mut self, f.area()); @@ -88,7 +88,7 @@ impl<'a> App<'a> { Some(editor) => editor.component_state.help_text.clone(), None => { if !self.editor_tab.is_empty() { - crate::error!("Failed to get Editor while drawing bottom status bar"); + clide::error!("Failed to get Editor while drawing bottom status bar"); } "Failed to get current Editor while getting widget help text".to_string() } @@ -112,26 +112,26 @@ impl<'a> App<'a> { } fn clear_focus(&mut self) { - crate::info!("Clearing all widget focus"); + clide::info!("Clearing all widget focus"); self.explorer.component_state.set_focus(Focus::Inactive); self.explorer.component_state.set_focus(Focus::Inactive); self.logger.component_state.set_focus(Focus::Inactive); self.menu_bar.component_state.set_focus(Focus::Inactive); match self.editor_tab.current_editor_mut() { None => { - crate::error!("Failed to get current Editor while clearing focus") + clide::error!("Failed to get current Editor while clearing focus") } Some(editor) => editor.component_state.set_focus(Focus::Inactive), } } fn change_focus(&mut self, focus: AppComponent) { - crate::info!("Changing widget focus to {:?}", focus); + clide::info!("Changing widget focus to {:?}", focus); self.clear_focus(); match focus { AppComponent::Editor => match self.editor_tab.current_editor_mut() { None => { - crate::error!("Failed to get current Editor while changing focus") + clide::error!("Failed to get current Editor while changing focus") } Some(editor) => editor.component_state.set_focus(Focus::Active), }, @@ -274,13 +274,13 @@ impl<'a> Component for App<'a> { Action::Quit | Action::Handled => Ok(action), Action::Save => match self.editor_tab.current_editor_mut() { None => { - crate::error!("Failed to get current editor while handling App Action::Save"); + clide::error!("Failed to get current editor while handling App Action::Save"); Ok(Action::Noop) } Some(editor) => match editor.save() { Ok(_) => Ok(Action::Handled), Err(e) => { - crate::error!("Failed to save editor contents: {e}"); + clide::error!("Failed to save editor contents: {e}"); Ok(Action::Noop) } }, @@ -299,14 +299,14 @@ impl<'a> Component for App<'a> { Err(_) => Ok(Action::Noop), }, Action::ReloadFile => { - crate::trace!("Reloading file for current editor"); + clide::trace!("Reloading file for current editor"); if let Some(editor) = self.editor_tab.current_editor_mut() { editor .reload_contents() .map(|_| Action::Handled) .context("Failed to handle Action::ReloadFile") } else { - crate::error!( + clide::error!( "Failed to get current editor while handling App Action::ReloadFile" ); Ok(Action::Noop) diff --git a/src/ide/tui/component.rs b/src/bin/clide/tui/component.rs similarity index 95% rename from src/ide/tui/component.rs rename to src/bin/clide/tui/component.rs index d875cbc..c0c962f 100644 --- a/src/ide/tui/component.rs +++ b/src/bin/clide/tui/component.rs @@ -4,9 +4,9 @@ #![allow(dead_code, unused_variables)] -use crate::ide::tui::component::Focus::Inactive; -use crate::logging::Loggable; -use crate::theme::colors::Colors; +use crate::tui::component::Focus::Inactive; +use clide::logging::Loggable; +use clide::theme::colors::Colors; use Focus::Active; use anyhow::Result; use ratatui::crossterm::event::{Event, KeyEvent, MouseEvent}; @@ -75,7 +75,7 @@ impl ComponentState { } fn new() -> Self { - crate::trace!(target:Self::id(), "Building {}", Self::id()); + clide::trace!(target:Self::id(), "Building {}", Self::id()); Self { focus: Active, vis: Visibility::Visible, diff --git a/src/ide/tui/editor.rs b/src/bin/clide/tui/editor.rs similarity index 90% rename from src/ide/tui/editor.rs rename to src/bin/clide/tui/editor.rs index e3caf24..a7758e0 100644 --- a/src/ide/tui/editor.rs +++ b/src/bin/clide/tui/editor.rs @@ -2,8 +2,8 @@ // // SPDX-License-Identifier: GNU General Public License v3.0 or later -use crate::ide::tui::component::{Action, Component, ComponentState, Focus, FocusState}; -use crate::logging::Loggable; +use crate::tui::component::{Action, Component, ComponentState, Focus, FocusState}; +use clide::logging::Loggable; use anyhow::{Context, Result, bail}; use edtui::{ EditorEventHandler, EditorState, EditorTheme, EditorView, LineNumbers, Lines, SyntaxHighlighter, @@ -27,7 +27,7 @@ pub struct Editor { impl Editor { pub fn new(path: &std::path::Path) -> Self { - crate::trace!("Building {}", ::ID); + clide::trace!("Building {}", ::ID); Editor { state: EditorState::default(), event_handler: EditorEventHandler::default(), @@ -41,10 +41,10 @@ impl Editor { } pub fn reload_contents(&mut self) -> Result<()> { - crate::trace!("Reloading editor file contents {:?}", self.file_path); + clide::trace!("Reloading editor file contents {:?}", self.file_path); match self.file_path.clone() { None => { - crate::error!("Failed to reload editor contents with None file_path"); + clide::error!("Failed to reload editor contents with None file_path"); bail!("Failed to reload editor contents with None file_path") } Some(path) => self.set_contents(&path), @@ -52,7 +52,7 @@ impl Editor { } pub fn set_contents(&mut self, path: &std::path::Path) -> Result<()> { - crate::trace!("Setting Editor contents from path {:?}", path); + clide::trace!("Setting Editor contents from path {:?}", path); if let Ok(contents) = std::fs::read_to_string(path) { let lines: Vec<_> = contents .lines() @@ -68,10 +68,10 @@ impl Editor { pub fn save(&self) -> Result<()> { if let Some(path) = &self.file_path { - crate::trace!("Saving Editor contents {:?}", path); + clide::trace!("Saving Editor contents {:?}", path); return std::fs::write(path, self.state.lines.to_string()).map_err(|e| e.into()); }; - crate::error!("Failed saving Editor contents; file_path was None"); + clide::error!("Failed saving Editor contents; file_path was None"); bail!("File not saved. No file path set.") } } diff --git a/src/ide/tui/editor_tab.rs b/src/bin/clide/tui/editor_tab.rs similarity index 90% rename from src/ide/tui/editor_tab.rs rename to src/bin/clide/tui/editor_tab.rs index 1069fed..5591995 100644 --- a/src/ide/tui/editor_tab.rs +++ b/src/bin/clide/tui/editor_tab.rs @@ -2,9 +2,8 @@ // // SPDX-License-Identifier: GNU General Public License v3.0 or later -use crate::ide::tui::component::{Action, Component, Focus, FocusState}; -use crate::ide::tui::editor::Editor; -use crate::logging::Loggable; +use crate::tui::editor::Editor; +use clide::logging::Loggable; use anyhow::{Context, Result, anyhow}; use ratatui::buffer::Buffer; use ratatui::crossterm::event::{Event, KeyCode, KeyEvent, KeyModifiers}; @@ -12,6 +11,7 @@ use ratatui::layout::Rect; use ratatui::prelude::{Color, Style}; use ratatui::widgets::{Block, Borders, Padding, Tabs, Widget}; use std::collections::HashMap; +use crate::tui::component::{Action, Component, Focus, FocusState}; // Render the tabs with keys as titles // Tab keys can be file names. @@ -25,7 +25,7 @@ pub struct EditorTab { impl EditorTab { pub fn new() -> Self { - crate::trace!("Building {}", ::ID); + clide::trace!("Building {}", ::ID); Self { editors: HashMap::new(), tab_order: Vec::new(), @@ -35,7 +35,7 @@ impl EditorTab { pub fn next_editor(&mut self) { let next = (self.current_editor + 1) % self.tab_order.len(); - crate::trace!( + clide::trace!( "Moving from {} to next editor tab at {}", self.current_editor, next @@ -49,7 +49,7 @@ impl EditorTab { .current_editor .checked_sub(1) .unwrap_or(self.tab_order.len() - 1); - crate::trace!( + clide::trace!( "Moving from {} to previous editor tab at {}", self.current_editor, prev @@ -62,7 +62,7 @@ impl EditorTab { match self.tab_order.get(index) { None => { if !self.tab_order.is_empty() { - crate::error!("Failed to get editor tab key with invalid index {index}"); + clide::error!("Failed to get editor tab key with invalid index {index}"); } None } @@ -80,7 +80,7 @@ impl EditorTab { } pub fn set_current_tab_focus(&mut self, focus: Focus) { - crate::trace!( + clide::trace!( "Setting current tab {} focus to {:?}", self.current_editor, focus @@ -89,10 +89,10 @@ impl EditorTab { } pub fn set_tab_focus(&mut self, focus: Focus, index: usize) { - crate::trace!("Setting tab {} focus to {:?}", index, focus); + clide::trace!("Setting tab {} focus to {:?}", index, focus); if focus == Focus::Active && index != self.current_editor { // If we are setting another tab to active, disable the current one. - crate::trace!( + clide::trace!( "New tab {} focus set to Active; Setting current tab {} to Inactive", index, self.current_editor @@ -101,11 +101,11 @@ impl EditorTab { } match self.get_editor_key(index) { None => { - crate::error!("Failed setting tab focus for invalid key {index}"); + clide::error!("Failed setting tab focus for invalid key {index}"); } Some(key) => match self.editors.get_mut(&key) { None => { - crate::error!( + clide::error!( "Failed to update tab focus at index {} with invalid key: {}", self.current_editor, self.tab_order[self.current_editor] @@ -117,12 +117,12 @@ impl EditorTab { } pub fn open_tab(&mut self, path: &std::path::Path) -> Result<()> { - crate::trace!("Opening new EditorTab with path {:?}", path); + clide::trace!("Opening new EditorTab with path {:?}", path); if self .editors .contains_key(&path.to_string_lossy().to_string()) { - crate::warn!("EditorTab already opened with this file"); + clide::warn!("EditorTab already opened with this file"); return Ok(()); } @@ -147,12 +147,12 @@ impl EditorTab { .to_owned(); match self.editors.remove(&key) { None => { - crate::error!("Failed to remove editor tab {key} with invalid index {index}") + clide::error!("Failed to remove editor tab {key} with invalid index {index}") } Some(_) => { self.prev_editor(); self.tab_order.remove(index); - crate::info!("Closed editor tab {key} at index {index}") + clide::info!("Closed editor tab {key} at index {index}") } } Ok(()) diff --git a/src/ide/tui/explorer.rs b/src/bin/clide/tui/explorer.rs similarity index 97% rename from src/ide/tui/explorer.rs rename to src/bin/clide/tui/explorer.rs index f8899cb..989c2d1 100644 --- a/src/ide/tui/explorer.rs +++ b/src/bin/clide/tui/explorer.rs @@ -2,10 +2,10 @@ // // SPDX-License-Identifier: GNU General Public License v3.0 or later -use crate::fs::entry_meta::EntryMeta; -use crate::ide::tui::component::{Action, Component, ComponentState, Focus, FocusState}; -use crate::logging::Loggable; +use crate::tui::component::{Action, Component, ComponentState, Focus, FocusState}; use anyhow::{Context, Result, bail}; +use clide::fs::entry_meta::EntryMeta; +use clide::logging::Loggable; use ratatui::buffer::Buffer; use ratatui::crossterm::event::{Event, KeyCode, KeyEvent, MouseEvent, MouseEventKind}; use ratatui::layout::{Alignment, Position, Rect}; @@ -26,7 +26,7 @@ pub struct Explorer<'a> { impl<'a> Explorer<'a> { pub fn new(path: &PathBuf) -> Result { - crate::trace!("Building {}", ::ID); + clide::trace!("Building {}", ::ID); let explorer = Explorer { root_path: EntryMeta::new(path)?, tree_items: Self::build_tree_from_path(path)?, diff --git a/src/ide/tui/logger.rs b/src/bin/clide/tui/logger.rs similarity index 95% rename from src/ide/tui/logger.rs rename to src/bin/clide/tui/logger.rs index bc4ac16..7443684 100644 --- a/src/ide/tui/logger.rs +++ b/src/bin/clide/tui/logger.rs @@ -2,8 +2,8 @@ // // SPDX-License-Identifier: GNU General Public License v3.0 or later -use crate::ide::tui::component::{Action, Component, ComponentState, Focus, FocusState}; -use crate::logging::Loggable; +use crate::tui::component::{Action, Component, ComponentState, Focus, FocusState}; +use clide::logging::Loggable; use log::LevelFilter; use ratatui::buffer::Buffer; use ratatui::crossterm::event::{Event, KeyCode, KeyEvent}; @@ -22,7 +22,7 @@ pub struct Logger { impl Logger { pub fn new() -> Self { - crate::trace!("Building {}", ::ID); + clide::trace!("Building {}", ::ID); let state = TuiWidgetState::new(); state.transition(TuiWidgetEvent::HideKey); Self { diff --git a/src/ide/tui/menu_bar.rs b/src/bin/clide/tui/menu_bar.rs similarity index 97% rename from src/ide/tui/menu_bar.rs rename to src/bin/clide/tui/menu_bar.rs index 86c9d78..a7079bd 100644 --- a/src/ide/tui/menu_bar.rs +++ b/src/bin/clide/tui/menu_bar.rs @@ -2,11 +2,11 @@ // // SPDX-License-Identifier: GNU General Public License v3.0 or later -use crate::ide::tui::component::{Action, Component, ComponentState, FocusState}; -use crate::ide::tui::menu_bar::MenuBarItemOption::{ +use crate::tui::component::{Action, Component, ComponentState, FocusState}; +use crate::tui::menu_bar::MenuBarItemOption::{ About, CloseTab, Exit, Reload, Save, ShowHideExplorer, ShowHideLogger, }; -use crate::logging::Loggable; +use clide::logging::Loggable; use anyhow::Context; use ratatui::buffer::Buffer; use ratatui::crossterm::event::{KeyCode, KeyEvent}; @@ -92,7 +92,7 @@ pub struct MenuBar { impl MenuBar { const DEFAULT_HELP: &str = "(←/h)/(→/l): Select option | Enter: Choose selection"; pub fn new() -> Self { - crate::trace!("Building"); + clide::trace!("Building"); Self { selected: MenuBarItem::File, opened: None, diff --git a/src/ide.rs b/src/ide.rs deleted file mode 100644 index 881fc2f..0000000 --- a/src/ide.rs +++ /dev/null @@ -1,7 +0,0 @@ -// SPDX-FileCopyrightText: 2026, Shaun Reed -// -// SPDX-License-Identifier: GNU General Public License v3.0 or later - -pub mod cli; -pub mod gui; -pub mod tui; diff --git a/src/lib.rs b/src/lib.rs index 5d25725..0209729 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -3,6 +3,5 @@ // SPDX-License-Identifier: GNU General Public License v3.0 or later pub mod fs; -pub mod ide; pub mod logging; pub mod theme;