pub fn start_and_forget(self) {
        let executor = setup_global_executor();
        executor::global::spawn(async move {
            info!(self.logger, "Starting IDE with the following config: {self.config:?}");

            let application   = Application::new(&web::get_html_element_by_id("root").unwrap());
            let view          = application.new_view::<ide_view::project::View>();
            let status_bar    = view.status_bar().clone_ref();
            // We know the name of new project before it loads. We set it right now to avoid
            // displaying placeholder on the scene during loading.
            view.graph().model.breadcrumbs.project_name(self.config.project_name.to_string());
            application.display.add_child(&view);
            // TODO [mwu] Once IDE gets some well-defined mechanism of reporting
            //      issues to user, such information should be properly passed
            //      in case of setup failure.
            let result:FallibleResult<Ide> = (async {
                let controller    = self.initialize_ide_controller().await?;
                Ok(Ide::new(application,view.clone_ref(),controller).await)
            }).await;

            match result {
                Ok(ide) => {
                    info!(self.logger,"Setup done.");
                    std::mem::forget(ide);
                },
                Err(err) => {
                    let message = iformat!("Failed to initialize application: {err}");
                    error!(self.logger,"{message}");
                    status_bar.add_event(ide_view::status_bar::event::Label::new(message));
                    std::mem::forget(view);
                }
            }

            web::get_element_by_id("loader").map(|t| {
                t.parent_node().map(|p| {
                    p.remove_child(&t).unwrap()
                })
            }).ok();
        });
        std::mem::forget(executor);
    }
/// Initialize all Ide objects and structures (executor, views, controllers, integration etc.)
/// and forget them to keep them alive.
Initialize all Ide objects and structures (executor, views, controllers, integration etc.)
and forget them to keep them alive.
Initialize all Ide objects and structures ( executor views controllers integration etc . ) and forget them to keep them alive .
pub fn start_and_forget(self) {
        let executor = setup_global_executor();
        executor::global::spawn(async move {
            info!(self.logger, "Starting IDE with the following config: {self.config:?}");
            let application   = Application::new(&web::get_html_element_by_id("root").unwrap());
            let view          = application.new_view::<ide_view::project::View>();
            let status_bar    = view.status_bar().clone_ref();
            // We know the name of new project before it loads. We set it right now to avoid
            // displaying placeholder on the scene during loading.
            view.graph().model.breadcrumbs.project_name(self.config.project_name.to_string());
            application.display.add_child(&view);
            // TODO [mwu] Once IDE gets some well-defined mechanism of reporting
            //      issues to user, such information should be properly passed
            //      in case of setup failure.
            let result:FallibleResult<Ide> = (async {
                let controller    = self.initialize_ide_controller().await?;
                Ok(Ide::new(application,view.clone_ref(),controller).await)
            }).await;
            match result {
                Ok(ide) => {
                    info!(self.logger,"Setup done.");
                    std::mem::forget(ide);
                },
                Err(err) => {
                    let message = iformat!("Failed to initialize application: {err}");
                    error!(self.logger,"{message}");
                    status_bar.add_event(ide_view::status_bar::event::Label::new(message));
                    std::mem::forget(view);
                }
            }
            web::get_element_by_id("loader").map(|t| {
                t.parent_node().map(|p| {
                    p.remove_child(&t).unwrap()
                })
            }).ok();
        });
        std::mem::forget(executor);
    }
pub fn start_and_forget ( self ) { let executor = setup_global_executor ( ) ; executor :: global :: spawn ( async move { info ! ( self logger " " ) ; let application = Application :: new ( & web :: get_html_element_by_id ( " " ) . unwrap ( ) ) ; let view = application . new_view :: < ide_view :: project :: View > ( ) ; let status_bar = view . status_bar ( ) . clone_ref ( ) ; // We know the name of new project before it loads. We set it right now to avoid // displaying placeholder on the scene during loading. view . graph ( ) . model . breadcrumbs . project_name ( self . config . project_name . to_string ( ) ) ; application . display . add_child ( & view ) ; // TODO [mwu] Once IDE gets some well-defined mechanism of reporting //      issues to user, such information should be properly passed //      in case of setup failure. let result : FallibleResult < Ide > = ( async { let controller = self . initialize_ide_controller ( ) . await ? ; Ok ( Ide :: new ( application , view . clone_ref ( ) , controller ) . await ) } ) . await ; match result { Ok ( ide ) => { info ! ( self logger " " ) ; std :: mem :: forget ( ide ) ; } , Err ( err ) => { let message = iformat ! ( " " ) ; error ! ( self logger " " ) ; status_bar . add_event ( ide_view :: status_bar :: event :: Label :: new ( message ) ) ; std :: mem :: forget ( view ) ; } } web :: get_element_by_id ( " " ) . map ( | t | { t . parent_node ( ) . map ( | p | { p . remove_child ( & t ) . unwrap ( ) } ) } ) . ok ( ) ; } ) ; std :: mem :: forget ( executor ) ; }
Initialize all Ide objects and structures (executor, views, controllers, integration etc.)
Initialize all Ide objects and structures ( executor views controllers integration etc . )
self
self