From 215cd76bcea76d90ad7bf547ea9e391bdf533965 Mon Sep 17 00:00:00 2001 From: Adam Obuchowicz Date: Wed, 1 Dec 2021 14:25:48 +0100 Subject: [PATCH] After creating a new project, nodes are not laid out. (#3174) --- app/gui/controller/double-representation/src/lib.rs | 2 -- app/gui/controller/double-representation/src/module.rs | 2 -- .../double-representation/src/refactorings/collapse.rs | 2 +- app/gui/src/ide/integration/project.rs | 4 ++-- app/gui/src/lib.rs | 2 -- app/gui/src/model/execution_context/synchronized.rs | 2 +- app/gui/view/src/window_control_buttons/common.rs | 4 ++-- 7 files changed, 6 insertions(+), 12 deletions(-) diff --git a/app/gui/controller/double-representation/src/lib.rs b/app/gui/controller/double-representation/src/lib.rs index 62806341636..06c6eff6ebd 100644 --- a/app/gui/controller/double-representation/src/lib.rs +++ b/app/gui/controller/double-representation/src/lib.rs @@ -53,8 +53,6 @@ pub mod prelude { pub use enso_logger::*; pub use enso_prelude::*; - pub use enso_logger::DefaultTraceLogger as Logger; - #[cfg(test)] pub use wasm_bindgen_test::wasm_bindgen_test; #[cfg(test)] diff --git a/app/gui/controller/double-representation/src/module.rs b/app/gui/controller/double-representation/src/module.rs index f49be85f649..0526fa13a5d 100644 --- a/app/gui/controller/double-representation/src/module.rs +++ b/app/gui/controller/double-representation/src/module.rs @@ -511,8 +511,6 @@ impl Info { parser: &parser::Parser, to_add: &QualifiedName, ) { - let imports = self.iter_imports().collect_vec(); - DEBUG!("add_module_import: {to_add} in {imports:?}"); let is_here = to_add == here; let import = ImportInfo::from_qualified_name(to_add); let already_imported = self.iter_imports().any(|imp| imp == import); diff --git a/app/gui/controller/double-representation/src/refactorings/collapse.rs b/app/gui/controller/double-representation/src/refactorings/collapse.rs index 90f0a4f4ede..6fd8c01c9a6 100644 --- a/app/gui/controller/double-representation/src/refactorings/collapse.rs +++ b/app/gui/controller/double-representation/src/refactorings/collapse.rs @@ -399,7 +399,7 @@ mod tests { impl Case { fn run(&self, parser: &Parser) { - let logger = Logger::new("Collapsing_Test"); + let logger = DefaultTraceLogger::new("Collapsing_Test"); let ast = parser.parse_module(self.initial_method_code, default()).unwrap(); let main = module::locate_child(&ast, &self.refactored_name).unwrap(); let graph = graph::GraphInfo::from_definition(main.item.clone()); diff --git a/app/gui/src/ide/integration/project.rs b/app/gui/src/ide/integration/project.rs index 12c5a6c72b4..a34bbe15ab9 100644 --- a/app/gui/src/ide/integration/project.rs +++ b/app/gui/src/ide/integration/project.rs @@ -790,7 +790,7 @@ impl Model { let base_default_position = default_node_position(); let mut trees = connections_info.trees.clone(); let nodes = self.graph.graph().nodes()?; - let (without_pos, with_pos): (Vec<_>, Vec<_>) = + let (with_pos, without_pos): (Vec<_>, Vec<_>) = nodes.iter().partition(|n| n.has_position()); let bottommost_node_pos = with_pos .iter() @@ -1068,7 +1068,7 @@ impl Model { notification: crate::integration::visualization::Notification, ) { use crate::integration::visualization::Notification; - warning!(self.logger, "Received update for {which} visualization: {notification:?}"); + info!(self.logger, "Received update for {which} visualization: {notification:?}"); match notification { Notification::ValueUpdate { target, data, .. } => { if let Ok(view_id) = self.get_displayed_node_id(target) { diff --git a/app/gui/src/lib.rs b/app/gui/src/lib.rs index 1efa677a88d..890a34433fc 100644 --- a/app/gui/src/lib.rs +++ b/app/gui/src/lib.rs @@ -58,8 +58,6 @@ pub mod prelude { pub use ensogl::prelude::*; pub use wasm_bindgen::prelude::*; - pub use enso_logger::DefaultTraceLogger as Logger; - pub use crate::constants; pub use crate::controller; pub use crate::executor; diff --git a/app/gui/src/model/execution_context/synchronized.rs b/app/gui/src/model/execution_context/synchronized.rs index 6a0c4e0201f..fbe98d48a40 100644 --- a/app/gui/src/model/execution_context/synchronized.rs +++ b/app/gui/src/model/execution_context/synchronized.rs @@ -121,7 +121,7 @@ impl ExecutionContext { match notification { Notification::Completed => if !self.model.is_ready.replace(true) { - WARNING!("Context {self.id} Became ready"); + info!(self.logger, "Context {self.id} Became ready"); }, Notification::ExpressionUpdates(updates) => { self.model.computed_value_info_registry.apply_updates(updates); diff --git a/app/gui/view/src/window_control_buttons/common.rs b/app/gui/view/src/window_control_buttons/common.rs index c5685063e71..0caa8788a4c 100644 --- a/app/gui/view/src/window_control_buttons/common.rs +++ b/app/gui/view/src/window_control_buttons/common.rs @@ -124,7 +124,7 @@ pub mod shape { #[allow(missing_docs)] pub struct Model { app: Application, - logger: DefaultTraceLogger, + logger: Logger, display_object: display::object::Instance, shape: ShapeView, } @@ -133,7 +133,7 @@ impl Model { /// Construct a button's model. pub fn new(app: &Application) -> Self { let app = app.clone_ref(); - let logger = DefaultTraceLogger::new(Shape::debug_name()); + let logger = Logger::new(Shape::debug_name()); let display_object = display::object::Instance::new(&logger); let shape = ShapeView::new(&logger); display_object.add_child(&shape);