Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

IDE inserts import for Boolean when True is selected from the dropdown #6816

Closed
4e6 opened this issue May 23, 2023 · 5 comments · Fixed by #7028
Closed

IDE inserts import for Boolean when True is selected from the dropdown #6816

4e6 opened this issue May 23, 2023 · 5 comments · Fixed by #7028
Assignees
Labels
--bug Type: bug p-medium Should be completed in the next few sprints

Comments

@4e6
Copy link
Contributor

4e6 commented May 23, 2023

What type of issue is this?

Permanent – Occurring repeatably

What issue are you facing?

IDE inserts a new import for Boolean when True is selected from the dropdown, even though the Boolean type is reexported from Standard.Base.Main.

from Standard.Base.Data.Boolean import Boolean

This does not happen when True is selected from the Component Browser.

Expected behaviour

IDE does not insert additional imports when True is selected from the dropdown.

How we can reproduce it?

  • Create Statistic.Skew node
  • Select True from the dropdown
  • See the new from Standard.Base.Data.Boolean import Boolean import

Screenshots or screencasts

2023-05-23-002251_992x632_scrot

Logs

The engine sends suggestion updates with the proper reexport field for Boolean type and constructors:

{"type":"Add","id":1615,"suggestion":{"type":"type","module":"Standard.Base.Data.Boolean","name":"Boolean","params":[],"parentType":"Standard.Base.Any.Any","documentation":" A type with only two possible values.\n\nThe boolean type represents the two truth values of boolean logic. It is\nprimarily used for control-flow.","reexport":"Standard.Base.Main"}}

{"type":"Add","id":1616,"suggestion":{"type":"constructor","module":"Standard.Base.Data.Boolean","name":"True","arguments":[],"returnType":"Standard.Base.Data.Boolean.Boolean","reexport":"Standard.Base.Main"}}

{"type":"Add","id":1617,"suggestion":{"type":"constructor","module":"Standard.Base.Data.Boolean","name":"False","arguments":[],"returnType":"Standard.Base.Data.Boolean.Boolean","reexport":"Standard.Base.Main"}}

project-manager.log.zip

Enso Version

b353b35

Browser or standalone distribution

Chromium

Browser Version or standalone distribution

113.0.5672.126

Operating System

Linux

@4e6 4e6 added --bug Type: bug triage labels May 23, 2023
@4e6 4e6 changed the title IDE inserts import for Boolean when True selected from dropdown IDE inserts import for Boolean when True is selected from the dropdown May 23, 2023
@Frizi
Copy link
Contributor

Frizi commented May 23, 2023

This does not happen when True is selected from the Component Browser.

I don't experience the same thing. For me, selecting true does introduce an import.

cb-import-bool.mp4

@JaroslavTulach
Copy link
Member

There was a problem with re-exports, but that one got fixed in #6778 - assuming the fix is correct, it is now up to the IDE to adjust to the updates with reexport.

Thanks @Frizi testing. I am not sure what to conclude from your video (except something is broken) - the reexport information shall be there since #6778 - if there is some work needed on the --compiler side, please remove the --gui label.

@farmaazon
Copy link
Contributor

I reproduced the issue exactly as in the description, i.e. the Component Browser does not insert import, but drop-down does.

@Frizi I think you have an older engine in your project. Make sure it's never than nightly 2022-05-18.

@farmaazon farmaazon added p-medium Should be completed in the next few sprints and removed triage labels May 24, 2023
@farmaazon farmaazon added this to the Design Partners milestone May 29, 2023
@farmaazon farmaazon moved this from ❓New to 📤 Backlog in Issues Board May 29, 2023
@farmaazon farmaazon assigned vitvakatu and unassigned Frizi Jun 12, 2023
@vitvakatu vitvakatu moved this from 📤 Backlog to 🔧 Implementation in Issues Board Jun 14, 2023
@farmaazon farmaazon moved this from 🔧 Implementation to 👁️ Code review in Issues Board Jun 16, 2023
@farmaazon farmaazon moved this from 👁️ Code review to 🌟 Q/A review in Issues Board Jun 16, 2023
@mergify mergify bot closed this as completed in #7028 Jun 21, 2023
mergify bot pushed a commit that referenced this issue Jun 21, 2023
…#7028)

Fixes #6816.

The code for adding imports for dropdown widgets was unified with CB. The code was moved from the searcher controller to the graph controller.

Also, I changed the signature for a few `lookup_*` methods of the suggestion database, because I have always found it weird that they return `Option` instead of `Result`. They now work nicely with the surrounding code.


https://github.com/enso-org/enso/assets/6566674/49125f8d-096e-4cca-a922-4811ed717a4d
@github-project-automation github-project-automation bot moved this from 🌟 Q/A review to 🟢 Accepted in Issues Board Jun 21, 2023
@farmaazon farmaazon moved this from 🟢 Accepted to 🗄️ Archived in Issues Board Jun 27, 2023
@enso-bot
Copy link

enso-bot bot commented Jul 19, 2023

Ilya Bogdanov reports a new STANDUP for the provided date (2023-06-14):

Progress: Investigated and fixed the issue with redundant imports and opened a PR. It should be finished by 2023-06-15.

@enso-bot
Copy link

enso-bot bot commented Jul 19, 2023

Ilya Bogdanov reports a new STANDUP for the provided date (2023-06-15):

Progress: Addressing review comments. It should be finished by 2023-06-15.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
--bug Type: bug p-medium Should be completed in the next few sprints
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

5 participants