Skip to content

Regarding the MenuCommand.Supported property in the Visual Studio Extensibility SDK #7653

Open
@astrohart

Description

@astrohart

My issue is with xml/System.ComponentModel.Design/MenuCommand.xml, located at https://github.com/dotnet/dotnet-api-docs/blob/f5ba02279848e492aa825869ca1fb8d3ad46a5ae/xml/System.ComponentModel.Design/MenuCommand.xml.

The page referenced is the documentation for the MenuCommand.Supported property in the Visual Studio Extensibility toolkit.

When I set MenuCommand.Supported to false, it is not obvious what doing that means.

Nothing changed in the user experience by setting the Supported property to false; that I can see anyway, as a result. That does not mesh with my expectation.

This page is not helpful to me either, as it does not say what happens in Visual Studio's interface, or anywhere else in the user experience if the Supported property is set to false.

This documentation, as written, merely states:

  • a) the property exists;
  • b) it's a Boolean, and
  • c) provides sample code setting the property to true.

But there is no discussion as to what the values true and false for the Supported property actually do, or what the default is.

All of these, I surmise, are essential pieces of information to know as a developer.

My use case is the following:

I am working on an extension that I have forked from someone else, and the author has set Supported to false for a particular MenuCommand they are adding.

Apparently, from my own experience, setting Supported to false does nothing.

The expected behavior from setting Supported to false is for the menu command to:

  • a) Not be visible on Visual Studio menus and toolbars (according to where my .vsct has placed it); or,
  • b) Showing the command, but graying it out.

Yet the command still appears in the VS menus, is selectable, and, when I, as a user, select the command, the specified handler is executed.

So what does setting Supported to false really even do?

If it does something, I'd like to know.

If it does not (perhaps it's deprecated), then I'd also like to know.

Therefore, I'd like to respectfully suggest augmenting the documentation on this property with a Remarks section that goes into more detail about the outcomes of setting the MenuCommand.Supported property to true versus false.

Thank you in advance for your consideration.

Regards,

Brian Hart

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions