@@ -569,14 +569,15 @@ registerAction2(class extends Action2 {
569
569
viewId = focusedViewId ;
570
570
}
571
571
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
+ }
577
577
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 { }
580
581
}
581
582
582
583
private getViewItems ( viewDescriptorService : IViewDescriptorService , paneCompositePartService : IPaneCompositePartService ) : Array < IQuickPickItem | IQuickPickSeparator > {
@@ -630,6 +631,31 @@ registerAction2(class extends Action2 {
630
631
} ) ;
631
632
} ) ;
632
633
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
+
633
659
return results ;
634
660
}
635
661
@@ -719,6 +745,13 @@ class MoveFocusedViewAction extends Action2 {
719
745
} ) ;
720
746
}
721
747
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
+
722
755
items . push ( {
723
756
type : 'separator' ,
724
757
label : localize ( 'sidebar' , "Side Bar" )
@@ -761,6 +794,27 @@ class MoveFocusedViewAction extends Action2 {
761
794
} ;
762
795
} ) ) ;
763
796
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
+
764
818
quickPick . items = items ;
765
819
766
820
quickPick . onDidAccept ( ( ) => {
@@ -772,6 +826,9 @@ class MoveFocusedViewAction extends Action2 {
772
826
} else if ( destination . id === '_.sidebar.newcontainer' ) {
773
827
viewDescriptorService . moveViewToLocation ( viewDescriptor ! , ViewContainerLocation . Sidebar ) ;
774
828
viewsService . openView ( focusedViewId , true ) ;
829
+ } else if ( destination . id === '_.auxiliarybar.newcontainer' ) {
830
+ viewDescriptorService . moveViewToLocation ( viewDescriptor ! , ViewContainerLocation . AuxiliaryBar ) ;
831
+ viewsService . openView ( focusedViewId , true ) ;
775
832
} else if ( destination . id ) {
776
833
viewDescriptorService . moveViewsToContainer ( [ viewDescriptor ] , viewDescriptorService . getViewContainerById ( destination . id ) ! ) ;
777
834
viewsService . openView ( focusedViewId , true ) ;
0 commit comments