mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-16 10:58:30 -05:00
Merge from vscode 2f984aad710215f4e4684a035bb02f55d1a9e2cc (#9819)
This commit is contained in:
@@ -3,8 +3,6 @@
|
||||
* Licensed under the Source EULA. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
|
||||
import 'vs/css!./media/actions';
|
||||
|
||||
import * as nls from 'vs/nls';
|
||||
import { Registry } from 'vs/platform/registry/common/platform';
|
||||
import { Action } from 'vs/base/common/actions';
|
||||
@@ -27,8 +25,8 @@ import { IEnvironmentService } from 'vs/platform/environment/common/environment'
|
||||
import { IViewDescriptorService, IViewContainersRegistry, Extensions as ViewContainerExtensions, IViewsService, FocusedViewContext, ViewContainerLocation, IViewDescriptor } from 'vs/workbench/common/views';
|
||||
import { IQuickInputService, IQuickPickItem, IQuickPickSeparator } from 'vs/platform/quickinput/common/quickInput';
|
||||
import { INotificationService } from 'vs/platform/notification/common/notification';
|
||||
import { IViewletService } from 'vs/workbench/services/viewlet/browser/viewlet';
|
||||
import { IActivityBarService } from 'vs/workbench/services/activityBar/browser/activityBarService';
|
||||
import { IPanelService } from 'vs/workbench/services/panel/common/panelService';
|
||||
|
||||
const registry = Registry.as<IWorkbenchActionRegistry>(WorkbenchExtensions.WorkbenchActions);
|
||||
const viewCategory = nls.localize('view', "View");
|
||||
@@ -520,7 +518,7 @@ export class MoveFocusedViewAction extends Action {
|
||||
@IContextKeyService private contextKeyService: IContextKeyService,
|
||||
@INotificationService private notificationService: INotificationService,
|
||||
@IActivityBarService private activityBarService: IActivityBarService,
|
||||
@IViewletService private viewletService: IViewletService
|
||||
@IPanelService private panelService: IPanelService
|
||||
) {
|
||||
super(id, label);
|
||||
}
|
||||
@@ -544,36 +542,58 @@ export class MoveFocusedViewAction extends Action {
|
||||
const quickPick = this.quickInputService.createQuickPick();
|
||||
quickPick.placeholder = nls.localize('moveFocusedView.selectDestination', "Select a Destination for the View");
|
||||
|
||||
const items: Array<IQuickPickItem | IQuickPickSeparator> = [];
|
||||
|
||||
items.push({
|
||||
type: 'separator',
|
||||
label: nls.localize('sidebar', "Side Bar")
|
||||
});
|
||||
|
||||
items.push({
|
||||
id: '_.sidebar.newcontainer',
|
||||
label: nls.localize('moveFocusedView.newContainerInSidebar', "New Container in Side Bar")
|
||||
});
|
||||
|
||||
const pinnedViewlets = this.activityBarService.getPinnedViewletIds();
|
||||
const items: Array<IQuickPickItem | IQuickPickSeparator> = this.viewletService.getViewlets()
|
||||
.filter(viewlet => {
|
||||
if (viewlet.id === this.viewDescriptorService.getViewContainer(focusedViewId)!.id) {
|
||||
items.push(...pinnedViewlets
|
||||
.filter(viewletId => {
|
||||
if (viewletId === this.viewDescriptorService.getViewContainer(focusedViewId)!.id) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return !viewContainerRegistry.get(viewlet.id)!.rejectAddedViews && pinnedViewlets.indexOf(viewlet.id) !== -1;
|
||||
return !viewContainerRegistry.get(viewletId)!.rejectAddedViews;
|
||||
})
|
||||
.map(viewlet => {
|
||||
.map(viewletId => {
|
||||
return {
|
||||
id: viewlet.id,
|
||||
label: viewlet.name,
|
||||
id: viewletId,
|
||||
label: viewContainerRegistry.get(viewletId)!.name
|
||||
};
|
||||
});
|
||||
}));
|
||||
|
||||
if (this.viewDescriptorService.getViewLocation(focusedViewId) !== ViewContainerLocation.Panel) {
|
||||
items.unshift({
|
||||
type: 'separator',
|
||||
label: nls.localize('sidebar', "Side Bar")
|
||||
});
|
||||
items.push({
|
||||
type: 'separator',
|
||||
label: nls.localize('panel', "Panel")
|
||||
});
|
||||
items.push({
|
||||
id: '_.panel.newcontainer',
|
||||
label: nls.localize('moveFocusedView.newContainerInPanel', "New Container in Panel"),
|
||||
});
|
||||
}
|
||||
items.push({
|
||||
type: 'separator',
|
||||
label: nls.localize('panel', "Panel")
|
||||
});
|
||||
items.push({
|
||||
id: '_.panel.newcontainer',
|
||||
label: nls.localize('moveFocusedView.newContainerInPanel', "New Container in Panel"),
|
||||
});
|
||||
|
||||
const pinnedPanels = this.panelService.getPinnedPanels();
|
||||
items.push(...pinnedPanels
|
||||
.filter(panel => {
|
||||
if (panel.id === this.viewDescriptorService.getViewContainer(focusedViewId)!.id) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return !viewContainerRegistry.get(panel.id)!.rejectAddedViews;
|
||||
})
|
||||
.map(panel => {
|
||||
return {
|
||||
id: panel.id,
|
||||
label: viewContainerRegistry.get(panel.id)!.name
|
||||
};
|
||||
}));
|
||||
|
||||
quickPick.items = items;
|
||||
|
||||
@@ -583,6 +603,9 @@ export class MoveFocusedViewAction extends Action {
|
||||
if (destination.id === '_.panel.newcontainer') {
|
||||
this.viewDescriptorService.moveViewToLocation(viewDescriptor!, ViewContainerLocation.Panel);
|
||||
this.viewsService.openView(focusedViewId, true);
|
||||
} else if (destination.id === '_.sidebar.newcontainer') {
|
||||
this.viewDescriptorService.moveViewToLocation(viewDescriptor!, ViewContainerLocation.Sidebar);
|
||||
this.viewsService.openView(focusedViewId, true);
|
||||
} else if (destination.id) {
|
||||
this.viewDescriptorService.moveViewsToContainer([viewDescriptor], viewContainerRegistry.get(destination.id)!);
|
||||
this.viewsService.openView(focusedViewId, true);
|
||||
|
||||
Reference in New Issue
Block a user