Skip to content

Commit 36c2ee2

Browse files
committed
1 parent fe87616 commit 36c2ee2

File tree

1 file changed

+64
-7
lines changed

1 file changed

+64
-7
lines changed

src/vs/workbench/browser/actions/layoutActions.ts

Lines changed: 64 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -569,14 +569,15 @@ registerAction2(class extends Action2 {
569569
viewId = focusedViewId;
570570
}
571571

572-
viewId = await this.getView(quickInputService, viewDescriptorService, paneCompositePartService, viewId!);
573-
574-
if (!viewId) {
575-
return;
576-
}
572+
try {
573+
viewId = await this.getView(quickInputService, viewDescriptorService, paneCompositePartService, viewId!);
574+
if (!viewId) {
575+
return;
576+
}
577577

578-
const moveFocusedViewAction = new MoveFocusedViewAction();
579-
instantiationService.invokeFunction(accessor => moveFocusedViewAction.run(accessor, viewId));
578+
const moveFocusedViewAction = new MoveFocusedViewAction();
579+
instantiationService.invokeFunction(accessor => moveFocusedViewAction.run(accessor, viewId));
580+
} catch { }
580581
}
581582

582583
private getViewItems(viewDescriptorService: IViewDescriptorService, paneCompositePartService: IPaneCompositePartService): Array<IQuickPickItem | IQuickPickSeparator> {
@@ -630,6 +631,31 @@ registerAction2(class extends Action2 {
630631
});
631632
});
632633

634+
635+
const sidePanels = paneCompositePartService.getPinnedPaneCompositeIds(ViewContainerLocation.AuxiliaryBar);
636+
sidePanels.forEach(panel => {
637+
const container = viewDescriptorService.getViewContainerById(panel)!;
638+
const containerModel = viewDescriptorService.getViewContainerModel(container);
639+
640+
let hasAddedView = false;
641+
containerModel.visibleViewDescriptors.forEach(viewDescriptor => {
642+
if (viewDescriptor.canMoveView) {
643+
if (!hasAddedView) {
644+
results.push({
645+
type: 'separator',
646+
label: localize('sidePanelContainer', "Side Panel / {0}", containerModel.title)
647+
});
648+
hasAddedView = true;
649+
}
650+
651+
results.push({
652+
id: viewDescriptor.id,
653+
label: viewDescriptor.name
654+
});
655+
}
656+
});
657+
});
658+
633659
return results;
634660
}
635661

@@ -719,6 +745,13 @@ class MoveFocusedViewAction extends Action2 {
719745
});
720746
}
721747

748+
if (!(isViewSolo && currentLocation === ViewContainerLocation.AuxiliaryBar)) {
749+
items.push({
750+
id: '_.auxiliarybar.newcontainer',
751+
label: localize('moveFocusedView.newContainerInSidePanel', "New Side Panel Entry")
752+
});
753+
}
754+
722755
items.push({
723756
type: 'separator',
724757
label: localize('sidebar', "Side Bar")
@@ -761,6 +794,27 @@ class MoveFocusedViewAction extends Action2 {
761794
};
762795
}));
763796

797+
items.push({
798+
type: 'separator',
799+
label: localize('sidePanel', "Side Panel")
800+
});
801+
802+
const pinnedAuxPanels = paneCompositePartService.getPinnedPaneCompositeIds(ViewContainerLocation.AuxiliaryBar);
803+
items.push(...pinnedAuxPanels
804+
.filter(panel => {
805+
if (panel === viewDescriptorService.getViewContainerByViewId(focusedViewId)!.id) {
806+
return false;
807+
}
808+
809+
return !viewDescriptorService.getViewContainerById(panel)!.rejectAddedViews;
810+
})
811+
.map(panel => {
812+
return {
813+
id: panel,
814+
label: viewDescriptorService.getViewContainerModel(viewDescriptorService.getViewContainerById(panel)!)!.title
815+
};
816+
}));
817+
764818
quickPick.items = items;
765819

766820
quickPick.onDidAccept(() => {
@@ -772,6 +826,9 @@ class MoveFocusedViewAction extends Action2 {
772826
} else if (destination.id === '_.sidebar.newcontainer') {
773827
viewDescriptorService.moveViewToLocation(viewDescriptor!, ViewContainerLocation.Sidebar);
774828
viewsService.openView(focusedViewId, true);
829+
} else if (destination.id === '_.auxiliarybar.newcontainer') {
830+
viewDescriptorService.moveViewToLocation(viewDescriptor!, ViewContainerLocation.AuxiliaryBar);
831+
viewsService.openView(focusedViewId, true);
775832
} else if (destination.id) {
776833
viewDescriptorService.moveViewsToContainer([viewDescriptor], viewDescriptorService.getViewContainerById(destination.id)!);
777834
viewsService.openView(focusedViewId, true);

0 commit comments

Comments
 (0)