microsoft/vscode

Suggestion: Support when for viewContainers contribution

chrisdias opened this issue ยท 7 comments

Suggest to support when clause for viewContainers contributions. This would let an extension author contribute a configuration that would let the user control if they want the explorer to be in a new view or in the default Explorer view.

@chrisdias Can't you use the when clause on the view to show/hide in explorer and custom views container?

But just having the view contributed to the container causes the container to show up even if the view(s) are hidden. I brought this issue up on the main viewcontainers when it was being added.

vbfox commented

@eamodio I asked for the auto-hiding if the container contains nothing here #49145 let's hope we get a way or another to hide empty activities

@eamodio Yes, view container will be empty in such cases and I am thinking to hide view container if there are no views are registered or all registered views are hidden by when clause.

If agreed, I would make this and #49145 as duplicates

vbfox commented

Having reflected a little more about it, I think #49145 (hiding when no views are visible inside) could be better than a when cause.

I like the when clause direct approach but the problem is that activities are shared between extensions (Azure ones for example do that) and any direct interaction mean that multiple extensions might need to collaborate. (If an extension for language A decide to hide the test activity, other languages contributing to it would have their views hidden..).

Duplicate of #49145

Thanks for creating this issue! We figured it's covering the same as another one we already have. Thus, we closed this one as a duplicate. You can search for existing issues here. See also our issue reporting guidelines.

Happy Coding!