mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-01-31 09:35:39 -05:00
Merge from vscode 8df646d3c5477b02737fc10343fa7cf0cc3f606b
This commit is contained in:
@@ -24,7 +24,7 @@ import { InEditorZenModeContext, IsCenteredLayoutContext, EditorAreaVisibleConte
|
||||
import { ContextKeyExpr, IContextKeyService } from 'vs/platform/contextkey/common/contextkey';
|
||||
import { SideBarVisibleContext } from 'vs/workbench/common/viewlet';
|
||||
import { IEnvironmentService } from 'vs/platform/environment/common/environment';
|
||||
import { IViewDescriptorService, IViewContainersRegistry, Extensions as ViewContainerExtensions, IViewsService, FocusedViewContext, ViewContainerLocation } from 'vs/workbench/common/views';
|
||||
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';
|
||||
@@ -598,6 +598,49 @@ export class MoveFocusedViewAction extends Action {
|
||||
registry.registerWorkbenchAction(SyncActionDescriptor.create(MoveFocusedViewAction, MoveFocusedViewAction.ID, MoveFocusedViewAction.LABEL), 'View: Move Focused View', viewCategory, FocusedViewContext.notEqualsTo(''));
|
||||
|
||||
|
||||
// --- Reset View Location with Command
|
||||
export class ResetFocusedViewLocationAction extends Action {
|
||||
static readonly ID = 'workbench.action.resetFocusedViewLocation';
|
||||
static readonly LABEL = nls.localize('resetFocusedViewLocation', "Reset Focused View Location");
|
||||
|
||||
constructor(
|
||||
id: string,
|
||||
label: string,
|
||||
@IViewDescriptorService private viewDescriptorService: IViewDescriptorService,
|
||||
@IContextKeyService private contextKeyService: IContextKeyService,
|
||||
@INotificationService private notificationService: INotificationService,
|
||||
@IViewsService private viewsService: IViewsService
|
||||
) {
|
||||
super(id, label);
|
||||
}
|
||||
|
||||
async run(): Promise<void> {
|
||||
const focusedViewId = FocusedViewContext.getValue(this.contextKeyService);
|
||||
|
||||
let viewDescriptor: IViewDescriptor | null = null;
|
||||
if (focusedViewId !== undefined && focusedViewId.trim() !== '') {
|
||||
viewDescriptor = this.viewDescriptorService.getViewDescriptor(focusedViewId);
|
||||
}
|
||||
|
||||
if (!viewDescriptor) {
|
||||
this.notificationService.error(nls.localize('resetFocusedView.error.noFocusedView', "There is no view currently focused."));
|
||||
return;
|
||||
}
|
||||
|
||||
const defaultContainer = this.viewDescriptorService.getDefaultContainer(viewDescriptor.id);
|
||||
if (!defaultContainer || defaultContainer === this.viewDescriptorService.getViewContainer(viewDescriptor.id)) {
|
||||
return;
|
||||
}
|
||||
|
||||
this.viewDescriptorService.moveViewsToContainer([viewDescriptor], defaultContainer);
|
||||
this.viewsService.openView(viewDescriptor.id, true);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
registry.registerWorkbenchAction(SyncActionDescriptor.create(ResetFocusedViewLocationAction, ResetFocusedViewLocationAction.ID, ResetFocusedViewLocationAction.LABEL), 'View: Reset Focused View Location', viewCategory, FocusedViewContext.notEqualsTo(''));
|
||||
|
||||
|
||||
// --- Resize View
|
||||
|
||||
export abstract class BaseResizeViewAction extends Action {
|
||||
|
||||
@@ -39,6 +39,21 @@ import { IConfigurationService } from 'vs/platform/configuration/common/configur
|
||||
import { getMenuBarVisibility } from 'vs/platform/windows/common/windows';
|
||||
import { isWeb } from 'vs/base/common/platform';
|
||||
import { IEnvironmentService } from 'vs/platform/environment/common/environment';
|
||||
import { IStorageKeysSyncRegistryService } from 'vs/platform/userDataSync/common/storageKeys';
|
||||
|
||||
interface IPlaceholderViewlet {
|
||||
id: string;
|
||||
name?: string;
|
||||
iconUrl?: UriComponents;
|
||||
views?: { when?: string }[];
|
||||
}
|
||||
|
||||
interface IPinnedViewlet {
|
||||
id: string;
|
||||
pinned: boolean;
|
||||
order?: number;
|
||||
visible: boolean;
|
||||
}
|
||||
|
||||
interface ICachedViewlet {
|
||||
id: string;
|
||||
@@ -55,7 +70,8 @@ export class ActivitybarPart extends Part implements IActivityBarService {
|
||||
_serviceBrand: undefined;
|
||||
|
||||
private static readonly ACTION_HEIGHT = 48;
|
||||
private static readonly PINNED_VIEWLETS = 'workbench.activity.pinnedViewlets';
|
||||
private static readonly PINNED_VIEWLETS = 'workbench.activity.pinnedViewlets2';
|
||||
private static readonly PLACEHOLDER_VIEWLETS = 'workbench.activity.placeholderViewlets';
|
||||
|
||||
//#region IView
|
||||
|
||||
@@ -92,9 +108,12 @@ export class ActivitybarPart extends Part implements IActivityBarService {
|
||||
@IContextKeyService private readonly contextKeyService: IContextKeyService,
|
||||
@IConfigurationService private readonly configurationService: IConfigurationService,
|
||||
@IWorkbenchEnvironmentService workbenchEnvironmentService: IWorkbenchEnvironmentService,
|
||||
@IEnvironmentService private readonly environmentService: IEnvironmentService
|
||||
@IEnvironmentService private readonly environmentService: IEnvironmentService,
|
||||
@IStorageKeysSyncRegistryService storageKeysSyncRegistryService: IStorageKeysSyncRegistryService
|
||||
) {
|
||||
super(Parts.ACTIVITYBAR_PART, { hasTitle: false }, themeService, storageService, layoutService);
|
||||
this.migrateFromOldCachedViewletsValue();
|
||||
storageKeysSyncRegistryService.registerStorageKey({ key: ActivitybarPart.PINNED_VIEWLETS, version: 1 });
|
||||
|
||||
this.cachedViewlets = this.getCachedViewlets();
|
||||
for (const cachedViewlet of this.cachedViewlets) {
|
||||
@@ -528,10 +547,15 @@ export class ActivitybarPart extends Part implements IActivityBarService {
|
||||
this.compositeBar.layout(new Dimension(width, availableHeight));
|
||||
}
|
||||
|
||||
private getViewContainer(viewletId: string): ViewContainer | undefined {
|
||||
const viewContainerRegistry = Registry.as<IViewContainersRegistry>(ViewContainerExtensions.ViewContainersRegistry);
|
||||
return viewContainerRegistry.get(viewletId);
|
||||
}
|
||||
|
||||
private onDidStorageChange(e: IWorkspaceStorageChangeEvent): void {
|
||||
if (e.key === ActivitybarPart.PINNED_VIEWLETS && e.scope === StorageScope.GLOBAL
|
||||
&& this.cachedViewletsValue !== this.getStoredCachedViewletsValue() /* This checks if current window changed the value or not */) {
|
||||
this._cachedViewletsValue = undefined;
|
||||
&& this.pinnedViewletsValue !== this.getStoredPinnedViewletsValue() /* This checks if current window changed the value or not */) {
|
||||
this._pinnedViewletsValue = undefined;
|
||||
const newCompositeItems: ICompositeBarItem[] = [];
|
||||
const compositeItems = this.compositeBar.getCompositeBarItems();
|
||||
const cachedViewlets = this.getCachedViewlets();
|
||||
@@ -583,64 +607,88 @@ export class ActivitybarPart extends Part implements IActivityBarService {
|
||||
}
|
||||
}
|
||||
|
||||
this.cachedViewletsValue = JSON.stringify(state);
|
||||
this.storeCachedViewletsState(state);
|
||||
}
|
||||
|
||||
private getCachedViewlets(): ICachedViewlet[] {
|
||||
const storedStates: Array<string | ICachedViewlet> = JSON.parse(this.cachedViewletsValue);
|
||||
const cachedViewlets = storedStates.map(c => {
|
||||
const serialized: ICachedViewlet = typeof c === 'string' /* migration from pinned states to composites states */ ? { id: c, pinned: true, order: undefined, visible: true, name: undefined, iconUrl: undefined, views: undefined } : c;
|
||||
serialized.visible = isUndefinedOrNull(serialized.visible) ? true : serialized.visible;
|
||||
return serialized;
|
||||
});
|
||||
|
||||
for (const old of this.loadOldCachedViewlets()) {
|
||||
const cachedViewlet = cachedViewlets.filter(cached => cached.id === old.id)[0];
|
||||
const cachedViewlets: Array<ICachedViewlet> = JSON.parse(this.pinnedViewletsValue);
|
||||
for (const placeholderViewlet of JSON.parse(this.placeholderViewletsValue)) {
|
||||
const cachedViewlet = cachedViewlets.filter(cached => cached.id === placeholderViewlet.id)[0];
|
||||
if (cachedViewlet) {
|
||||
cachedViewlet.name = old.name;
|
||||
cachedViewlet.iconUrl = old.iconUrl;
|
||||
cachedViewlet.views = old.views;
|
||||
cachedViewlet.name = placeholderViewlet.name;
|
||||
cachedViewlet.iconUrl = placeholderViewlet.iconUrl;
|
||||
cachedViewlet.views = placeholderViewlet.views;
|
||||
}
|
||||
}
|
||||
|
||||
return cachedViewlets;
|
||||
}
|
||||
|
||||
private loadOldCachedViewlets(): ICachedViewlet[] {
|
||||
const previousState = this.storageService.get('workbench.activity.placeholderViewlets', StorageScope.GLOBAL, '[]');
|
||||
const result: ICachedViewlet[] = JSON.parse(previousState);
|
||||
this.storageService.remove('workbench.activity.placeholderViewlets', StorageScope.GLOBAL);
|
||||
|
||||
return result;
|
||||
private storeCachedViewletsState(cachedViewlets: ICachedViewlet[]): void {
|
||||
this.pinnedViewletsValue = JSON.stringify(cachedViewlets.map(({ id, pinned, visible, order }) => (<IPinnedViewlet>{ id, pinned, visible, order })));
|
||||
this.placeholderViewletsValue = JSON.stringify(cachedViewlets.map(({ id, iconUrl, name, views }) => (<IPlaceholderViewlet>{ id, iconUrl, name, views })));
|
||||
}
|
||||
|
||||
private _cachedViewletsValue: string | undefined;
|
||||
private get cachedViewletsValue(): string {
|
||||
if (!this._cachedViewletsValue) {
|
||||
this._cachedViewletsValue = this.getStoredCachedViewletsValue();
|
||||
private _pinnedViewletsValue: string | undefined;
|
||||
private get pinnedViewletsValue(): string {
|
||||
if (!this._pinnedViewletsValue) {
|
||||
this._pinnedViewletsValue = this.getStoredPinnedViewletsValue();
|
||||
}
|
||||
|
||||
return this._cachedViewletsValue;
|
||||
return this._pinnedViewletsValue;
|
||||
}
|
||||
|
||||
private set cachedViewletsValue(cachedViewletsValue: string) {
|
||||
if (this.cachedViewletsValue !== cachedViewletsValue) {
|
||||
this._cachedViewletsValue = cachedViewletsValue;
|
||||
this.setStoredCachedViewletsValue(cachedViewletsValue);
|
||||
private set pinnedViewletsValue(pinnedViewletsValue: string) {
|
||||
if (this.pinnedViewletsValue !== pinnedViewletsValue) {
|
||||
this._pinnedViewletsValue = pinnedViewletsValue;
|
||||
this.setStoredPinnedViewletsValue(pinnedViewletsValue);
|
||||
}
|
||||
}
|
||||
|
||||
private getStoredCachedViewletsValue(): string {
|
||||
private getStoredPinnedViewletsValue(): string {
|
||||
return this.storageService.get(ActivitybarPart.PINNED_VIEWLETS, StorageScope.GLOBAL, '[]');
|
||||
}
|
||||
|
||||
private setStoredCachedViewletsValue(value: string): void {
|
||||
private setStoredPinnedViewletsValue(value: string): void {
|
||||
this.storageService.store(ActivitybarPart.PINNED_VIEWLETS, value, StorageScope.GLOBAL);
|
||||
}
|
||||
|
||||
private getViewContainer(viewletId: string): ViewContainer | undefined {
|
||||
const viewContainerRegistry = Registry.as<IViewContainersRegistry>(ViewContainerExtensions.ViewContainersRegistry);
|
||||
return viewContainerRegistry.get(viewletId);
|
||||
private _placeholderViewletsValue: string | undefined;
|
||||
private get placeholderViewletsValue(): string {
|
||||
if (!this._placeholderViewletsValue) {
|
||||
this._placeholderViewletsValue = this.getStoredPlaceholderViewletsValue();
|
||||
}
|
||||
|
||||
return this._placeholderViewletsValue;
|
||||
}
|
||||
|
||||
private set placeholderViewletsValue(placeholderViewletsValue: string) {
|
||||
if (this.placeholderViewletsValue !== placeholderViewletsValue) {
|
||||
this._placeholderViewletsValue = placeholderViewletsValue;
|
||||
this.setStoredPlaceholderViewletsValue(placeholderViewletsValue);
|
||||
}
|
||||
}
|
||||
|
||||
private getStoredPlaceholderViewletsValue(): string {
|
||||
return this.storageService.get(ActivitybarPart.PLACEHOLDER_VIEWLETS, StorageScope.GLOBAL, '[]');
|
||||
}
|
||||
|
||||
private setStoredPlaceholderViewletsValue(value: string): void {
|
||||
this.storageService.store(ActivitybarPart.PLACEHOLDER_VIEWLETS, value, StorageScope.GLOBAL);
|
||||
}
|
||||
|
||||
private migrateFromOldCachedViewletsValue(): void {
|
||||
const value = this.storageService.get('workbench.activity.pinnedViewlets', StorageScope.GLOBAL);
|
||||
if (value !== undefined) {
|
||||
const storedStates: Array<string | ICachedViewlet> = JSON.parse(value);
|
||||
const cachedViewlets = storedStates.map(c => {
|
||||
const serialized: ICachedViewlet = typeof c === 'string' /* migration from pinned states to composites states */ ? { id: c, pinned: true, order: undefined, visible: true, name: undefined, iconUrl: undefined, views: undefined } : c;
|
||||
serialized.visible = isUndefinedOrNull(serialized.visible) ? true : serialized.visible;
|
||||
return serialized;
|
||||
});
|
||||
this.storeCachedViewletsState(cachedViewlets);
|
||||
this.storageService.remove('workbench.activity.pinnedViewlets', StorageScope.GLOBAL);
|
||||
}
|
||||
}
|
||||
|
||||
toJSON(): object {
|
||||
|
||||
@@ -133,9 +133,7 @@ export class CompositeDragAndDrop implements ICompositeDragAndDrop {
|
||||
}
|
||||
|
||||
// ... single view
|
||||
const defaultContainer = this.viewDescriptorService.getDefaultContainer(draggedViews[0].id);
|
||||
const canMoveToDefault = !!defaultContainer && this.viewDescriptorService.getViewContainerLocation(defaultContainer) === this.targetContainerLocation;
|
||||
return !!draggedViews[0].canMoveView && (!!draggedViews[0].containerIcon || canMoveToDefault || this.targetContainerLocation === ViewContainerLocation.Panel);
|
||||
return !!draggedViews[0].canMoveView;
|
||||
} else {
|
||||
// Dragging an individual view
|
||||
const viewDescriptor = this.viewDescriptorService.getViewDescriptor(dragData.id);
|
||||
@@ -146,7 +144,7 @@ export class CompositeDragAndDrop implements ICompositeDragAndDrop {
|
||||
}
|
||||
|
||||
// ... to create a view container
|
||||
return this.targetContainerLocation === ViewContainerLocation.Panel || !!viewDescriptor.containerIcon;
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -36,7 +36,9 @@ import {
|
||||
SplitEditorUpAction, SplitEditorDownAction, MoveEditorToLeftGroupAction, MoveEditorToRightGroupAction, MoveEditorToAboveGroupAction, MoveEditorToBelowGroupAction, CloseAllEditorGroupsAction,
|
||||
JoinAllGroupsAction, FocusLeftGroup, FocusAboveGroup, FocusRightGroup, FocusBelowGroup, EditorLayoutSingleAction, EditorLayoutTwoColumnsAction, EditorLayoutThreeColumnsAction, EditorLayoutTwoByTwoGridAction,
|
||||
EditorLayoutTwoRowsAction, EditorLayoutThreeRowsAction, EditorLayoutTwoColumnsBottomAction, EditorLayoutTwoRowsRightAction, NewEditorGroupLeftAction, NewEditorGroupRightAction,
|
||||
NewEditorGroupAboveAction, NewEditorGroupBelowAction, SplitEditorOrthogonalAction, CloseEditorInAllGroupsAction, NavigateToLastEditLocationAction, ToggleGroupSizesAction, ShowAllEditorsByMostRecentlyUsedAction, QuickOpenPreviousRecentlyUsedEditorAction, OpenPreviousRecentlyUsedEditorInGroupAction, OpenNextRecentlyUsedEditorInGroupAction, QuickOpenNextRecentlyUsedEditorAction as QuickOpenLeastRecentlyUsedEditorAction, QuickOpenLeastRecentlyUsedEditorInGroupAction
|
||||
NewEditorGroupAboveAction, NewEditorGroupBelowAction, SplitEditorOrthogonalAction, CloseEditorInAllGroupsAction, NavigateToLastEditLocationAction, ToggleGroupSizesAction, ShowAllEditorsByMostRecentlyUsedAction,
|
||||
QuickOpenPreviousRecentlyUsedEditorAction, OpenPreviousRecentlyUsedEditorInGroupAction, OpenNextRecentlyUsedEditorInGroupAction, QuickOpenNextRecentlyUsedEditorAction as QuickOpenLeastRecentlyUsedEditorAction,
|
||||
QuickOpenLeastRecentlyUsedEditorInGroupAction
|
||||
} from 'vs/workbench/browser/parts/editor/editorActions';
|
||||
import * as editorCommands from 'vs/workbench/browser/parts/editor/editorCommands';
|
||||
import { IEditorService } from 'vs/workbench/services/editor/common/editorService';
|
||||
|
||||
@@ -24,6 +24,7 @@ import { IWorkspacesService } from 'vs/platform/workspaces/common/workspaces';
|
||||
import { IFileDialogService, ConfirmResult } from 'vs/platform/dialogs/common/dialogs';
|
||||
import { IWorkingCopyService } from 'vs/workbench/services/workingCopy/common/workingCopyService';
|
||||
import { values } from 'vs/base/common/map';
|
||||
import { ItemActivation } from 'vs/platform/quickinput/common/quickInput';
|
||||
|
||||
export class ExecuteCommandAction extends Action {
|
||||
|
||||
@@ -1261,6 +1262,7 @@ export class BaseQuickOpenEditorAction extends Action {
|
||||
id: string,
|
||||
label: string,
|
||||
private prefix: string,
|
||||
private itemActivation: ItemActivation | undefined,
|
||||
@IQuickOpenService private readonly quickOpenService: IQuickOpenService,
|
||||
@IKeybindingService private readonly keybindingService: IKeybindingService
|
||||
) {
|
||||
@@ -1270,7 +1272,10 @@ export class BaseQuickOpenEditorAction extends Action {
|
||||
async run(): Promise<void> {
|
||||
const keybindings = this.keybindingService.lookupKeybindings(this.id);
|
||||
|
||||
this.quickOpenService.show(this.prefix, { quickNavigateConfiguration: { keybindings } });
|
||||
this.quickOpenService.show(this.prefix, {
|
||||
quickNavigateConfiguration: { keybindings },
|
||||
autoFocus: this.itemActivation === ItemActivation.LAST ? { autoFocusLastEntry: true } : undefined
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1285,7 +1290,7 @@ export class QuickOpenPreviousRecentlyUsedEditorAction extends BaseQuickOpenEdit
|
||||
@IQuickOpenService quickOpenService: IQuickOpenService,
|
||||
@IKeybindingService keybindingService: IKeybindingService
|
||||
) {
|
||||
super(id, label, NAVIGATE_ALL_EDITORS_BY_MOST_RECENTLY_USED_PREFIX, quickOpenService, keybindingService);
|
||||
super(id, label, NAVIGATE_ALL_EDITORS_BY_MOST_RECENTLY_USED_PREFIX, undefined, quickOpenService, keybindingService);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1300,7 +1305,7 @@ export class QuickOpenNextRecentlyUsedEditorAction extends BaseQuickOpenEditorAc
|
||||
@IQuickOpenService quickOpenService: IQuickOpenService,
|
||||
@IKeybindingService keybindingService: IKeybindingService
|
||||
) {
|
||||
super(id, label, NAVIGATE_ALL_EDITORS_BY_MOST_RECENTLY_USED_PREFIX, quickOpenService, keybindingService);
|
||||
super(id, label, NAVIGATE_ALL_EDITORS_BY_MOST_RECENTLY_USED_PREFIX, undefined, quickOpenService, keybindingService);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1315,7 +1320,7 @@ export class QuickOpenPreviousRecentlyUsedEditorInGroupAction extends BaseQuickO
|
||||
@IQuickOpenService quickOpenService: IQuickOpenService,
|
||||
@IKeybindingService keybindingService: IKeybindingService
|
||||
) {
|
||||
super(id, label, NAVIGATE_IN_ACTIVE_GROUP_BY_MOST_RECENTLY_USED_PREFIX, quickOpenService, keybindingService);
|
||||
super(id, label, NAVIGATE_IN_ACTIVE_GROUP_BY_MOST_RECENTLY_USED_PREFIX, undefined, quickOpenService, keybindingService);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1330,7 +1335,7 @@ export class QuickOpenLeastRecentlyUsedEditorInGroupAction extends BaseQuickOpen
|
||||
@IQuickOpenService quickOpenService: IQuickOpenService,
|
||||
@IKeybindingService keybindingService: IKeybindingService
|
||||
) {
|
||||
super(id, label, NAVIGATE_IN_ACTIVE_GROUP_BY_MOST_RECENTLY_USED_PREFIX, quickOpenService, keybindingService);
|
||||
super(id, label, NAVIGATE_IN_ACTIVE_GROUP_BY_MOST_RECENTLY_USED_PREFIX, ItemActivation.LAST, quickOpenService, keybindingService);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -37,6 +37,7 @@ import { ViewContainer, IViewContainersRegistry, Extensions as ViewContainerExte
|
||||
import { MenuId } from 'vs/platform/actions/common/actions';
|
||||
import { ViewMenuActions } from 'vs/workbench/browser/parts/views/viewMenuActions';
|
||||
import { IPaneComposite } from 'vs/workbench/common/panecomposite';
|
||||
import { IStorageKeysSyncRegistryService } from 'vs/platform/userDataSync/common/storageKeys';
|
||||
|
||||
interface ICachedPanel {
|
||||
id: string;
|
||||
@@ -104,6 +105,7 @@ export class PanelPart extends CompositePart<Panel> implements IPanelService {
|
||||
@IViewDescriptorService private readonly viewDescriptorService: IViewDescriptorService,
|
||||
@IContextKeyService private readonly contextKeyService: IContextKeyService,
|
||||
@IExtensionService private readonly extensionService: IExtensionService,
|
||||
@IStorageKeysSyncRegistryService storageKeysSyncRegistryService: IStorageKeysSyncRegistryService
|
||||
) {
|
||||
super(
|
||||
notificationService,
|
||||
@@ -125,6 +127,7 @@ export class PanelPart extends CompositePart<Panel> implements IPanelService {
|
||||
);
|
||||
|
||||
this.panelRegistry = Registry.as<PanelRegistry>(PanelExtensions.Panels);
|
||||
storageKeysSyncRegistryService.registerStorageKey({ key: PanelPart.PINNED_PANELS, version: 1 });
|
||||
|
||||
this.compositeBar = this._register(this.instantiationService.createInstance(CompositeBar, this.getCachedPanels(), {
|
||||
icon: false,
|
||||
|
||||
@@ -47,7 +47,7 @@ import { IEditorService, ACTIVE_GROUP, SIDE_GROUP } from 'vs/workbench/services/
|
||||
import { IEditorGroupsService } from 'vs/workbench/services/editor/common/editorGroupsService';
|
||||
import { ILabelService } from 'vs/platform/label/common/label';
|
||||
import { timeout } from 'vs/base/common/async';
|
||||
import { IQuickInputService, IQuickPickItem } from 'vs/platform/quickinput/common/quickInput';
|
||||
import { IQuickInputService, IQuickPickItem, ItemActivation } from 'vs/platform/quickinput/common/quickInput';
|
||||
import { CancellationTokenSource, CancellationToken } from 'vs/base/common/cancellation';
|
||||
import { IStorageService } from 'vs/platform/storage/common/storage';
|
||||
import { registerSingleton } from 'vs/platform/instantiation/common/extensions';
|
||||
@@ -179,7 +179,20 @@ export class QuickOpenController extends Component implements IQuickOpenService
|
||||
|
||||
show(prefix?: string, options?: IShowOptions): Promise<void> {
|
||||
if (this.useNewExperimentalVersion) {
|
||||
this.quickInputService.quickAccess.show(prefix, options);
|
||||
this.quickInputService.quickAccess.show(prefix, {
|
||||
quickNavigateConfiguration: options?.quickNavigateConfiguration,
|
||||
itemActivation: (() => {
|
||||
if (options?.autoFocus?.autoFocusSecondEntry) {
|
||||
return ItemActivation.SECOND;
|
||||
}
|
||||
|
||||
if (options?.autoFocus?.autoFocusLastEntry) {
|
||||
return ItemActivation.LAST;
|
||||
}
|
||||
|
||||
return undefined;
|
||||
})()
|
||||
});
|
||||
|
||||
return Promise.resolve();
|
||||
}
|
||||
|
||||
@@ -21,8 +21,8 @@ import { IKeybindingService } from 'vs/platform/keybinding/common/keybinding';
|
||||
import { KeyMod, KeyCode } from 'vs/base/common/keyCodes';
|
||||
import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation';
|
||||
import { Event, Emitter } from 'vs/base/common/event';
|
||||
import { IThemeService, IColorTheme, ICssStyleCollector, registerThemingParticipant } from 'vs/platform/theme/common/themeService';
|
||||
import { contrastBorder, editorBackground } from 'vs/platform/theme/common/colorRegistry';
|
||||
import { IThemeService } from 'vs/platform/theme/common/themeService';
|
||||
import { contrastBorder } from 'vs/platform/theme/common/colorRegistry';
|
||||
import { SIDE_BAR_TITLE_FOREGROUND, SIDE_BAR_BACKGROUND, SIDE_BAR_FOREGROUND, SIDE_BAR_BORDER, SIDE_BAR_DRAG_AND_DROP_BACKGROUND } from 'vs/workbench/common/theme';
|
||||
import { INotificationService } from 'vs/platform/notification/common/notification';
|
||||
import { EventType, addDisposableListener, trackFocus } from 'vs/base/browser/dom';
|
||||
@@ -333,23 +333,6 @@ class FocusSideBarAction extends Action {
|
||||
}
|
||||
}
|
||||
|
||||
registerThemingParticipant((theme: IColorTheme, collector: ICssStyleCollector) => {
|
||||
|
||||
// Sidebar Background: since views can host editors, we apply a background rule if the sidebar background
|
||||
// color is different from the editor background color. This is a bit of a hack though. The better way
|
||||
// would be to have a way to push the background color onto each editor widget itself somehow.
|
||||
const sidebarBackground = theme.getColor(SIDE_BAR_BACKGROUND);
|
||||
if (sidebarBackground && sidebarBackground !== theme.getColor(editorBackground)) {
|
||||
collector.addRule(`
|
||||
.monaco-workbench .part.sidebar > .content .monaco-editor,
|
||||
.monaco-workbench .part.sidebar > .content .monaco-editor .margin,
|
||||
.monaco-workbench .part.sidebar > .content .monaco-editor .monaco-editor-background {
|
||||
background-color: ${sidebarBackground};
|
||||
}
|
||||
`);
|
||||
}
|
||||
});
|
||||
|
||||
const registry = Registry.as<IWorkbenchActionRegistry>(ActionExtensions.WorkbenchActions);
|
||||
registry.registerWorkbenchAction(SyncActionDescriptor.create(FocusSideBarAction, FocusSideBarAction.ID, FocusSideBarAction.LABEL, {
|
||||
primary: KeyMod.CtrlCmd | KeyCode.KEY_0
|
||||
|
||||
@@ -35,6 +35,7 @@ import { values } from 'vs/base/common/map';
|
||||
import { assertIsDefined } from 'vs/base/common/types';
|
||||
import { Emitter, Event } from 'vs/base/common/event';
|
||||
import { Command } from 'vs/editor/common/modes';
|
||||
import { IStorageKeysSyncRegistryService } from 'vs/platform/userDataSync/common/storageKeys';
|
||||
|
||||
interface IPendingStatusbarEntry {
|
||||
id: string;
|
||||
@@ -55,7 +56,7 @@ interface IStatusbarViewModelEntry {
|
||||
|
||||
class StatusbarViewModel extends Disposable {
|
||||
|
||||
private static readonly HIDDEN_ENTRIES_KEY = 'workbench.statusbar.hidden';
|
||||
static readonly HIDDEN_ENTRIES_KEY = 'workbench.statusbar.hidden';
|
||||
|
||||
private readonly _entries: IStatusbarViewModelEntry[] = [];
|
||||
get entries(): IStatusbarViewModelEntry[] { return this._entries; }
|
||||
@@ -354,12 +355,14 @@ export class StatusbarPart extends Part implements IStatusbarService {
|
||||
@IWorkspaceContextService private readonly contextService: IWorkspaceContextService,
|
||||
@IStorageService storageService: IStorageService,
|
||||
@IWorkbenchLayoutService layoutService: IWorkbenchLayoutService,
|
||||
@IContextMenuService private contextMenuService: IContextMenuService
|
||||
@IContextMenuService private contextMenuService: IContextMenuService,
|
||||
@IStorageKeysSyncRegistryService storageKeysSyncRegistryService: IStorageKeysSyncRegistryService,
|
||||
) {
|
||||
super(Parts.STATUSBAR_PART, { hasTitle: false }, themeService, storageService, layoutService);
|
||||
|
||||
this.viewModel = this._register(new StatusbarViewModel(storageService));
|
||||
this.onDidChangeEntryVisibility = this.viewModel.onDidChangeEntryVisibility;
|
||||
storageKeysSyncRegistryService.registerStorageKey({ key: StatusbarViewModel.HIDDEN_ENTRIES_KEY, version: 1 });
|
||||
|
||||
this.registerListeners();
|
||||
}
|
||||
|
||||
@@ -467,7 +467,7 @@ export class TitlebarPart extends Part implements ITitleService {
|
||||
if ((!isWeb && isMacintosh) || this.currentMenubarVisibility === 'hidden') {
|
||||
this.title.style.zoom = `${1 / getZoomFactor()}`;
|
||||
} else {
|
||||
this.title.style.zoom = null;
|
||||
this.title.style.zoom = '';
|
||||
}
|
||||
|
||||
runAtThisOrScheduleAtNextAnimationFrame(() => this.adjustTitleMarginToCenter());
|
||||
|
||||
@@ -414,7 +414,7 @@ export class TreeView extends Disposable implements ITreeView {
|
||||
const actionViewItemProvider = (action: IAction) => action instanceof MenuItemAction ? this.instantiationService.createInstance(ContextAwareMenuEntryActionViewItem, action) : undefined;
|
||||
const treeMenus = this._register(this.instantiationService.createInstance(TreeMenus, this.id));
|
||||
this.treeLabels = this._register(this.instantiationService.createInstance(ResourceLabels, this));
|
||||
const dataSource = this.instantiationService.createInstance(TreeDataSource, this, <T>(task: Promise<T>) => this.progressService.withProgress({ location: this.viewContainer.id }, () => task));
|
||||
const dataSource = this.instantiationService.createInstance(TreeDataSource, this, <T>(task: Promise<T>) => this.progressService.withProgress({ location: this.id }, () => task));
|
||||
const aligner = new Aligner(this.themeService);
|
||||
const renderer = this.instantiationService.createInstance(TreeRenderer, this.id, treeMenus, this.treeLabels, actionViewItemProvider, aligner);
|
||||
|
||||
@@ -1015,7 +1015,7 @@ export class CustomTreeView extends TreeView {
|
||||
|
||||
private activate() {
|
||||
if (!this.activated) {
|
||||
this.progressService.withProgress({ location: this.viewContainer.id }, () => this.extensionService.activateByEvent(`onView:${this.id}`))
|
||||
this.progressService.withProgress({ location: this.id }, () => this.extensionService.activateByEvent(`onView:${this.id}`))
|
||||
.then(() => timeout(2000))
|
||||
.then(() => {
|
||||
this.updateMessage();
|
||||
|
||||
@@ -22,7 +22,6 @@ import { registerSingleton } from 'vs/platform/instantiation/common/extensions';
|
||||
import { IPaneComposite } from 'vs/workbench/common/panecomposite';
|
||||
import { IPanelService } from 'vs/workbench/services/panel/common/panelService';
|
||||
import { ServicesAccessor, IInstantiationService } from 'vs/platform/instantiation/common/instantiation';
|
||||
import { VIEW_ID as SEARCH_VIEW_ID } from 'vs/workbench/services/search/common/search';
|
||||
import { ViewPaneContainer } from 'vs/workbench/browser/parts/views/viewPaneContainer';
|
||||
import { PaneCompositePanel, PanelRegistry, PanelDescriptor, Extensions as PanelExtensions } from 'vs/workbench/browser/panel';
|
||||
import { ITelemetryService } from 'vs/platform/telemetry/common/telemetry';
|
||||
@@ -571,33 +570,28 @@ export class ViewsService extends Disposable implements IViewsService {
|
||||
}
|
||||
}));
|
||||
|
||||
const newLocation = location === ViewContainerLocation.Panel ? ViewContainerLocation.Sidebar : ViewContainerLocation.Panel;
|
||||
disposables.add(registerAction2(class MoveViewAction extends Action2 {
|
||||
disposables.add(registerAction2(class ResetViewLocationAction extends Action2 {
|
||||
constructor() {
|
||||
super({
|
||||
id: `${viewDescriptor.id}.moveView`,
|
||||
id: `${viewDescriptor.id}.resetViewLocation`,
|
||||
title: {
|
||||
original: newLocation === ViewContainerLocation.Sidebar ? 'Move to Sidebar' : 'Move to Panel',
|
||||
value: newLocation === ViewContainerLocation.Sidebar ? localize('moveViewToSidebar', "Move to Sidebar") : localize('moveViewToPanel', "Move to Panel")
|
||||
original: 'Reset View Location',
|
||||
value: localize('resetViewLocation', "Reset View Location")
|
||||
},
|
||||
menu: [{
|
||||
id: MenuId.ViewTitleContext,
|
||||
when: ContextKeyExpr.or(
|
||||
ContextKeyExpr.and(
|
||||
ContextKeyExpr.equals('view', viewDescriptor.id),
|
||||
ContextKeyExpr.has(`${viewDescriptor.id}.canMove`),
|
||||
ContextKeyExpr.equals('config.workbench.view.experimental.allowMovingToNewContainer', true)),
|
||||
ContextKeyExpr.and(
|
||||
ContextKeyExpr.equals('view', viewDescriptor.id),
|
||||
ContextKeyExpr.has(`${viewDescriptor.id}.canMove`),
|
||||
ContextKeyExpr.equals('view', SEARCH_VIEW_ID)
|
||||
ContextKeyExpr.equals(`${viewDescriptor.id}.defaultViewLocation`, false)
|
||||
)
|
||||
)
|
||||
}],
|
||||
});
|
||||
}
|
||||
run(accessor: ServicesAccessor): void {
|
||||
accessor.get(IViewDescriptorService).moveViewToLocation(viewDescriptor, newLocation);
|
||||
const viewDescriptorService = accessor.get(IViewDescriptorService);
|
||||
viewDescriptorService.moveViewsToContainer([viewDescriptor], viewDescriptorService.getDefaultContainer(viewDescriptor.id)!);
|
||||
accessor.get(IViewsService).openView(viewDescriptor.id, true);
|
||||
}
|
||||
}));
|
||||
|
||||
@@ -226,11 +226,6 @@ import { workbenchConfigurationNodeBase } from 'vs/workbench/common/configuratio
|
||||
'default': true, // {{SQL CARBON EDIT}} - change the default value from false to true.
|
||||
'description': nls.localize('viewVisibility', "Controls the visibility of view header actions. View header actions may either be always visible, or only visible when that view is focused or hovered over.")
|
||||
},
|
||||
'workbench.view.experimental.allowMovingToNewContainer': {
|
||||
'type': 'boolean',
|
||||
'default': true,
|
||||
'description': nls.localize('movingViewContainer', "Controls whether specific views will have a context menu entry allowing them to be moved to a new container. Currently, this setting only affects the outline view and views contributed by extensions.")
|
||||
},
|
||||
'workbench.fontAliasing': {
|
||||
'type': 'string',
|
||||
'enum': ['default', 'antialiased', 'none', 'auto'],
|
||||
|
||||
Reference in New Issue
Block a user