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

When opening the project for a second time, suggestion database is not sent. #7413

Closed
2 tasks done
Frizi opened this issue Jul 27, 2023 · 6 comments · Fixed by #7699
Closed
2 tasks done

When opening the project for a second time, suggestion database is not sent. #7413

Frizi opened this issue Jul 27, 2023 · 6 comments · Fixed by #7699
Assignees
Milestone

Comments

@Frizi
Copy link
Contributor

Frizi commented Jul 27, 2023

Discord username

No response

What type of issue is this?

Permanent – Occurring repeatably

Is this issue blocking you from using Enso?

  • Yes, I can't use Enso because of this issue.

Is this a regression?

  • Yes, previous version of Enso did not have this issue.

What issue are you facing?

When opening a project multiple times in the same engine session, the suggestion database is sent only on the first visit. After that, the search/getSuggestionsDatabase endpoint seems to have no effect.

Expected behaviour

The full suggestion database should be sent to IDE every time it uses search/getSuggestionsDatabase endpoint.

How we can reproduce it?

  1. Open a project in IDE. Take note that component browser offers many suggestions.
  2. Refresh IDE.
  3. Open the same project again.
  4. Open component browser, notice missing suggestions.

Screenshots or screencasts

Notice only small responses containing suggestion updates.
image

Logs

No response

Enso Version

2023.2.1-nightly.2023.7.24.1

Browser or standalone distribution

Standalone distribution (local project)

Browser Version or standalone distribution

electron

Operating System

Windows

Operating System Version

11

Hardware you are using

No response

@Akirathan
Copy link
Member

I can reproduce this on enso-linux-2023.2.1-nightly.2023.7.28.AppImage, moreover, I have filtered logs only from the language server, and it seems that on the second project open, the number of suggestions database updates is roughly 64 KB, while after the first project open, the amount is larger than 1 MB. In the attachment, 00-ls.log is the filtered LS-only log and appenso.log is the entire log from the project-manager.

00-ls.log
appenso.log

@Akirathan Akirathan removed the triage label Jul 28, 2023
@jdunkerley jdunkerley assigned 4e6 and unassigned hubertp Aug 1, 2023
@jdunkerley jdunkerley moved this from ❓New to 📤 Backlog in Issues Board Aug 1, 2023
@jdunkerley jdunkerley added this to the Beta Release milestone Aug 1, 2023
@4e6
Copy link
Contributor

4e6 commented Aug 1, 2023

Well, that's because the suggestions mechanism has changed. The search/getSuggestionsDatabase now always returns an empty response. And the suggestions are automatically sent to IDE when a library is loaded by the compiler.

https://github.com/enso-org/enso/blob/7441a9a62cdec26ed0bd152ed556ec9025c38054/docs/language-server/protocol-language-server.md#searchgetsuggestionsdatabase

Deprecated
The request always returns empty entries field with the correct currentVersion. The suggestions are sent during the initial project compilation as a part of search/suggestionsDatabaseUpdate notification.

@4e6
Copy link
Contributor

4e6 commented Aug 1, 2023

The reason is that when the initial search/getSuggestionsDatabase request is sent during the project initialization. The suggestions database is empty anyway. Because no libraries are loaded. And since the request was not doing anything it was abandoned which allowed us to make the suggestions database more performant.

If we want to support the described scenario, I can try to revive the request.

@jdunkerley jdunkerley moved this from 📤 Backlog to 🔧 Implementation in Issues Board Aug 29, 2023
@enso-bot
Copy link

enso-bot bot commented Aug 29, 2023

Dmitry Bushev reports a new STANDUP for yesterday (2023-08-28):

Progress: Started working on the issue. Reproduced the issue and figured out the fact why it was happening. Started implementing the logic to invalidate suggestion indexes in runtime. It should be finished by 2023-08-30.

Next Day: Next day I will be working on the #7413 task. Continue working on the task

@enso-bot
Copy link

enso-bot bot commented Aug 29, 2023

Dmitry Bushev reports a new STANDUP for today (2023-08-29):

Progress: Continue working on the issue. Added events indicating the client connection and disconnection. Implemented the command that invalidates the caches and re-enables the background tasks processing. Started testing. It should be finished by 2023-08-30.

Next Day: Next day I will be working on the #7413 task. Continue working on the task

@enso-bot
Copy link

enso-bot bot commented Aug 30, 2023

Dmitry Bushev reports a new STANDUP for today (2023-08-30):

Progress: Continue working on the issue. Turned out there were existing events for the client connection and disconnection. Started listening to them. Implemented the execution context cleanup. Reimplemented the invalidation command in Java. Created a PR. It should be finished by 2023-08-30.

Next Day: Next day I will be working on the #7413 task. Continue working on the task

@4e6 4e6 moved this from 🔧 Implementation to 👁️ Code review in Issues Board Aug 31, 2023
@mergify mergify bot closed this as completed in #7699 Aug 31, 2023
mergify bot pushed a commit that referenced this issue Aug 31, 2023
… sent (#7699)

close #7413

Changelog:
- update: the language server listens for the client disconnection event and invalidates the suggestions index

# Important Notes
The component browser contains suggestion entries after the refresh


https://github.com/enso-org/enso/assets/357683/bcebb8bf-e09f-4fb0-86cf-95ced58413f3
@github-project-automation github-project-automation bot moved this from 👁️ Code review to 🟢 Accepted in Issues Board Aug 31, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

5 participants