-
Notifications
You must be signed in to change notification settings - Fork 326
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
Add Reexport Field to Suggestions #1793
Conversation
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.
Looks good to me, but in some places additional documentation explaining the mechanisms would be helpful to understand the intentions behind the code
suggestionUpdatesQueue: mutable.Queue[ | ||
Api.SuggestionsDatabaseModuleUpdateNotification | ||
] = mutable.Queue.empty, |
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.
Why is this queue mutable? It feels like an anti-pattern to store a mutable queue in a state that is meant to be immutable and is explicitly modified. If the queue is to be mutable, it could just as well be stored in a member variable of the object instead of this state, no?
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 agree, in general, a mutable state in actor it's an antipattern and can be refactored by making it an argument of a receive function. This works well with single values, but this case is a bit different. On startup, we receive a burst of suggestion updates. Updating a mutable queue is more efficient than copying the queue on every update.
engine/runtime/src/main/scala/org/enso/interpreter/instrument/job/EnsureCompiledJob.scala
Outdated
Show resolved
Hide resolved
lib/scala/searcher/src/main/scala/org/enso/searcher/sql/SqlSuggestionsRepo.scala
Outdated
Show resolved
Hide resolved
Add the reexport field to suggestions
Pull Request Description
close #1670
PR adds the
reexport
field to suggestions. It contains a fully qualified module name of the outermost module (module with the shortest path) that re-exports the suggestion.Changelog:
Module
. Previously modules were represented as atom suggestionsreexport
field to suggestionsImportant Notes
Module
Changes in the Language Server protocol.
Module
Module
,Atom
andMehod
suggestions have an optionalreexport
field.reexport
field can be modified.Checklist
Please include the following checklist in your PR: