jcansdale / TestDriven.Net-Issues

Issue tracking for TestDriven.Net
https://github.com/jcansdale/TestDriven.Net-Issues/issues
24 stars 2 forks source link

Only show buttons on supported file types #73

Open jcansdale opened 7 years ago

jcansdale commented 7 years ago

At the moment TestDriven.Net shows its menu commands wherever the 'Code Context' menu is available. This if for historical reasons:

  1. TestDriven.Net would only load when one of its commands was first used (dynamic visibility wasn't an option)
  2. There was a bug in previous versions of Visual Studio that showed commands greyed out rather than invisible
  3. The 'Test With' menu would still appear after all buttons were removed/invisible

I'd love to clean this up. Hopefully it's possible in recent versions of Visual Studio!

Something like this:

[ProvideUIContextRule(_uiContextSupportedFiles,
    name: "Supported Files",
    expression: "ActiveProjectFlavorCSharp",
    termNames: new[] { "ActiveProjectFlavorCSharp" },
    termValues: new[] { "ActiveProjectFlavor:{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}" })]

Related

jcansdale commented 5 years ago
  <VisibilityConstraints>
    <!--<VisibilityItem guid="guidClearCachePackageCmdSet" id="ShowErrorsId" context="UICONTEXT_EmptySolution" />-->
    <VisibilityItem guid="guidClearCachePackageCmdSet" id="ShowErrorsId" context="UICONTEXT_CodeWindow" />
  </VisibilityConstraints>