message: Recreate Main.enso file if it is missing. (https://github.com/enso-org/ide/pull/705)
  Original commit:
diff: use crate::prelude::*;
  +use crate::controller::FilePath;
  use crate::model::module::Path as ModulePath;
  use crate::view::layout::ViewLayout;
  @@ -42,6 +43,9 @@ pub const INITIAL_MODULE_NAME:&str = "Main";
  /// This is the definition whose graph will be opened on IDE start.
  pub const MAIN_DEFINITION_NAME:&str = "main";
  +/// The default content of the newly created initial module file.
  +pub const DEFAULT_MAIN_CONTENT:&str = r#"main = IO.println "Hello, World!""#;
  +
  // ===================
  @@ -76,6 +80,16 @@ pub fn initial_module_path(project:&model::Project) -> FallibleResult<ModulePath
  model::module::Path::from_name_segments(project.content_root_id(),&[INITIAL_MODULE_NAME])
  }
  +/// Create a file with default content if it does not already exist.
  +pub async fn recreate_if_missing(project:&model::Project, path:&FilePath, default_content:String)
  +-> FallibleResult<()> {
  + let rpc = project.json_rpc();
  + if !rpc.file_exists(path).await?.exists {
  + rpc.write_file(path,&default_content).await?;
  + }
  + Ok(())
  +}
  +
  impl ProjectView {
  /// Create a new ProjectView.
  pub async fn new(logger:impl AnyLogger, model:model::Project)
  @@ -83,6 +97,9 @@ impl ProjectView {
  let logger = Logger::sub(logger,"ProjectView");
  let module_path = initial_module_path(&model)?;
  let file_path = module_path.file_path().clone();
  + // TODO [mwu] This solution to recreate missing main file should be considered provisional
  + // until proper decision is made. See: https://github.com/enso-org/enso/issues/1050
  + recreate_if_missing(&model,&file_path,DEFAULT_MAIN_CONTENT.into()).await?;
  let text_controller = controller::Text::new(&logger,&model,file_path).await?;
  let method = module_path.method_pointer(MAIN_DEFINITION_NAME);
  let graph_controller = controller::ExecutedGraph::new(&logger,model.clone_ref(),method);
  