Skip to content
This repository has been archived by the owner on Dec 28, 2021. It is now read-only.

Commit

Permalink
Fix rebase issues.
Browse files Browse the repository at this point in the history
  • Loading branch information
MichaelMauderer committed Jul 20, 2021
1 parent ef1189d commit 4e97ee7
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 6 deletions.
5 changes: 2 additions & 3 deletions src/rust/ide/src/controller/project.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion src/rust/ide/src/ide/integration/project.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1464,7 +1464,7 @@ impl Model {
-> FallibleResult<model::module::QualifiedName> {
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),
}
}
Expand Down
4 changes: 2 additions & 2 deletions src/rust/ide/src/model/project.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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<model::Module>> {
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()
}
Expand Down

0 comments on commit 4e97ee7

Please sign in to comment.