Evaluate visibleWhen expressions for "Show in" menu#3989
Merged
laeubi merged 1 commit intoeclipse-platform:masterfrom May 8, 2026
Merged
Conversation
Contributor
Contributor
|
@r-mennig thanks for the fix, looks good to me. |
Contributor
|
Great that you added at too! 🏆 |
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.
Fixes #3969
Currently, visibleWhen expressions are not evaluated for the "ShowIn"-menu. Because of this problem, entries in the "ShowIn"-menu can be disabled, but cannot be made invisible.
This PR fixes the issue by evaluating visibleWhen expressions before creating the command contribution items for the menu.
This also fixes an existing problem for the "Show in" -> "System explorer" entry. According to the definition of the menu contribution, this entry should be hidden when selecting multiple projects. Currently, it is shown as disabled because the visibleWhen expression of the menu contribution is not evaluated (only the enabledWhen expression of the handler gets evaluated correctly which disables the entry).
Menu contribution (in /org.eclipse.ui.ide/plugin.xml):

"org.eclipse.ui.ide.showInDefinition" definition (in /org.eclipse.ui.ide/plugin.xml):

Handler (in /org.eclipse.ui.ide/plugin.xml):

This PR also adds a test case documenting the changed behavior of the "Show in" -> "System explorer" entry