提交 8e1ae328 编写于 作者: B Benjamin Pasero

fix #94010

上级 d6eb1555
...@@ -11,7 +11,7 @@ import { IViewletService } from 'vs/workbench/services/viewlet/browser/viewlet'; ...@@ -11,7 +11,7 @@ import { IViewletService } from 'vs/workbench/services/viewlet/browser/viewlet';
import { IViewDescriptorService, IViewsService, ViewContainer, IViewsRegistry, Extensions as ViewExtensions, IViewContainersRegistry } from 'vs/workbench/common/views'; import { IViewDescriptorService, IViewsService, ViewContainer, IViewsRegistry, Extensions as ViewExtensions, IViewContainersRegistry } from 'vs/workbench/common/views';
import { IOutputService } from 'vs/workbench/contrib/output/common/output'; import { IOutputService } from 'vs/workbench/contrib/output/common/output';
import { ITerminalService } from 'vs/workbench/contrib/terminal/browser/terminal'; import { ITerminalService } from 'vs/workbench/contrib/terminal/browser/terminal';
import { IPanelService } from 'vs/workbench/services/panel/common/panelService'; import { IPanelService, IPanelIdentifier } from 'vs/workbench/services/panel/common/panelService';
import { IContextKeyService } from 'vs/platform/contextkey/common/contextkey'; import { IContextKeyService } from 'vs/platform/contextkey/common/contextkey';
import { ViewletDescriptor } from 'vs/workbench/browser/viewlet'; import { ViewletDescriptor } from 'vs/workbench/browser/viewlet';
import { matchesFuzzy } from 'vs/base/common/filters'; import { matchesFuzzy } from 'vs/base/common/filters';
...@@ -109,7 +109,7 @@ export class ViewQuickAccessProvider extends PickerQuickAccessProvider<IViewQuic ...@@ -109,7 +109,7 @@ export class ViewQuickAccessProvider extends PickerQuickAccessProvider<IViewQuic
// Viewlets // Viewlets
const viewlets = this.viewletService.getViewlets(); const viewlets = this.viewletService.getViewlets();
for (const viewlet of viewlets) { for (const viewlet of viewlets) {
if (this.includeViewlet(viewlet)) { if (this.includeViewContainer(viewlet)) {
viewEntries.push({ viewEntries.push({
label: viewlet.name, label: viewlet.name,
containerLabel: localize('views', "Side Bar"), containerLabel: localize('views', "Side Bar"),
...@@ -121,11 +121,13 @@ export class ViewQuickAccessProvider extends PickerQuickAccessProvider<IViewQuic ...@@ -121,11 +121,13 @@ export class ViewQuickAccessProvider extends PickerQuickAccessProvider<IViewQuic
// Panels // Panels
const panels = this.panelService.getPanels(); const panels = this.panelService.getPanels();
for (const panel of panels) { for (const panel of panels) {
viewEntries.push({ if (this.includeViewContainer(panel)) {
label: panel.name, viewEntries.push({
containerLabel: localize('panels', "Panel"), label: panel.name,
accept: () => this.panelService.openPanel(panel.id, true) containerLabel: localize('panels', "Panel"),
}); accept: () => this.panelService.openPanel(panel.id, true)
});
}
} }
// Viewlet Views // Viewlet Views
...@@ -166,8 +168,8 @@ export class ViewQuickAccessProvider extends PickerQuickAccessProvider<IViewQuic ...@@ -166,8 +168,8 @@ export class ViewQuickAccessProvider extends PickerQuickAccessProvider<IViewQuic
return viewEntries; return viewEntries;
} }
private includeViewlet(viewlet: ViewletDescriptor): boolean { private includeViewContainer(container: ViewletDescriptor | IPanelIdentifier): boolean {
const viewContainer = Registry.as<IViewContainersRegistry>(ViewExtensions.ViewContainersRegistry).get(viewlet.id); const viewContainer = Registry.as<IViewContainersRegistry>(ViewExtensions.ViewContainersRegistry).get(container.id);
if (viewContainer?.hideIfEmpty) { if (viewContainer?.hideIfEmpty) {
return this.viewDescriptorService.getViewDescriptors(viewContainer).activeViewDescriptors.length > 0; return this.viewDescriptorService.getViewDescriptors(viewContainer).activeViewDescriptors.length > 0;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册