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

Fix Main modules #1279

Merged
merged 3 commits into from
Mar 2, 2021
Merged

Fix Main modules #1279

merged 3 commits into from
Mar 2, 2021

Conversation

farmaazon
Copy link
Collaborator

@farmaazon farmaazon commented Mar 1, 2021

Pull Request Description

Important Notes

Checklist

Please include the following checklist in your PR:

  • The CHANGELOG.md was updated with the changes introduced in this PR.
  • The documentation has been updated if necessary.
  • All code conforms to the Rust style guide.
  • All code has automatic tests where possible.
  • All code has been profiled where possible.
  • All code has been manually tested in the IDE.
  • All code has been manually tested in the "debug/interface" scene.
  • All code has been manually tested by the PR owner against our test scenarios.
  • All code has been manually tested by at least one reviewer against our test scenarios.

@farmaazon farmaazon added Category: Controllers The Application layer not bound to visual part Difficulty: Core Contributor Should only be attempted by a core contributor Priority: Highest Should be completed ASAP Type: Bug A bug in Enso IDE labels Mar 2, 2021
@farmaazon farmaazon self-assigned this Mar 2, 2021
@farmaazon farmaazon requested a review from mwu-tow March 2, 2021 08:40
@farmaazon farmaazon requested a review from wdanilo as a code owner March 2, 2021 08:53
/// assert_eq!(main_but_not_library_main.remove_main_module_segment().to_string(), "Project.Foo.Main");
/// ```
pub fn remove_main_module_segment(mut self) -> Self {
if self.id.segments.len() == 1 && self.id.segments.last().contains_if(|s| s == &&LIBRARIES_MAIN_MODULE) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Consider if can be simplified by comparison to vec!

/// assert_eq!(name_without_main .remove_main_module_segment().to_string(), "Project.Foo.Bar");
/// assert_eq!(main_but_not_library_main.remove_main_module_segment().to_string(), "Project.Foo.Main");
/// ```
pub fn remove_main_module_segment(mut self) -> Self {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

perjaps should work on &mut self

@@ -31,7 +31,12 @@ impl Action {
pub fn caption(&self) -> String {
match self {
Self::Suggestion(completion) => if let Some(self_type) = completion.self_type.as_ref() {
format!("{}.{}",self_type.name,completion.name)
let should_put_library_name = self_type.name == constants::LIBRARIES_MAIN_MODULE
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

library -> project

@farmaazon farmaazon merged commit 79f906d into develop Mar 2, 2021
@farmaazon farmaazon deleted the wip/ao/fix branch March 2, 2021 11:47
mwu-tow pushed a commit to enso-org/enso that referenced this pull request Oct 30, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Category: Controllers The Application layer not bound to visual part Difficulty: Core Contributor Should only be attempted by a core contributor Priority: Highest Should be completed ASAP Type: Bug A bug in Enso IDE
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants