-
Notifications
You must be signed in to change notification settings - Fork 34
Create new project action in searcher. #1566
Conversation
3463a1e
to
99f32f1
Compare
src/rust/ide/src/controller/ide.rs
Outdated
// === Status Notifications === | ||
// ============================ | ||
|
||
pub type ProcessHandle = usize; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't like the name Process
here, initially I thought about different kind of process.
Perhaps something more along lines of "Job", "Task", "BackgroundAction", etc?
impl StatusNotifications { | ||
pub fn new() -> Self { default() } | ||
|
||
pub fn publish_event(&self, label:impl Into<String>) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd bikeshed a few more names here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I dont understand this comment
// TODO[ao]: we should think how to handle engine's versions in cloud. | ||
// https://github.com/enso-org/ide/issues/1195 | ||
let version = semver::Version::parse(controller::project::ENGINE_VERSION_FOR_NEW_PROJECTS)?; | ||
let project_id = default(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think that project_id should ever be default.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add TODO and issue.
@@ -41,6 +43,7 @@ impl Action { | |||
completion.name.clone() | |||
} | |||
Self::Example(example) => format!("Example: {}", example.name), | |||
Self::CreateNewProject => "Create New Project".to_owned(), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Self::CreateNewProject => "Create New Project".to_owned(), | |
Self::CreateNewProject => "Create a New Project".to_owned(), |
but then it looks like PoKeMoN script.
Perhaps just New Project
?
@@ -17,7 +17,8 @@ use enso_protocol::language_server::MethodPointer; | |||
use enso_protocol::project_manager; | |||
use flo_stream::Subscriber; | |||
use parser::Parser; | |||
|
|||
use crate::transport::web::WebSocket; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
unordered use decls
#[derive(Debug,Clone)] | ||
pub struct Data { | ||
pub struct Properties { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Perhaps its Flowbox legacy, but seeing properties
used caused me think that this is something totally different.
// Automock macro does not work without explicit lifetimes here. | ||
#[allow(clippy::needless_lifetimes)] | ||
fn manage_projects<'a>(&'a self) -> Option<&'a dyn ManagingProjectAPI>; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Perhaps IDE should also provide parser?
src/rust/ide/src/controller/ide.rs
Outdated
/// The model of currently opened project. | ||
fn current_project(&self) -> model::Project; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So we still assume that IDE has exactly one project opened. I wonder if this should be documented in the trait.
Co-authored-by: Michał Wawrzyniec Urbańczyk <[email protected]>
Co-authored-by: Michał Wawrzyniec Urbańczyk <[email protected]>
Co-authored-by: Michał Wawrzyniec Urbańczyk <[email protected]>
Co-authored-by: Michał Wawrzyniec Urbańczyk <[email protected]>
Co-authored-by: Michał Wawrzyniec Urbańczyk <[email protected]>
Co-authored-by: Michał Wawrzyniec Urbańczyk <[email protected]>
Co-authored-by: Michał Wawrzyniec Urbańczyk <[email protected]>
CHANGELOG.md
Outdated
@@ -42,13 +70,24 @@ you can find their release notes | |||
#### Visual Environment | |||
|
|||
- [Window management buttons.][1511]. The IDE now has components for | |||
<<<<<<< HEAD |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thisi s a commited file with git conflicts!
impl StatusNotifications { | ||
pub fn new() -> Self { default() } | ||
|
||
pub fn publish_event(&self, label:impl Into<String>) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I dont understand this comment
src/rust/ide/src/controller/ide.rs
Outdated
} | ||
|
||
/// A polymorphic handle of IDE controller. | ||
pub type Ide = Rc<dyn API>; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
alignment
@@ -0,0 +1,83 @@ | |||
//! The Plain IDE Controller |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
missing dot.
//TODO [ao]: this should be not the default; instead project model should not need the id. | ||
// See also https://github.com/enso-org/ide/issues/1572 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missing link to an issue. I understand that the first line describes an issue (missing link there) and the second line refers to yet another issue (because to the wording "see also") - is that correct?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, I remove the also
.
// We checked that manage_projects returns Some just a moment ago, so | ||
// unwrapping is safe. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- the "Some" is not correctly formatted
- What does it mean "just a moment ago"?
- The safety is not clearly seen in the code, imo this should be refactored.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- It's a comment, not documentation, so I don't see any need for formatting. But it should be
Ok
after the refactoring - You're in match checking if it returned Ok.
- It's quite hard to refactor; already discussed with @mwu-tow : it would make the manage_project method return Rc, not a reference, and thus we couldn't return self what is quite handy here.
src/rust/ide/src/ide/initializer.rs
Outdated
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 actually loads. We set it right now to |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the word "actually" is not needed here.
Pull Request Description
This PR implements a new action in searcher for creating new project; the project will be opened. It has a lot of refactoring of our controllers to support closing and opening new projects
Checklist
Please include the following checklist in your PR:
CHANGELOG.md
was updated with the changes introduced in this PR.All code has been manually tested in the "debug/interface" scene.