From 325bb3ca3789843304424c7d552d0d3bb8d39ea2 Mon Sep 17 00:00:00 2001 From: nsfisis Date: Sun, 5 Jul 2026 19:27:56 +0900 Subject: feat(global-command): wire resetComposer and Application::run proxying Application::find/reset_composer and the shared ApplicationHandle are now available, so GlobalCommand can reset the composer instance before building the sub-command input and proxy execution through the full Application::run dispatch, matching PHP's behavior. Un-ignores the tests that only depended on this wiring, and re-points the remaining ignores at their real (unrelated) blockers. --- crates/shirabe/src/command/global_command.rs | 23 +++++++++++++++++------ 1 file changed, 17 insertions(+), 6 deletions(-) (limited to 'crates/shirabe/src/command/global_command.rs') diff --git a/crates/shirabe/src/command/global_command.rs b/crates/shirabe/src/command/global_command.rs index 27331a7..b0a3542 100644 --- a/crates/shirabe/src/command/global_command.rs +++ b/crates/shirabe/src/command/global_command.rs @@ -3,6 +3,7 @@ use crate::command::BaseCommand; use crate::command::BaseCommandData; use crate::command::base_command::base_command_initialize; +use crate::console::Application; use crate::console::input::InputArgument; use crate::factory::Factory; use crate::util::Filesystem; @@ -106,8 +107,7 @@ impl GlobalCommand { &Self::input_to_string(&*input.borrow())?, 1, ); - // TODO(phase-c): getApplication()->resetComposer() needs the shared shirabe Application - // handle (deferred with the Application shared-ownership work). + self.reset_composer()?; StringInput::new(&new_input_str) } @@ -171,10 +171,21 @@ impl Command for GlobalCommand { } let sub_input = self.prepare_subcommand_input(input, false)?; - // TODO(phase-c): proxying to Application::run needs the shared shirabe Application handle - // (deferred with the Application shared-ownership work and command registration). - let _ = (sub_input, output); - todo!("global command proxy run pending shared Application handle") + let sub_input: Rc> = Rc::new(RefCell::new(sub_input)); + + let application = { + let application = self + .get_application() + .expect("a proxy command is always attached to its application"); + let application = application.borrow(); + application + .as_any() + .downcast_ref::() + .expect("shirabe always installs its own Application") + .shared() + }; + + Ok(application.run(Some(sub_input), Some(output))? as i64) } fn initialize( -- cgit v1.3.1