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

Recognize already written qualified names when applying Component Browser suggestions. #5356

Closed
Tracked by #4967
wdanilo opened this issue Feb 5, 2023 · 16 comments
Closed
Tracked by #4967
Assignees
Labels
p-high Should be completed in the next sprint x-new-feature Type: new feature request

Comments

@wdanilo
Copy link
Member

wdanilo commented Feb 5, 2023

This task is automatically imported from the old Task Issue Board and it was originally created by Adam Obuchowicz.
Original issue is here.


Why

As Enso IDE user
I want suggestion applying to take the already written qualified name into consideration
So that editing existing nodes with qualified names produces working code (otherwise, editing read in File.read could result in File.File.new).

Details

The searcher controller knowing the text cursor position should realize if the currently edited AST node is a direct, last part of qualified name, i.e. the Infix chain with . operator and containing names only. In such a case, after accepting a suggestion:

  • if the existing qualified name is a substring of the suggestion's qualified name, the remaining segments from the latter are added to the right side of the existing qualified name.
  • otherwise, the existing qualified name is just removed, and then the suggestion should be put as before
    In any case, the appropriate import for the first segment of the eventual qualified name should be added if needed.

Acceptance Criteria

Scenario : 
GIVEN I have opened a project which Main module is identical to newly created project's, and has an additional module "Foo" having a submodule "Bar" which in turn contains some module method and a type "Baz" with some methods,
WHEN I open the Component Browser, type "Foo.Bar." and accept one ofthe "Baz" methods
THEN the input become "Foo.Bar.Buz.<method name>" and "Foo" module became imported.
WHEN I open another Component Browser, type "Bar." and accept one of the "Baz" methods
THEN the input become "Bar.Buz.<method name>" and "Bar" module became imported.
WHEN I open another Component Browser, type "Bar." and accept one of the "Bar" methods
THEN the input become "Bar.<method name>" and no additional import is added.
WHEN I open another Component Browser, type "Foo.Gee." and accept one of the "Bar" methods
THEN the input become "Bar.<method name>" and no additional import is added.
@wdanilo wdanilo added this to the Beta Release milestone Feb 6, 2023
@sylwiabr sylwiabr moved this to 📤 Backlog in Issues Board Feb 6, 2023
@vitvakatu vitvakatu self-assigned this Feb 7, 2023
@sylwiabr sylwiabr added p-high Should be completed in the next sprint and removed p-low Low priority labels Feb 7, 2023
@vitvakatu vitvakatu moved this from 📤 Backlog to 🔧 Implementation in Issues Board Feb 28, 2023
@enso-bot
Copy link

enso-bot bot commented Mar 1, 2023

Ilya Bogdanov reports a new STANDUP for yesterday (2023-02-28):

Progress: Started writing a test suite for recognizing qualified names. It should be finished by 2023-03-07.

@enso-bot
Copy link

enso-bot bot commented Mar 1, 2023

Ilya Bogdanov reports a new STANDUP for today (2023-03-01):

Progress: Created test cases for AC of the task and started the implementation. Implemented recognition of the qualified names and substitution (in some cases). Making proper imports proved to be complicated. It should be finished by 2023-03-07.

Next Day: Next day I will be working on the same task. Make a solution for import generation.

@enso-bot
Copy link

enso-bot bot commented Mar 10, 2023

Ilya Bogdanov reports a new 🔴 DELAY for yesterday (2023-03-09):

Summary: There is 7 days delay in implementation of the Recognize already written qualified names when applying Component Browser suggestions. (#5356) task.
It will cause 0 days delay for the delivery of this weekly plan.

2 days are weekends

Delay Cause: Not really a delay, the time was spent working on task 5220

@enso-bot
Copy link

enso-bot bot commented Mar 10, 2023

Ilya Bogdanov reports a new STANDUP for yesterday (2023-03-09):

Progress: Returned back to the recognition of qualified names. Fixed all unit tests except one and implemented a draft solution for import insertion. Started refactoring the controller code to implement the thing properly. It should be finished by 2023-03-14.

@enso-bot
Copy link

enso-bot bot commented Mar 13, 2023

Ilya Bogdanov reports a new STANDUP for the last Friday (2023-03-10):

Progress: Refactoring of the implementation, fixing corner cases with different type of entries. It should be finished by 2023-03-14.

@enso-bot
Copy link

enso-bot bot commented Mar 14, 2023

Ilya Bogdanov reports a new STANDUP for yesterday (2023-03-13):

Progress: Refactoring and polishing the code. Reading execution contexts design doc, attending a weekly demo. It should be finished by 2023-03-14.

@vitvakatu vitvakatu moved this from 🔧 Implementation to 🌟 Q/A review in Issues Board Mar 16, 2023
@enso-bot
Copy link

enso-bot bot commented Mar 16, 2023

Ilya Bogdanov reports a new 🔴 DELAY for yesterday (2023-03-15):

Summary: There is 2 days delay in implementation of the Recognize already written qualified names when applying Component Browser suggestions. (#5356) task.
It will cause 0 days delay for the delivery of this weekly plan.

Delay Cause: preparing a PR took more time than estimated, spent some time on designing new tasks

@enso-bot
Copy link

enso-bot bot commented Mar 16, 2023

Ilya Bogdanov reports a new STANDUP for yesterday (2023-03-15):

Progress: Polishing the code, rebased to the latest develop and opened a PR. It should be finished by 2023-03-16.

@farmaazon
Copy link
Contributor

QA: @farmaazon

@vitvakatu vitvakatu moved this from 🌟 Q/A review to 🔧 Implementation in Issues Board Mar 17, 2023
@enso-bot
Copy link

enso-bot bot commented Mar 17, 2023

Ilya Bogdanov reports a new STANDUP for yesterday (2023-03-16):

Progress: Addressed review comments. Investigated and reported multiple regressions in the recent develop, QA reviewed a couple of PRs. It should be finished by 2023-03-16.

@vitvakatu vitvakatu moved this from 🔧 Implementation to 🌟 Q/A review in Issues Board Mar 20, 2023
@enso-bot
Copy link

enso-bot bot commented Mar 20, 2023

Ilya Bogdanov reports a new 🔴 DELAY for the last Friday (2023-03-17):

Summary: There is 5 days delay in implementation of the Recognize already written qualified names when applying Component Browser suggestions. (#5356) task.
It will cause 3 days delay for the delivery of this weekly plan.

2 days are weekends

Delay Cause: The issues spotted on QA require additional time. Also 1 day for an additional round of QA.

@enso-bot
Copy link

enso-bot bot commented Mar 20, 2023

Ilya Bogdanov reports a new STANDUP for the last Friday (2023-03-17):

Progress: Investigating issues spotted on QA review. Fixed one of them, but found that unit tests are not able to detect that specific failure without refactoring. Also spotted a possible engine issue. It should be finished by 2023-03-21.

@enso-bot
Copy link

enso-bot bot commented Mar 21, 2023

Ilya Bogdanov reports a new STANDUP for yesterday (2023-03-20):

Progress: Little work on the implementation. Planning and demo calls, sorting out several issues for triage process. Faced a weird build issue. The only thing that worked was restarting the machine. Fixed invalid code formatting on develop and an issue with passing CLI options to Electron (5838). It should be finished by 2023-03-21.

@enso-bot
Copy link

enso-bot bot commented Mar 21, 2023

Ilya Bogdanov reports a new 🔴 DELAY for yesterday (2023-03-20):

Summary: There is 1 day delay in implementation of the Recognize already written qualified names when applying Component Browser suggestions. (#5356) task.
It will cause 0 days delay for the delivery of this weekly plan.

Delay Cause: spent most of the day investigating various issues.

@enso-bot
Copy link

enso-bot bot commented Mar 21, 2023

Ilya Bogdanov reports a new STANDUP for today (2023-03-21):

Progress: Fixed the remaining issue in the PR. Implemented filtering by the string representation of the context. Fixed a few spotted bugs. The PR should be ready for the second round of QA. It should be finished by 2023-03-22.

Next Day: Next day I will be working on the same task. Refactor unit tests, hopefully merge the thing.

@vitvakatu vitvakatu moved this from 🌟 Q/A review to 🟢 Accepted in Issues Board Mar 22, 2023
mergify bot pushed a commit that referenced this issue Mar 22, 2023
Closes #5356

Implements recognition of qualified names in the input of the CB. Now accepting of the suggestion produces a valid code, and only necessary imports are added.


https://user-images.githubusercontent.com/6566674/225487445-855dfb04-47c7-44c9-bc92-4bb5663d500a.mp4


https://user-images.githubusercontent.com/6566674/225487486-028d1ae0-02e0-4bbc-a623-7d4e620c87d9.mp4

# Important Notes
- Filtering by inserted code no longer works, but instead, we filter out entries with qualified names not matching the edited accessor chain. It may result in worsened behavior when typing expressions with local variables as `this` argument.
@enso-bot
Copy link

enso-bot bot commented Mar 23, 2023

Ilya Bogdanov reports a new STANDUP for yesterday (2023-03-22):

Progress: Fixed the filtering issue spotted on the second QA round, fixed the tests and finally merged the thing. QA testing of task 6034 It should be finished by 2023-03-22.

@farmaazon farmaazon moved this from 🟢 Accepted to 🗄️ Archived in Issues Board Apr 3, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
p-high Should be completed in the next sprint x-new-feature Type: new feature request
Projects
Archived in project
Development

No branches or pull requests

5 participants