Repository navigation
Conversation
Every merged menu contribution and every model change made while merging updated its manager right away, so a menu with N contributions was rebuilt N times while it was built. For context menus with dynamic contributions this runs on every right-click, which is the slowdown reported in bug 467000 for Papyrus and Capella. processContributions now collects the touched managers and updates each of them once at the end, skipping managers whose menu does not exist yet, so submenus still fill themselves when first shown. A test checks that the dynamic items of a view's context menu are filled as often with 20 contributions as with one. See https://bugs.eclipse.org/bugs/show_bug.cgi?id=467000 Part of eclipse-platform#4566 Assisted-by: multiple AI agents and layers of automated tooling 🤖
While a menu is about to be shown, its about-to-show listeners and the show processor change it several times, and each change updated the manager right away. MenuManagerShowProcessor now coalesces these updates from the pre-show to the post-show helper and leaves the shown menu to the update MenuManager does right afterwards, so a dynamic item of a context menu is filled once per opening, as with the eclipse.workaround.bug467000 timer. See https://bugs.eclipse.org/bugs/show_bug.cgi?id=467000 Part of eclipse-platform#4566 Assisted-by: multiple AI agents and layers of automated tooling 🤖
Contributor
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
After #4567, opening a context menu still filled its dynamic items several times, since the contribution merge of
PopupMenuExtender,processContentsand the visibility pass of the show processor each updated the shown menu beforeMenuManager's own update.Updates are now collected from the pre-show to the post-show helper, and the shown menu is left to the
MenuManagerupdate that follows, so a dynamic item of a context menu is filled once per opening.This is what the
eclipse.workaround.bug467000timer achieves (https://bugs.eclipse.org/bugs/show_bug.cgi?id=467000), but without its delay.PopupMenuDynamicFillTestnow also checks that the open menu contains every contributed item.This builds on #4567, and only the last commit is new.
Part of #4566