From 4e97ee700c7d8245ba1e9d90a3c7f25343610b11 Mon Sep 17 00:00:00 2001 From: Michae Mauderer Date: Tue, 20 Jul 2021 08:48:13 +0100 Subject: [PATCH] Fix rebase issues. --- src/rust/ide/src/controller/project.rs | 5 ++--- src/rust/ide/src/ide/integration/project.rs | 2 +- src/rust/ide/src/model/project.rs | 4 ++-- 3 files changed, 5 insertions(+), 6 deletions(-) diff --git a/src/rust/ide/src/controller/project.rs b/src/rust/ide/src/controller/project.rs index 6a79688f8b..10f0746e85 100644 --- a/src/rust/ide/src/controller/project.rs +++ b/src/rust/ide/src/controller/project.rs @@ -4,7 +4,6 @@ use crate::prelude::*; use crate::controller::graph::executed::Notification as GraphNotification; use crate::controller::ide::StatusNotificationPublisher; -use crate::double_representation::module::ImportInfo; use crate::model::traits::*; use crate::double_representation::project; use crate::model::module::QualifiedName; @@ -143,9 +142,9 @@ impl Project { let main_module_model = self.model.module(module_path.clone()).await?; Self::add_main_if_missing(project.qualified_name(), &main_module_model, &method, &parser)?; - let mut info = module.info(); + let mut info = main_module_model.info(); info.add_module_import(&project.qualified_module_name(&module_path), &project.parser(), &QualifiedName::from_text("Standard.Visualization").unwrap()); - module.update_ast(info.ast)?; + main_module_model.update_ast(info.ast)?; // Here, we should be relatively certain (except race conditions in case of multiple // clients that we currently do not support) that main module exists and contains main diff --git a/src/rust/ide/src/ide/integration/project.rs b/src/rust/ide/src/ide/integration/project.rs index e83e67df0e..73d7ed0fe0 100644 --- a/src/rust/ide/src/ide/integration/project.rs +++ b/src/rust/ide/src/ide/integration/project.rs @@ -1464,7 +1464,7 @@ impl Model { -> FallibleResult { use visualization::instance::ContextModule::*; match context { - ProjectMain => Ok(self.project.main_module()), + ProjectMain => Ok(self.project.main_module()?), Specific(module_name) => model::module::QualifiedName::from_text(module_name), } } diff --git a/src/rust/ide/src/model/project.rs b/src/rust/ide/src/model/project.rs index 3a7d5a0ccf..a8a1f3598b 100644 --- a/src/rust/ide/src/model/project.rs +++ b/src/rust/ide/src/model/project.rs @@ -102,8 +102,8 @@ pub trait API:Debug { #[allow(clippy::needless_lifetimes)] // Note: Needless lifetimes fn main_module_model<'a>(&'a self) -> BoxFuture<'a, FallibleResult> { async move { - let main_name = self.main_module(); - let main_path = model::module::Path::from_id(self.content_root_id(), &main_name.id); + let main_name = self.main_module()?; + let main_path = model::module::Path::from_id(self.project_content_root_id(), &main_name.id); self.module(main_path).await }.boxed_local() }