提交 4b253677 编写于 作者: S SteVen Batten

remove view moving setting

上级 8f722c49
...@@ -22,7 +22,6 @@ import { registerSingleton } from 'vs/platform/instantiation/common/extensions'; ...@@ -22,7 +22,6 @@ import { registerSingleton } from 'vs/platform/instantiation/common/extensions';
import { IPaneComposite } from 'vs/workbench/common/panecomposite'; import { IPaneComposite } from 'vs/workbench/common/panecomposite';
import { IPanelService } from 'vs/workbench/services/panel/common/panelService'; import { IPanelService } from 'vs/workbench/services/panel/common/panelService';
import { ServicesAccessor, IInstantiationService } from 'vs/platform/instantiation/common/instantiation'; 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 { ViewPaneContainer } from 'vs/workbench/browser/parts/views/viewPaneContainer';
import { PaneCompositePanel, PanelRegistry, PanelDescriptor, Extensions as PanelExtensions } from 'vs/workbench/browser/panel'; import { PaneCompositePanel, PanelRegistry, PanelDescriptor, Extensions as PanelExtensions } from 'vs/workbench/browser/panel';
import { ITelemetryService } from 'vs/platform/telemetry/common/telemetry'; import { ITelemetryService } from 'vs/platform/telemetry/common/telemetry';
......
...@@ -226,11 +226,6 @@ import { workbenchConfigurationNodeBase } from 'vs/workbench/common/configuratio ...@@ -226,11 +226,6 @@ import { workbenchConfigurationNodeBase } from 'vs/workbench/common/configuratio
'default': false, 'default': false,
'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.") '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': { 'workbench.fontAliasing': {
'type': 'string', 'type': 'string',
'enum': ['default', 'antialiased', 'none', 'auto'], 'enum': ['default', 'antialiased', 'none', 'auto'],
......
...@@ -14,8 +14,6 @@ import { SyncDescriptor } from 'vs/platform/instantiation/common/descriptors'; ...@@ -14,8 +14,6 @@ import { SyncDescriptor } from 'vs/platform/instantiation/common/descriptors';
import { registerSingleton } from 'vs/platform/instantiation/common/extensions'; import { registerSingleton } from 'vs/platform/instantiation/common/extensions';
import { Event, Emitter } from 'vs/base/common/event'; import { Event, Emitter } from 'vs/base/common/event';
import { firstIndex } from 'vs/base/common/arrays'; import { firstIndex } from 'vs/base/common/arrays';
import { IConfigurationService } from 'vs/platform/configuration/common/configuration';
import { VIEW_ID as SEARCH_VIEW_ID } from 'vs/workbench/services/search/common/search';
class CounterSet<T> implements IReadableSet<T> { class CounterSet<T> implements IReadableSet<T> {
...@@ -219,8 +217,7 @@ export class ViewDescriptorService extends Disposable implements IViewDescriptor ...@@ -219,8 +217,7 @@ export class ViewDescriptorService extends Disposable implements IViewDescriptor
constructor( constructor(
@IContextKeyService private readonly contextKeyService: IContextKeyService, @IContextKeyService private readonly contextKeyService: IContextKeyService,
@IStorageService private readonly storageService: IStorageService, @IStorageService private readonly storageService: IStorageService,
@IExtensionService private readonly extensionService: IExtensionService, @IExtensionService private readonly extensionService: IExtensionService
@IConfigurationService private readonly configurationService: IConfigurationService
) { ) {
super(); super();
...@@ -256,33 +253,6 @@ export class ViewDescriptorService extends Disposable implements IViewDescriptor ...@@ -256,33 +253,6 @@ export class ViewDescriptorService extends Disposable implements IViewDescriptor
this._register(this.storageService.onDidChangeStorage((e) => { this.onDidStorageChange(e); })); this._register(this.storageService.onDidChangeStorage((e) => { this.onDidStorageChange(e); }));
this._register(this.extensionService.onDidRegisterExtensions(() => this.onDidRegisterExtensions())); this._register(this.extensionService.onDidRegisterExtensions(() => this.onDidRegisterExtensions()));
this._register(this.configurationService.onDidChangeConfiguration((changeEvent) => {
if (changeEvent.affectedKeys.find(key => key === 'workbench.view.experimental.allowMovingToNewContainer')) {
if (this.viewsCanMoveSettingValue) {
return;
}
// update all moved views to their default locations
for (const viewId of this.cachedViewInfo.keys()) {
if (viewId === SEARCH_VIEW_ID) {
continue;
}
const viewDescriptor = this.getViewDescriptor(viewId);
const viewLocation = this.getViewContainer(viewId);
const defaultLocation = this.getDefaultContainer(viewId);
if (viewDescriptor && viewLocation && defaultLocation && defaultLocation !== viewLocation) {
this.moveViews([viewDescriptor], viewLocation, defaultLocation);
}
}
}
}));
}
private get viewsCanMoveSettingValue(): boolean {
return !!this.configurationService.getValue<boolean>('workbench.view.experimental.allowMovingToNewContainer');
} }
private registerGroupedViews(groupedViews: Map<string, { cachedContainerInfo?: ICachedViewContainerInfo, views: IViewDescriptor[] }>): void { private registerGroupedViews(groupedViews: Map<string, { cachedContainerInfo?: ICachedViewContainerInfo, views: IViewDescriptor[] }>): void {
...@@ -379,7 +349,7 @@ export class ViewDescriptorService extends Disposable implements IViewDescriptor ...@@ -379,7 +349,7 @@ export class ViewDescriptorService extends Disposable implements IViewDescriptor
} }
private shouldGenerateContainer(containerInfo: ICachedViewContainerInfo): boolean { private shouldGenerateContainer(containerInfo: ICachedViewContainerInfo): boolean {
return !!containerInfo.sourceViewId && containerInfo.location !== undefined && (this.viewsCanMoveSettingValue || containerInfo.sourceViewId === SEARCH_VIEW_ID); return !!containerInfo.sourceViewId && containerInfo.location !== undefined;
} }
private onDidDeregisterViews(views: IViewDescriptor[], viewContainer: ViewContainer): void { private onDidDeregisterViews(views: IViewDescriptor[], viewContainer: ViewContainer): void {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册