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

Ensured that dynamic menu items are visible and enabled by default #398

Conversation

reduckted
Copy link
Contributor

If you have a dynamic command and at some point there are no dynamic items to display, then after that point the dynamic menu items will no longer appear, even when there are dynamic items to display.

This occurred because when there are no dynamic items, all of the menu items are hidden and disabled (otherwise you would end up with a single menu item that shouldn't be there). If at some point after that there are dynamic items again, the menu items would remain disabled and hidden unless the BeforeQueryStatus handler specifically set the menu item to be enabled and visible.

You can reproduce this bug in the test extension (without this fix, of course):

  1. Open a solution with a few projects.
  2. Open the Extensions / VSSDK Test Extension / Edit Project File menu. You should see each loaded project in the menu.
  3. Unload all of the projects in the solution.
  4. Open the Extensions / VSSDK Test Extension menu. The Edit Project File menu should not be visible because there are no projects.
  5. Now load at least one project.
  6. Open the Extensions / VSSDK Test Extension menu. The Edit Project File menu should be visible but it's not.

@madskristensen madskristensen merged commit e0d1596 into VsixCommunity:master Dec 7, 2022
@madskristensen
Copy link
Contributor

Thanks!

@reduckted reduckted deleted the bugfix/hidden-dynamic-menu-commands branch December 7, 2022 20:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants