#115289 show only default containers in view menu
This commit is contained in:
parent
3feb8937a8
commit
7020ccf134
25 changed files with 114 additions and 110 deletions
|
@ -473,7 +473,7 @@ export class MainThreadComments extends Disposable implements MainThreadComments
|
||||||
if (!commentsViewAlreadyRegistered) {
|
if (!commentsViewAlreadyRegistered) {
|
||||||
const VIEW_CONTAINER: ViewContainer = Registry.as<IViewContainersRegistry>(ViewExtensions.ViewContainersRegistry).registerViewContainer({
|
const VIEW_CONTAINER: ViewContainer = Registry.as<IViewContainersRegistry>(ViewExtensions.ViewContainersRegistry).registerViewContainer({
|
||||||
id: COMMENTS_VIEW_ID,
|
id: COMMENTS_VIEW_ID,
|
||||||
title: { value: localize('comments', "Comments"), original: 'Comments' },
|
title: COMMENTS_VIEW_TITLE,
|
||||||
ctorDescriptor: new SyncDescriptor(ViewPaneContainer, [COMMENTS_VIEW_ID, { mergeViewWithContainerWhenSingleView: true, donotShowContainerTitleWhenMergedWithContainer: true }]),
|
ctorDescriptor: new SyncDescriptor(ViewPaneContainer, [COMMENTS_VIEW_ID, { mergeViewWithContainerWhenSingleView: true, donotShowContainerTitleWhenMergedWithContainer: true }]),
|
||||||
storageId: COMMENTS_VIEW_TITLE,
|
storageId: COMMENTS_VIEW_TITLE,
|
||||||
hideIfEmpty: true,
|
hideIfEmpty: true,
|
||||||
|
|
|
@ -372,7 +372,7 @@ class ViewsExtensionHandler implements IWorkbenchContribution {
|
||||||
|
|
||||||
viewContainer = this.viewContainersRegistry.registerViewContainer({
|
viewContainer = this.viewContainersRegistry.registerViewContainer({
|
||||||
id,
|
id,
|
||||||
title: { value: title, original: title }, extensionId,
|
title, extensionId,
|
||||||
ctorDescriptor: new SyncDescriptor(
|
ctorDescriptor: new SyncDescriptor(
|
||||||
ViewPaneContainer,
|
ViewPaneContainer,
|
||||||
[id, { mergeViewWithContainerWhenSingleView: true }]
|
[id, { mergeViewWithContainerWhenSingleView: true }]
|
||||||
|
@ -462,7 +462,7 @@ class ViewsExtensionHandler implements IWorkbenchContribution {
|
||||||
name: item.name,
|
name: item.name,
|
||||||
when: ContextKeyExpr.deserialize(item.when),
|
when: ContextKeyExpr.deserialize(item.when),
|
||||||
containerIcon: icon || viewContainer?.icon,
|
containerIcon: icon || viewContainer?.icon,
|
||||||
containerTitle: item.contextualTitle || viewContainer?.title.value,
|
containerTitle: item.contextualTitle || viewContainer?.title,
|
||||||
canToggleVisibility: true,
|
canToggleVisibility: true,
|
||||||
canMoveView: viewContainer?.id !== REMOTE,
|
canMoveView: viewContainer?.id !== REMOTE,
|
||||||
treeView: type === ViewType.Tree ? this.instantiationService.createInstance(CustomTreeView, item.id, item.name) : undefined,
|
treeView: type === ViewType.Tree ? this.instantiationService.createInstance(CustomTreeView, item.id, item.name) : undefined,
|
||||||
|
|
|
@ -678,7 +678,7 @@ export class MoveFocusedViewAction extends Action {
|
||||||
.map(viewletId => {
|
.map(viewletId => {
|
||||||
return {
|
return {
|
||||||
id: viewletId,
|
id: viewletId,
|
||||||
label: this.viewDescriptorService.getViewContainerById(viewletId)!.title.value
|
label: this.viewDescriptorService.getViewContainerById(viewletId)!.title
|
||||||
};
|
};
|
||||||
}));
|
}));
|
||||||
|
|
||||||
|
@ -699,7 +699,7 @@ export class MoveFocusedViewAction extends Action {
|
||||||
.map(panel => {
|
.map(panel => {
|
||||||
return {
|
return {
|
||||||
id: panel.id,
|
id: panel.id,
|
||||||
label: this.viewDescriptorService.getViewContainerById(panel.id)!.title.value
|
label: this.viewDescriptorService.getViewContainerById(panel.id)!.title
|
||||||
};
|
};
|
||||||
}));
|
}));
|
||||||
|
|
||||||
|
|
|
@ -812,7 +812,7 @@ export class ActivitybarPart extends Part implements IActivityBarService {
|
||||||
}
|
}
|
||||||
|
|
||||||
private addComposite(viewContainer: ViewContainer): void {
|
private addComposite(viewContainer: ViewContainer): void {
|
||||||
this.compositeBar.addComposite({ id: viewContainer.id, name: viewContainer.title.value, order: viewContainer.order, requestedIndex: viewContainer.requestedIndex });
|
this.compositeBar.addComposite({ id: viewContainer.id, name: viewContainer.title, order: viewContainer.order, requestedIndex: viewContainer.requestedIndex });
|
||||||
}
|
}
|
||||||
|
|
||||||
private hideComposite(compositeId: string): void {
|
private hideComposite(compositeId: string): void {
|
||||||
|
|
|
@ -310,7 +310,7 @@ export class PanelPart extends CompositePart<Panel> implements IPanelService {
|
||||||
}
|
}
|
||||||
if (viewContainerModel.activeViewDescriptors.length) {
|
if (viewContainerModel.activeViewDescriptors.length) {
|
||||||
contextKey.set(true);
|
contextKey.set(true);
|
||||||
this.compositeBar.addComposite({ id: viewContainer.id, name: viewContainer.title.value, order: viewContainer.order, requestedIndex: viewContainer.requestedIndex });
|
this.compositeBar.addComposite({ id: viewContainer.id, name: viewContainer.title, order: viewContainer.order, requestedIndex: viewContainer.requestedIndex });
|
||||||
} else if (viewContainer.hideIfEmpty) {
|
} else if (viewContainer.hideIfEmpty) {
|
||||||
contextKey.set(false);
|
contextKey.set(false);
|
||||||
this.hideComposite(viewContainer.id);
|
this.hideComposite(viewContainer.id);
|
||||||
|
|
|
@ -142,24 +142,24 @@ export class ViewsService extends Disposable implements IViewsService {
|
||||||
}));
|
}));
|
||||||
|
|
||||||
// Register Action to Open View Container
|
// Register Action to Open View Container
|
||||||
const defaultLocation = this.viewDescriptorService.getDefaultViewContainerLocation(viewContainer);
|
const commandId = viewContainer.commandId ?? viewContainer.id;
|
||||||
const commandAction = {
|
const that = this;
|
||||||
id: viewContainer.commandId ?? viewContainer.id,
|
|
||||||
title: viewContainer.title,
|
|
||||||
keybinding: viewContainer.keybindings ? { ...viewContainer.keybindings, weight: KeybindingWeight.WorkbenchContrib } : undefined
|
|
||||||
};
|
|
||||||
this._register(registerAction2(class OpenViewContainerAction extends Action2 {
|
this._register(registerAction2(class OpenViewContainerAction extends Action2 {
|
||||||
constructor() {
|
constructor() {
|
||||||
super({
|
super({
|
||||||
id: commandAction.id,
|
id: commandId,
|
||||||
title: commandAction.title,
|
get title(): ICommandActionTitle {
|
||||||
keybinding: commandAction.keybinding,
|
const viewContainerLocation = that.viewDescriptorService.getViewContainerLocation(viewContainer);
|
||||||
menu: [{
|
if (viewContainerLocation === ViewContainerLocation.Sidebar) {
|
||||||
id: MenuId.MenubarViewMenu,
|
return { value: localize('show view', "Show {0}", viewContainer.title), original: `Show ${viewContainer.title}` };
|
||||||
group: defaultLocation === ViewContainerLocation.Sidebar ? '3_views' : '4_panels',
|
} else {
|
||||||
when: ContextKeyExpr.has(getEnabledViewContainerContextKey(viewContainer.id)),
|
return { value: localize('toggle view', "Toggle {0}", viewContainer.title), original: `Toggle ${viewContainer.title}` };
|
||||||
order: viewContainer.order ?? Number.MAX_VALUE
|
}
|
||||||
}]
|
},
|
||||||
|
category: CATEGORIES.View.value,
|
||||||
|
precondition: ContextKeyExpr.has(getEnabledViewContainerContextKey(viewContainer.id)),
|
||||||
|
keybinding: viewContainer.keybindings ? { ...viewContainer.keybindings, weight: KeybindingWeight.WorkbenchContrib } : undefined,
|
||||||
|
f1: true
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
public async run(serviceAccessor: ServicesAccessor): Promise<any> {
|
public async run(serviceAccessor: ServicesAccessor): Promise<any> {
|
||||||
|
@ -186,22 +186,19 @@ export class ViewsService extends Disposable implements IViewsService {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}));
|
}));
|
||||||
const that = this;
|
|
||||||
this._register(MenuRegistry.appendMenuItem(MenuId.CommandPalette, {
|
if (viewContainer.mnemonicTitle) {
|
||||||
command: {
|
const defaultLocation = this.viewDescriptorService.getDefaultViewContainerLocation(viewContainer);
|
||||||
id: commandAction.id,
|
this._register(MenuRegistry.appendMenuItem(MenuId.MenubarViewMenu, {
|
||||||
get title(): ICommandActionTitle {
|
command: {
|
||||||
const viewContainerLocation = that.viewDescriptorService.getViewContainerLocation(viewContainer);
|
id: commandId,
|
||||||
if (viewContainerLocation === ViewContainerLocation.Sidebar) {
|
title: viewContainer.mnemonicTitle,
|
||||||
return { value: localize('show view', "Show {0}", commandAction.title.value), original: `Show ${commandAction.title.value}` };
|
|
||||||
} else {
|
|
||||||
return { value: localize('toggle view', "Toggle {0}", commandAction.title.value), original: `Toggle ${commandAction.title.value}` };
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
category: CATEGORIES.View.value,
|
group: defaultLocation === ViewContainerLocation.Sidebar ? '3_views' : '4_panels',
|
||||||
precondition: ContextKeyExpr.has(getEnabledViewContainerContextKey(viewContainer.id)),
|
when: ContextKeyExpr.has(getEnabledViewContainerContextKey(viewContainer.id)),
|
||||||
}
|
order: viewContainer.order ?? Number.MAX_VALUE
|
||||||
}));
|
}));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private onDidChangeContainerLocation(viewContainer: ViewContainer, from: ViewContainerLocation, to: ViewContainerLocation): void {
|
private onDidChangeContainerLocation(viewContainer: ViewContainer, from: ViewContainerLocation, to: ViewContainerLocation): void {
|
||||||
|
@ -529,7 +526,7 @@ export class ViewsService extends Disposable implements IViewsService {
|
||||||
Registry.as<PanelRegistry>(PanelExtensions.Panels).registerPanel(PanelDescriptor.create(
|
Registry.as<PanelRegistry>(PanelExtensions.Panels).registerPanel(PanelDescriptor.create(
|
||||||
PaneContainerPanel,
|
PaneContainerPanel,
|
||||||
viewContainer.id,
|
viewContainer.id,
|
||||||
viewContainer.title.value,
|
viewContainer.title,
|
||||||
undefined,
|
undefined,
|
||||||
viewContainer.order,
|
viewContainer.order,
|
||||||
viewContainer.requestedIndex,
|
viewContainer.requestedIndex,
|
||||||
|
@ -564,7 +561,7 @@ export class ViewsService extends Disposable implements IViewsService {
|
||||||
Registry.as<ViewletRegistry>(ViewletExtensions.Viewlets).registerViewlet(ViewletDescriptor.create(
|
Registry.as<ViewletRegistry>(ViewletExtensions.Viewlets).registerViewlet(ViewletDescriptor.create(
|
||||||
PaneContainerViewlet,
|
PaneContainerViewlet,
|
||||||
viewContainer.id,
|
viewContainer.id,
|
||||||
viewContainer.title.value,
|
viewContainer.title,
|
||||||
isString(viewContainer.icon) ? viewContainer.icon : undefined,
|
isString(viewContainer.icon) ? viewContainer.icon : undefined,
|
||||||
viewContainer.order,
|
viewContainer.order,
|
||||||
viewContainer.requestedIndex,
|
viewContainer.requestedIndex,
|
||||||
|
|
|
@ -28,7 +28,6 @@ import { mixin } from 'vs/base/common/objects';
|
||||||
import { Codicon } from 'vs/base/common/codicons';
|
import { Codicon } from 'vs/base/common/codicons';
|
||||||
import { registerIcon } from 'vs/platform/theme/common/iconRegistry';
|
import { registerIcon } from 'vs/platform/theme/common/iconRegistry';
|
||||||
import { CancellationToken } from 'vs/base/common/cancellation';
|
import { CancellationToken } from 'vs/base/common/cancellation';
|
||||||
import { ILocalizedString } from 'vs/platform/actions/common/actions';
|
|
||||||
|
|
||||||
export const defaultViewIcon = registerIcon('default-view-icon', Codicon.window, localize('defaultViewIcon', 'Default view icon.'));
|
export const defaultViewIcon = registerIcon('default-view-icon', Codicon.window, localize('defaultViewIcon', 'Default view icon.'));
|
||||||
|
|
||||||
|
@ -64,8 +63,27 @@ export interface IViewContainerDescriptor {
|
||||||
/**
|
/**
|
||||||
* The title of the view container
|
* The title of the view container
|
||||||
*/
|
*/
|
||||||
readonly title: ILocalizedString & { mnemonic?: string };
|
readonly title: string;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The mnemonic title of the view container.
|
||||||
|
* If provided, container entry is also shown in Menubar > Views.
|
||||||
|
*/
|
||||||
|
readonly mnemonicTitle?: string;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Icon representation of the View container
|
||||||
|
*/
|
||||||
|
readonly icon?: ThemeIcon | URI;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Order of the view container.
|
||||||
|
*/
|
||||||
|
readonly order?: number;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* IViewPaneContainer Ctor to instantiate
|
||||||
|
*/
|
||||||
readonly ctorDescriptor: SyncDescriptor<IViewPaneContainer>;
|
readonly ctorDescriptor: SyncDescriptor<IViewPaneContainer>;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -74,26 +92,33 @@ export interface IViewContainerDescriptor {
|
||||||
readonly keybindings?: IKeybindings & { when?: ContextKeyExpression };
|
readonly keybindings?: IKeybindings & { when?: ContextKeyExpression };
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The command id to open the view container
|
* The command id to register to open the view container.
|
||||||
|
* If not provided, id of the view container is used.
|
||||||
*/
|
*/
|
||||||
readonly commandId?: string;
|
readonly commandId?: string;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Storage id to use to store the view container state.
|
||||||
|
* If not provided, it will be derived.
|
||||||
|
*/
|
||||||
readonly storageId?: string;
|
readonly storageId?: string;
|
||||||
|
|
||||||
readonly icon?: ThemeIcon | URI;
|
/**
|
||||||
|
* If enabled, view container is not shown if it has no active views.
|
||||||
|
*/
|
||||||
|
readonly hideIfEmpty?: boolean;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Id of the extension that contributed the view container
|
||||||
|
*/
|
||||||
|
readonly extensionId?: ExtensionIdentifier;
|
||||||
|
|
||||||
readonly alwaysUseContainerInfo?: boolean;
|
readonly alwaysUseContainerInfo?: boolean;
|
||||||
|
|
||||||
readonly viewOrderDelegate?: ViewOrderDelegate;
|
readonly viewOrderDelegate?: ViewOrderDelegate;
|
||||||
|
|
||||||
readonly hideIfEmpty?: boolean;
|
|
||||||
|
|
||||||
readonly extensionId?: ExtensionIdentifier;
|
|
||||||
|
|
||||||
readonly rejectAddedViews?: boolean;
|
readonly rejectAddedViews?: boolean;
|
||||||
|
|
||||||
readonly order?: number;
|
|
||||||
|
|
||||||
requestedIndex?: number;
|
requestedIndex?: number;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -346,7 +346,7 @@ const refactorPreviewViewIcon = registerIcon('refactor-preview-view-icon', Codic
|
||||||
|
|
||||||
const container = Registry.as<IViewContainersRegistry>(ViewContainerExtensions.ViewContainersRegistry).registerViewContainer({
|
const container = Registry.as<IViewContainersRegistry>(ViewContainerExtensions.ViewContainersRegistry).registerViewContainer({
|
||||||
id: BulkEditPane.ID,
|
id: BulkEditPane.ID,
|
||||||
title: { value: localize('panel', "Refactor Preview"), original: 'Refactor Preview' },
|
title: localize('panel', "Refactor Preview"),
|
||||||
hideIfEmpty: true,
|
hideIfEmpty: true,
|
||||||
ctorDescriptor: new SyncDescriptor(
|
ctorDescriptor: new SyncDescriptor(
|
||||||
ViewPaneContainer,
|
ViewPaneContainer,
|
||||||
|
|
|
@ -329,10 +329,8 @@ function registerDebugPanel(): void {
|
||||||
|
|
||||||
const VIEW_CONTAINER: ViewContainer = Registry.as<IViewContainersRegistry>(ViewExtensions.ViewContainersRegistry).registerViewContainer({
|
const VIEW_CONTAINER: ViewContainer = Registry.as<IViewContainersRegistry>(ViewExtensions.ViewContainersRegistry).registerViewContainer({
|
||||||
id: DEBUG_PANEL_ID,
|
id: DEBUG_PANEL_ID,
|
||||||
title: {
|
title: nls.localize({ comment: ['Debug is a noun in this context, not a verb.'], key: 'debugPanel' }, 'Debug Console'),
|
||||||
value: nls.localize({ comment: ['Debug is a noun in this context, not a verb.'], key: 'debugPanel' }, 'Debug Console'), original: 'Debug Console',
|
mnemonicTitle: nls.localize({ key: 'miToggleDebugConsole', comment: ['&& denotes a mnemonic'] }, "De&&bug Console"),
|
||||||
mnemonic: nls.localize({ key: 'miToggleDebugConsole', comment: ['&& denotes a mnemonic'] }, "De&&bug Console")
|
|
||||||
},
|
|
||||||
keybindings: { primary: KeyMod.CtrlCmd | KeyMod.Shift | KeyCode.KEY_Y },
|
keybindings: { primary: KeyMod.CtrlCmd | KeyMod.Shift | KeyCode.KEY_Y },
|
||||||
commandId: 'workbench.debug.action.toggleRepl',
|
commandId: 'workbench.debug.action.toggleRepl',
|
||||||
icon: icons.debugConsoleViewIcon,
|
icon: icons.debugConsoleViewIcon,
|
||||||
|
@ -357,10 +355,8 @@ function registerDebugPanel(): void {
|
||||||
function registerDebugView(): void {
|
function registerDebugView(): void {
|
||||||
const viewContainer = Registry.as<IViewContainersRegistry>(ViewExtensions.ViewContainersRegistry).registerViewContainer({
|
const viewContainer = Registry.as<IViewContainersRegistry>(ViewExtensions.ViewContainersRegistry).registerViewContainer({
|
||||||
id: VIEWLET_ID,
|
id: VIEWLET_ID,
|
||||||
title: {
|
title: nls.localize('run and debug', "Run and Debug"),
|
||||||
value: nls.localize('run and debug', "Run and Debug"), original: 'Run and Debug',
|
mnemonicTitle: nls.localize({ key: 'miViewRun', comment: ['&& denotes a mnemonic'] }, "&&Run"),
|
||||||
mnemonic: nls.localize({ key: 'miViewRun', comment: ['&& denotes a mnemonic'] }, "&&Run"),
|
|
||||||
},
|
|
||||||
keybindings: { primary: KeyMod.CtrlCmd | KeyMod.Shift | KeyCode.KEY_D },
|
keybindings: { primary: KeyMod.CtrlCmd | KeyMod.Shift | KeyCode.KEY_D },
|
||||||
ctorDescriptor: new SyncDescriptor(DebugViewPaneContainer),
|
ctorDescriptor: new SyncDescriptor(DebugViewPaneContainer),
|
||||||
icon: icons.runViewIcon,
|
icon: icons.runViewIcon,
|
||||||
|
|
|
@ -100,10 +100,8 @@ Registry.as<IEditorRegistry>(EditorExtensions.Editors).registerEditor(
|
||||||
Registry.as<IViewContainersRegistry>(ViewContainerExtensions.ViewContainersRegistry).registerViewContainer(
|
Registry.as<IViewContainersRegistry>(ViewContainerExtensions.ViewContainersRegistry).registerViewContainer(
|
||||||
{
|
{
|
||||||
id: VIEWLET_ID,
|
id: VIEWLET_ID,
|
||||||
title: {
|
title: localize('extensions', "Extensions"),
|
||||||
value: localize('extensions', "Extensions"), original: 'Extensions',
|
mnemonicTitle: localize({ key: 'miViewExtensions', comment: ['&& denotes a mnemonic'] }, "E&&xtensions"),
|
||||||
mnemonic: localize({ key: 'miViewExtensions', comment: ['&& denotes a mnemonic'] }, "E&&xtensions"),
|
|
||||||
},
|
|
||||||
keybindings: { primary: KeyMod.CtrlCmd | KeyMod.Shift | KeyCode.KEY_X },
|
keybindings: { primary: KeyMod.CtrlCmd | KeyMod.Shift | KeyCode.KEY_X },
|
||||||
ctorDescriptor: new SyncDescriptor(ExtensionsViewPaneContainer),
|
ctorDescriptor: new SyncDescriptor(ExtensionsViewPaneContainer),
|
||||||
icon: extensionsViewIcon,
|
icon: extensionsViewIcon,
|
||||||
|
|
|
@ -270,10 +270,8 @@ const viewContainerRegistry = Registry.as<IViewContainersRegistry>(Extensions.Vi
|
||||||
*/
|
*/
|
||||||
export const VIEW_CONTAINER: ViewContainer = viewContainerRegistry.registerViewContainer({
|
export const VIEW_CONTAINER: ViewContainer = viewContainerRegistry.registerViewContainer({
|
||||||
id: VIEWLET_ID,
|
id: VIEWLET_ID,
|
||||||
title: {
|
title: localize('explore', "Explorer"),
|
||||||
value: localize('explore', "Explorer"), original: 'Explorer',
|
mnemonicTitle: localize({ key: 'miViewExplorer', comment: ['&& denotes a mnemonic'] }, "&&Explorer"),
|
||||||
mnemonic: localize({ key: 'miViewExplorer', comment: ['&& denotes a mnemonic'] }, "&&Explorer")
|
|
||||||
},
|
|
||||||
keybindings: { primary: KeyMod.CtrlCmd | KeyMod.Shift | KeyCode.KEY_E },
|
keybindings: { primary: KeyMod.CtrlCmd | KeyMod.Shift | KeyCode.KEY_E },
|
||||||
ctorDescriptor: new SyncDescriptor(ExplorerViewPaneContainer),
|
ctorDescriptor: new SyncDescriptor(ExplorerViewPaneContainer),
|
||||||
storageId: 'workbench.explorer.views.state',
|
storageId: 'workbench.explorer.views.state',
|
||||||
|
|
|
@ -109,10 +109,8 @@ const markersViewIcon = registerIcon('markers-view-icon', Codicon.warning, local
|
||||||
// markers view container
|
// markers view container
|
||||||
const VIEW_CONTAINER: ViewContainer = Registry.as<IViewContainersRegistry>(ViewContainerExtensions.ViewContainersRegistry).registerViewContainer({
|
const VIEW_CONTAINER: ViewContainer = Registry.as<IViewContainersRegistry>(ViewContainerExtensions.ViewContainersRegistry).registerViewContainer({
|
||||||
id: Constants.MARKERS_CONTAINER_ID,
|
id: Constants.MARKERS_CONTAINER_ID,
|
||||||
title: {
|
title: Messages.MARKERS_PANEL_TITLE_PROBLEMS,
|
||||||
value: Messages.MARKERS_PANEL_TITLE_PROBLEMS, original: 'Problems',
|
mnemonicTitle: localize({ key: 'miMarker', comment: ['&& denotes a mnemonic'] }, "&&Problems"),
|
||||||
mnemonic: localize({ key: 'miMarker', comment: ['&& denotes a mnemonic'] }, "&&Problems")
|
|
||||||
},
|
|
||||||
keybindings: { primary: KeyMod.CtrlCmd | KeyMod.Shift | KeyCode.KEY_M },
|
keybindings: { primary: KeyMod.CtrlCmd | KeyMod.Shift | KeyCode.KEY_M },
|
||||||
commandId: 'workbench.actions.view.problems',
|
commandId: 'workbench.actions.view.problems',
|
||||||
icon: markersViewIcon,
|
icon: markersViewIcon,
|
||||||
|
|
|
@ -54,10 +54,8 @@ ModesRegistry.registerLanguage({
|
||||||
const outputViewIcon = registerIcon('output-view-icon', Codicon.output, nls.localize('outputViewIcon', 'View icon of the output view.'));
|
const outputViewIcon = registerIcon('output-view-icon', Codicon.output, nls.localize('outputViewIcon', 'View icon of the output view.'));
|
||||||
const VIEW_CONTAINER: ViewContainer = Registry.as<IViewContainersRegistry>(ViewContainerExtensions.ViewContainersRegistry).registerViewContainer({
|
const VIEW_CONTAINER: ViewContainer = Registry.as<IViewContainersRegistry>(ViewContainerExtensions.ViewContainersRegistry).registerViewContainer({
|
||||||
id: OUTPUT_VIEW_ID,
|
id: OUTPUT_VIEW_ID,
|
||||||
title: {
|
title: nls.localize('output', "Output"),
|
||||||
value: nls.localize('output', "Output"), original: 'Output',
|
mnemonicTitle: nls.localize({ key: 'miToggleOutput', comment: ['&& denotes a mnemonic'] }, "&&Output"),
|
||||||
mnemonic: nls.localize({ key: 'miToggleOutput', comment: ['&& denotes a mnemonic'] }, "&&Output")
|
|
||||||
},
|
|
||||||
keybindings: {
|
keybindings: {
|
||||||
primary: KeyMod.CtrlCmd | KeyMod.Shift | KeyCode.KEY_U,
|
primary: KeyMod.CtrlCmd | KeyMod.Shift | KeyCode.KEY_U,
|
||||||
linux: {
|
linux: {
|
||||||
|
|
|
@ -543,7 +543,7 @@ registerAction2(SwitchRemoteAction);
|
||||||
Registry.as<IViewContainersRegistry>(Extensions.ViewContainersRegistry).registerViewContainer(
|
Registry.as<IViewContainersRegistry>(Extensions.ViewContainersRegistry).registerViewContainer(
|
||||||
{
|
{
|
||||||
id: VIEWLET_ID,
|
id: VIEWLET_ID,
|
||||||
title: { value: nls.localize('remote.explorer', "Remote Explorer"), original: 'Remote Explorer' },
|
title: nls.localize('remote.explorer', "Remote Explorer"),
|
||||||
ctorDescriptor: new SyncDescriptor(RemoteViewPaneContainer),
|
ctorDescriptor: new SyncDescriptor(RemoteViewPaneContainer),
|
||||||
hideIfEmpty: true,
|
hideIfEmpty: true,
|
||||||
viewOrderDelegate: {
|
viewOrderDelegate: {
|
||||||
|
|
|
@ -68,7 +68,7 @@ export class ForwardedPortsView extends Disposable implements IWorkbenchContribu
|
||||||
if (await this.usePanelTreatment()) {
|
if (await this.usePanelTreatment()) {
|
||||||
return Registry.as<IViewContainersRegistry>(Extensions.ViewContainersRegistry).registerViewContainer({
|
return Registry.as<IViewContainersRegistry>(Extensions.ViewContainersRegistry).registerViewContainer({
|
||||||
id: TunnelPanel.ID,
|
id: TunnelPanel.ID,
|
||||||
title: { value: nls.localize('ports', "Ports"), original: 'Ports' },
|
title: nls.localize('ports', "Ports"),
|
||||||
icon: portsViewIcon,
|
icon: portsViewIcon,
|
||||||
ctorDescriptor: new SyncDescriptor(ViewPaneContainer, [TunnelPanel.ID, { mergeViewWithContainerWhenSingleView: true, donotShowContainerTitleWhenMergedWithContainer: true }]),
|
ctorDescriptor: new SyncDescriptor(ViewPaneContainer, [TunnelPanel.ID, { mergeViewWithContainerWhenSingleView: true, donotShowContainerTitleWhenMergedWithContainer: true }]),
|
||||||
storageId: TunnelPanel.ID,
|
storageId: TunnelPanel.ID,
|
||||||
|
|
|
@ -43,10 +43,8 @@ const sourceControlViewIcon = registerIcon('source-control-view-icon', Codicon.s
|
||||||
|
|
||||||
const viewContainer = Registry.as<IViewContainersRegistry>(ViewContainerExtensions.ViewContainersRegistry).registerViewContainer({
|
const viewContainer = Registry.as<IViewContainersRegistry>(ViewContainerExtensions.ViewContainersRegistry).registerViewContainer({
|
||||||
id: VIEWLET_ID,
|
id: VIEWLET_ID,
|
||||||
title: {
|
title: localize('source control', "Source Control"),
|
||||||
value: localize('source control', "Source Control"), original: 'Source Control',
|
mnemonicTitle: localize({ key: 'miViewSCM', comment: ['&& denotes a mnemonic'] }, "S&&CM"),
|
||||||
mnemonic: localize({ key: 'miViewSCM', comment: ['&& denotes a mnemonic'] }, "S&&CM")
|
|
||||||
},
|
|
||||||
keybindings: {
|
keybindings: {
|
||||||
primary: 0,
|
primary: 0,
|
||||||
win: { primary: KeyMod.CtrlCmd | KeyMod.Shift | KeyCode.KEY_G },
|
win: { primary: KeyMod.CtrlCmd | KeyMod.Shift | KeyCode.KEY_G },
|
||||||
|
|
|
@ -618,10 +618,8 @@ const SEARCH_MODE_CONFIG = 'search.mode';
|
||||||
|
|
||||||
const viewContainer = Registry.as<IViewContainersRegistry>(ViewExtensions.ViewContainersRegistry).registerViewContainer({
|
const viewContainer = Registry.as<IViewContainersRegistry>(ViewExtensions.ViewContainersRegistry).registerViewContainer({
|
||||||
id: VIEWLET_ID,
|
id: VIEWLET_ID,
|
||||||
title: {
|
title: nls.localize('name', "Search"),
|
||||||
value: nls.localize('name', "Search"), original: 'Search',
|
mnemonicTitle: nls.localize({ key: 'miViewSearch', comment: ['&& denotes a mnemonic'] }, "&&Search"),
|
||||||
mnemonic: nls.localize({ key: 'miViewSearch', comment: ['&& denotes a mnemonic'] }, "&&Search")
|
|
||||||
},
|
|
||||||
keybindings: {
|
keybindings: {
|
||||||
primary: KeyMod.CtrlCmd | KeyMod.Shift | KeyCode.KEY_F,
|
primary: KeyMod.CtrlCmd | KeyMod.Shift | KeyCode.KEY_F,
|
||||||
// View: Show Search is used for the keybindings in the View menu and the sidebar #115556, but it should only be enabled when search.mode == view, or else it will steal priority over opening a search editor #115511
|
// View: Show Search is used for the keybindings in the View menu and the sidebar #115556, but it should only be enabled when search.mode == view, or else it will steal priority over opening a search editor #115511
|
||||||
|
|
|
@ -63,10 +63,8 @@ configurationRegistry.registerConfiguration(terminalConfiguration);
|
||||||
// Register views
|
// Register views
|
||||||
const VIEW_CONTAINER = Registry.as<IViewContainersRegistry>(ViewContainerExtensions.ViewContainersRegistry).registerViewContainer({
|
const VIEW_CONTAINER = Registry.as<IViewContainersRegistry>(ViewContainerExtensions.ViewContainersRegistry).registerViewContainer({
|
||||||
id: TERMINAL_VIEW_ID,
|
id: TERMINAL_VIEW_ID,
|
||||||
title: {
|
title: nls.localize('terminal', "Terminal"),
|
||||||
value: nls.localize('terminal', "Terminal"), original: 'Terminal',
|
mnemonicTitle: nls.localize({ key: 'miToggleIntegratedTerminal', comment: ['&& denotes a mnemonic'] }, "&&Terminal"),
|
||||||
mnemonic: nls.localize({ key: 'miToggleIntegratedTerminal', comment: ['&& denotes a mnemonic'] }, "&&Terminal")
|
|
||||||
},
|
|
||||||
keybindings: {
|
keybindings: {
|
||||||
primary: KeyMod.CtrlCmd | KeyCode.US_BACKTICK,
|
primary: KeyMod.CtrlCmd | KeyCode.US_BACKTICK,
|
||||||
mac: { primary: KeyMod.WinCtrl | KeyCode.US_BACKTICK }
|
mac: { primary: KeyMod.WinCtrl | KeyCode.US_BACKTICK }
|
||||||
|
|
|
@ -38,7 +38,7 @@ registerSingleton(IWorkspaceTestCollectionService, WorkspaceTestCollectionServic
|
||||||
|
|
||||||
const viewContainer = Registry.as<IViewContainersRegistry>(ViewContainerExtensions.ViewContainersRegistry).registerViewContainer({
|
const viewContainer = Registry.as<IViewContainersRegistry>(ViewContainerExtensions.ViewContainersRegistry).registerViewContainer({
|
||||||
id: Testing.ViewletId,
|
id: Testing.ViewletId,
|
||||||
title: { value: localize('test', "Test"), original: 'Test' },
|
title: localize('test', "Test"),
|
||||||
ctorDescriptor: new SyncDescriptor(TestingViewPaneContainer),
|
ctorDescriptor: new SyncDescriptor(TestingViewPaneContainer),
|
||||||
icon: testingViewIcon,
|
icon: testingViewIcon,
|
||||||
alwaysUseContainerInfo: true,
|
alwaysUseContainerInfo: true,
|
||||||
|
|
|
@ -1136,7 +1136,7 @@ export class UserDataSyncWorkbenchContribution extends Disposable implements IWo
|
||||||
return Registry.as<IViewContainersRegistry>(Extensions.ViewContainersRegistry).registerViewContainer(
|
return Registry.as<IViewContainersRegistry>(Extensions.ViewContainersRegistry).registerViewContainer(
|
||||||
{
|
{
|
||||||
id: SYNC_VIEW_CONTAINER_ID,
|
id: SYNC_VIEW_CONTAINER_ID,
|
||||||
title: { value: SYNC_TITLE, original: 'Settings Sync' },
|
title: SYNC_TITLE,
|
||||||
ctorDescriptor: new SyncDescriptor(
|
ctorDescriptor: new SyncDescriptor(
|
||||||
ViewPaneContainer,
|
ViewPaneContainer,
|
||||||
[SYNC_VIEW_CONTAINER_ID, { mergeViewWithContainerWhenSingleView: true }]
|
[SYNC_VIEW_CONTAINER_ID, { mergeViewWithContainerWhenSingleView: true }]
|
||||||
|
|
|
@ -463,7 +463,7 @@ export class ViewDescriptorService extends Disposable implements IViewDescriptor
|
||||||
const container = this.viewContainersRegistry.registerViewContainer({
|
const container = this.viewContainersRegistry.registerViewContainer({
|
||||||
id,
|
id,
|
||||||
ctorDescriptor: new SyncDescriptor(ViewPaneContainer, [id, { mergeViewWithContainerWhenSingleView: true, donotShowContainerTitleWhenMergedWithContainer: true }]),
|
ctorDescriptor: new SyncDescriptor(ViewPaneContainer, [id, { mergeViewWithContainerWhenSingleView: true, donotShowContainerTitleWhenMergedWithContainer: true }]),
|
||||||
title: { value: 'Custom Views', original: 'Custom Views' }, // we don't want to see this, so no need to localize
|
title: 'Custom Views', // we don't want to see this, so no need to localize
|
||||||
icon: location === ViewContainerLocation.Sidebar ? defaultViewIcon : undefined,
|
icon: location === ViewContainerLocation.Sidebar ? defaultViewIcon : undefined,
|
||||||
storageId: getViewContainerStorageId(id),
|
storageId: getViewContainerStorageId(id),
|
||||||
hideIfEmpty: true
|
hideIfEmpty: true
|
||||||
|
|
|
@ -341,7 +341,7 @@ export class ViewContainerModel extends Disposable implements IViewContainerMode
|
||||||
private updateContainerInfo(): void {
|
private updateContainerInfo(): void {
|
||||||
/* Use default container info if one of the visible view descriptors belongs to the current container by default */
|
/* Use default container info if one of the visible view descriptors belongs to the current container by default */
|
||||||
const useDefaultContainerInfo = this.viewContainer.alwaysUseContainerInfo || this.visibleViewDescriptors.length === 0 || this.visibleViewDescriptors.some(v => Registry.as<IViewsRegistry>(ViewExtensions.ViewsRegistry).getViewContainer(v.id) === this.viewContainer);
|
const useDefaultContainerInfo = this.viewContainer.alwaysUseContainerInfo || this.visibleViewDescriptors.length === 0 || this.visibleViewDescriptors.some(v => Registry.as<IViewsRegistry>(ViewExtensions.ViewsRegistry).getViewContainer(v.id) === this.viewContainer);
|
||||||
const title = useDefaultContainerInfo ? this.viewContainer.title.value : this.visibleViewDescriptors[0]?.containerTitle || this.visibleViewDescriptors[0]?.name || '';
|
const title = useDefaultContainerInfo ? this.viewContainer.title : this.visibleViewDescriptors[0]?.containerTitle || this.visibleViewDescriptors[0]?.name || '';
|
||||||
let titleChanged: boolean = false;
|
let titleChanged: boolean = false;
|
||||||
if (this._title !== title) {
|
if (this._title !== title) {
|
||||||
this._title = title;
|
this._title = title;
|
||||||
|
|
|
@ -61,13 +61,13 @@ suite('ViewContainerModel', () => {
|
||||||
});
|
});
|
||||||
|
|
||||||
test('empty model', function () {
|
test('empty model', function () {
|
||||||
container = ViewContainerRegistry.registerViewContainer({ id: 'test', title: { value: 'test', original: 'test' }, ctorDescriptor: new SyncDescriptor(<any>{}) }, ViewContainerLocation.Sidebar);
|
container = ViewContainerRegistry.registerViewContainer({ id: 'test', title: 'test', ctorDescriptor: new SyncDescriptor(<any>{}) }, ViewContainerLocation.Sidebar);
|
||||||
const testObject = viewDescriptorService.getViewContainerModel(container);
|
const testObject = viewDescriptorService.getViewContainerModel(container);
|
||||||
assert.equal(testObject.visibleViewDescriptors.length, 0);
|
assert.equal(testObject.visibleViewDescriptors.length, 0);
|
||||||
});
|
});
|
||||||
|
|
||||||
test('register/unregister', () => {
|
test('register/unregister', () => {
|
||||||
container = ViewContainerRegistry.registerViewContainer({ id: 'test', title: { value: 'test', original: 'test' }, ctorDescriptor: new SyncDescriptor(<any>{}) }, ViewContainerLocation.Sidebar);
|
container = ViewContainerRegistry.registerViewContainer({ id: 'test', title: 'test', ctorDescriptor: new SyncDescriptor(<any>{}) }, ViewContainerLocation.Sidebar);
|
||||||
const testObject = viewDescriptorService.getViewContainerModel(container);
|
const testObject = viewDescriptorService.getViewContainerModel(container);
|
||||||
const target = disposableStore.add(new ViewDescriptorSequence(testObject));
|
const target = disposableStore.add(new ViewDescriptorSequence(testObject));
|
||||||
|
|
||||||
|
@ -94,7 +94,7 @@ suite('ViewContainerModel', () => {
|
||||||
});
|
});
|
||||||
|
|
||||||
test('when contexts', async function () {
|
test('when contexts', async function () {
|
||||||
container = ViewContainerRegistry.registerViewContainer({ id: 'test', title: { value: 'test', original: 'test' }, ctorDescriptor: new SyncDescriptor(<any>{}) }, ViewContainerLocation.Sidebar);
|
container = ViewContainerRegistry.registerViewContainer({ id: 'test', title: 'test', ctorDescriptor: new SyncDescriptor(<any>{}) }, ViewContainerLocation.Sidebar);
|
||||||
const testObject = viewDescriptorService.getViewContainerModel(container);
|
const testObject = viewDescriptorService.getViewContainerModel(container);
|
||||||
const target = disposableStore.add(new ViewDescriptorSequence(testObject));
|
const target = disposableStore.add(new ViewDescriptorSequence(testObject));
|
||||||
assert.equal(testObject.visibleViewDescriptors.length, 0);
|
assert.equal(testObject.visibleViewDescriptors.length, 0);
|
||||||
|
@ -138,7 +138,7 @@ suite('ViewContainerModel', () => {
|
||||||
});
|
});
|
||||||
|
|
||||||
test('when contexts - multiple', async function () {
|
test('when contexts - multiple', async function () {
|
||||||
container = ViewContainerRegistry.registerViewContainer({ id: 'test', title: { value: 'test', original: 'test' }, ctorDescriptor: new SyncDescriptor(<any>{}) }, ViewContainerLocation.Sidebar);
|
container = ViewContainerRegistry.registerViewContainer({ id: 'test', title: 'test', ctorDescriptor: new SyncDescriptor(<any>{}) }, ViewContainerLocation.Sidebar);
|
||||||
const testObject = viewDescriptorService.getViewContainerModel(container);
|
const testObject = viewDescriptorService.getViewContainerModel(container);
|
||||||
const target = disposableStore.add(new ViewDescriptorSequence(testObject));
|
const target = disposableStore.add(new ViewDescriptorSequence(testObject));
|
||||||
const view1: IViewDescriptor = { id: 'view1', ctorDescriptor: null!, name: 'Test View 1' };
|
const view1: IViewDescriptor = { id: 'view1', ctorDescriptor: null!, name: 'Test View 1' };
|
||||||
|
@ -161,7 +161,7 @@ suite('ViewContainerModel', () => {
|
||||||
});
|
});
|
||||||
|
|
||||||
test('when contexts - multiple 2', async function () {
|
test('when contexts - multiple 2', async function () {
|
||||||
container = ViewContainerRegistry.registerViewContainer({ id: 'test', title: { value: 'test', original: 'test' }, ctorDescriptor: new SyncDescriptor(<any>{}) }, ViewContainerLocation.Sidebar);
|
container = ViewContainerRegistry.registerViewContainer({ id: 'test', title: 'test', ctorDescriptor: new SyncDescriptor(<any>{}) }, ViewContainerLocation.Sidebar);
|
||||||
const testObject = viewDescriptorService.getViewContainerModel(container);
|
const testObject = viewDescriptorService.getViewContainerModel(container);
|
||||||
const target = disposableStore.add(new ViewDescriptorSequence(testObject));
|
const target = disposableStore.add(new ViewDescriptorSequence(testObject));
|
||||||
const view1: IViewDescriptor = { id: 'view1', ctorDescriptor: null!, name: 'Test View 1', when: ContextKeyExpr.equals('showview1', true) };
|
const view1: IViewDescriptor = { id: 'view1', ctorDescriptor: null!, name: 'Test View 1', when: ContextKeyExpr.equals('showview1', true) };
|
||||||
|
@ -184,7 +184,7 @@ suite('ViewContainerModel', () => {
|
||||||
});
|
});
|
||||||
|
|
||||||
test('setVisible', () => {
|
test('setVisible', () => {
|
||||||
container = ViewContainerRegistry.registerViewContainer({ id: 'test', title: { value: 'test', original: 'test' }, ctorDescriptor: new SyncDescriptor(<any>{}) }, ViewContainerLocation.Sidebar);
|
container = ViewContainerRegistry.registerViewContainer({ id: 'test', title: 'test', ctorDescriptor: new SyncDescriptor(<any>{}) }, ViewContainerLocation.Sidebar);
|
||||||
const testObject = viewDescriptorService.getViewContainerModel(container);
|
const testObject = viewDescriptorService.getViewContainerModel(container);
|
||||||
const target = disposableStore.add(new ViewDescriptorSequence(testObject));
|
const target = disposableStore.add(new ViewDescriptorSequence(testObject));
|
||||||
const view1: IViewDescriptor = { id: 'view1', ctorDescriptor: null!, name: 'Test View 1', canToggleVisibility: true };
|
const view1: IViewDescriptor = { id: 'view1', ctorDescriptor: null!, name: 'Test View 1', canToggleVisibility: true };
|
||||||
|
@ -229,7 +229,7 @@ suite('ViewContainerModel', () => {
|
||||||
});
|
});
|
||||||
|
|
||||||
test('move', () => {
|
test('move', () => {
|
||||||
container = ViewContainerRegistry.registerViewContainer({ id: 'test', title: { value: 'test', original: 'test' }, ctorDescriptor: new SyncDescriptor(<any>{}) }, ViewContainerLocation.Sidebar);
|
container = ViewContainerRegistry.registerViewContainer({ id: 'test', title: 'test', ctorDescriptor: new SyncDescriptor(<any>{}) }, ViewContainerLocation.Sidebar);
|
||||||
const testObject = viewDescriptorService.getViewContainerModel(container);
|
const testObject = viewDescriptorService.getViewContainerModel(container);
|
||||||
const target = disposableStore.add(new ViewDescriptorSequence(testObject));
|
const target = disposableStore.add(new ViewDescriptorSequence(testObject));
|
||||||
const view1: IViewDescriptor = { id: 'view1', ctorDescriptor: null!, name: 'Test View 1' };
|
const view1: IViewDescriptor = { id: 'view1', ctorDescriptor: null!, name: 'Test View 1' };
|
||||||
|
@ -259,7 +259,7 @@ suite('ViewContainerModel', () => {
|
||||||
|
|
||||||
test('view states', async function () {
|
test('view states', async function () {
|
||||||
storageService.store(`${container.id}.state.hidden`, JSON.stringify([{ id: 'view1', isHidden: true }]), StorageScope.GLOBAL, StorageTarget.MACHINE);
|
storageService.store(`${container.id}.state.hidden`, JSON.stringify([{ id: 'view1', isHidden: true }]), StorageScope.GLOBAL, StorageTarget.MACHINE);
|
||||||
container = ViewContainerRegistry.registerViewContainer({ id: 'test', title: { value: 'test', original: 'test' }, ctorDescriptor: new SyncDescriptor(<any>{}) }, ViewContainerLocation.Sidebar);
|
container = ViewContainerRegistry.registerViewContainer({ id: 'test', title: 'test', ctorDescriptor: new SyncDescriptor(<any>{}) }, ViewContainerLocation.Sidebar);
|
||||||
const testObject = viewDescriptorService.getViewContainerModel(container);
|
const testObject = viewDescriptorService.getViewContainerModel(container);
|
||||||
const target = disposableStore.add(new ViewDescriptorSequence(testObject));
|
const target = disposableStore.add(new ViewDescriptorSequence(testObject));
|
||||||
|
|
||||||
|
@ -279,7 +279,7 @@ suite('ViewContainerModel', () => {
|
||||||
|
|
||||||
test('view states and when contexts', async function () {
|
test('view states and when contexts', async function () {
|
||||||
storageService.store(`${container.id}.state.hidden`, JSON.stringify([{ id: 'view1', isHidden: true }]), StorageScope.GLOBAL, StorageTarget.MACHINE);
|
storageService.store(`${container.id}.state.hidden`, JSON.stringify([{ id: 'view1', isHidden: true }]), StorageScope.GLOBAL, StorageTarget.MACHINE);
|
||||||
container = ViewContainerRegistry.registerViewContainer({ id: 'test', title: { value: 'test', original: 'test' }, ctorDescriptor: new SyncDescriptor(<any>{}) }, ViewContainerLocation.Sidebar);
|
container = ViewContainerRegistry.registerViewContainer({ id: 'test', title: 'test', ctorDescriptor: new SyncDescriptor(<any>{}) }, ViewContainerLocation.Sidebar);
|
||||||
const testObject = viewDescriptorService.getViewContainerModel(container);
|
const testObject = viewDescriptorService.getViewContainerModel(container);
|
||||||
const target = disposableStore.add(new ViewDescriptorSequence(testObject));
|
const target = disposableStore.add(new ViewDescriptorSequence(testObject));
|
||||||
|
|
||||||
|
@ -309,7 +309,7 @@ suite('ViewContainerModel', () => {
|
||||||
|
|
||||||
test('view states and when contexts multiple views', async function () {
|
test('view states and when contexts multiple views', async function () {
|
||||||
storageService.store(`${container.id}.state.hidden`, JSON.stringify([{ id: 'view1', isHidden: true }]), StorageScope.GLOBAL, StorageTarget.MACHINE);
|
storageService.store(`${container.id}.state.hidden`, JSON.stringify([{ id: 'view1', isHidden: true }]), StorageScope.GLOBAL, StorageTarget.MACHINE);
|
||||||
container = ViewContainerRegistry.registerViewContainer({ id: 'test', title: { value: 'test', original: 'test' }, ctorDescriptor: new SyncDescriptor(<any>{}) }, ViewContainerLocation.Sidebar);
|
container = ViewContainerRegistry.registerViewContainer({ id: 'test', title: 'test', ctorDescriptor: new SyncDescriptor(<any>{}) }, ViewContainerLocation.Sidebar);
|
||||||
const testObject = viewDescriptorService.getViewContainerModel(container);
|
const testObject = viewDescriptorService.getViewContainerModel(container);
|
||||||
const target = disposableStore.add(new ViewDescriptorSequence(testObject));
|
const target = disposableStore.add(new ViewDescriptorSequence(testObject));
|
||||||
|
|
||||||
|
@ -354,7 +354,7 @@ suite('ViewContainerModel', () => {
|
||||||
});
|
});
|
||||||
|
|
||||||
test('remove event is not triggered if view was hidden and removed', async function () {
|
test('remove event is not triggered if view was hidden and removed', async function () {
|
||||||
container = ViewContainerRegistry.registerViewContainer({ id: 'test', title: { value: 'test', original: 'test' }, ctorDescriptor: new SyncDescriptor(<any>{}) }, ViewContainerLocation.Sidebar);
|
container = ViewContainerRegistry.registerViewContainer({ id: 'test', title: 'test', ctorDescriptor: new SyncDescriptor(<any>{}) }, ViewContainerLocation.Sidebar);
|
||||||
const testObject = viewDescriptorService.getViewContainerModel(container);
|
const testObject = viewDescriptorService.getViewContainerModel(container);
|
||||||
const target = disposableStore.add(new ViewDescriptorSequence(testObject));
|
const target = disposableStore.add(new ViewDescriptorSequence(testObject));
|
||||||
const viewDescriptor: IViewDescriptor = {
|
const viewDescriptor: IViewDescriptor = {
|
||||||
|
@ -383,7 +383,7 @@ suite('ViewContainerModel', () => {
|
||||||
});
|
});
|
||||||
|
|
||||||
test('add event is not triggered if view was set visible (when visible) and not active', async function () {
|
test('add event is not triggered if view was set visible (when visible) and not active', async function () {
|
||||||
container = ViewContainerRegistry.registerViewContainer({ id: 'test', title: { value: 'test', original: 'test' }, ctorDescriptor: new SyncDescriptor(<any>{}) }, ViewContainerLocation.Sidebar);
|
container = ViewContainerRegistry.registerViewContainer({ id: 'test', title: 'test', ctorDescriptor: new SyncDescriptor(<any>{}) }, ViewContainerLocation.Sidebar);
|
||||||
const testObject = viewDescriptorService.getViewContainerModel(container);
|
const testObject = viewDescriptorService.getViewContainerModel(container);
|
||||||
const target = disposableStore.add(new ViewDescriptorSequence(testObject));
|
const target = disposableStore.add(new ViewDescriptorSequence(testObject));
|
||||||
const viewDescriptor: IViewDescriptor = {
|
const viewDescriptor: IViewDescriptor = {
|
||||||
|
@ -409,7 +409,7 @@ suite('ViewContainerModel', () => {
|
||||||
});
|
});
|
||||||
|
|
||||||
test('remove event is not triggered if view was hidden and not active', async function () {
|
test('remove event is not triggered if view was hidden and not active', async function () {
|
||||||
container = ViewContainerRegistry.registerViewContainer({ id: 'test', title: { value: 'test', original: 'test' }, ctorDescriptor: new SyncDescriptor(<any>{}) }, ViewContainerLocation.Sidebar);
|
container = ViewContainerRegistry.registerViewContainer({ id: 'test', title: 'test', ctorDescriptor: new SyncDescriptor(<any>{}) }, ViewContainerLocation.Sidebar);
|
||||||
const testObject = viewDescriptorService.getViewContainerModel(container);
|
const testObject = viewDescriptorService.getViewContainerModel(container);
|
||||||
const target = disposableStore.add(new ViewDescriptorSequence(testObject));
|
const target = disposableStore.add(new ViewDescriptorSequence(testObject));
|
||||||
const viewDescriptor: IViewDescriptor = {
|
const viewDescriptor: IViewDescriptor = {
|
||||||
|
@ -435,7 +435,7 @@ suite('ViewContainerModel', () => {
|
||||||
});
|
});
|
||||||
|
|
||||||
test('add event is not triggered if view was set visible (when not visible) and not active', async function () {
|
test('add event is not triggered if view was set visible (when not visible) and not active', async function () {
|
||||||
container = ViewContainerRegistry.registerViewContainer({ id: 'test', title: { value: 'test', original: 'test' }, ctorDescriptor: new SyncDescriptor(<any>{}) }, ViewContainerLocation.Sidebar);
|
container = ViewContainerRegistry.registerViewContainer({ id: 'test', title: 'test', ctorDescriptor: new SyncDescriptor(<any>{}) }, ViewContainerLocation.Sidebar);
|
||||||
const testObject = viewDescriptorService.getViewContainerModel(container);
|
const testObject = viewDescriptorService.getViewContainerModel(container);
|
||||||
const target = disposableStore.add(new ViewDescriptorSequence(testObject));
|
const target = disposableStore.add(new ViewDescriptorSequence(testObject));
|
||||||
const viewDescriptor: IViewDescriptor = {
|
const viewDescriptor: IViewDescriptor = {
|
||||||
|
@ -465,7 +465,7 @@ suite('ViewContainerModel', () => {
|
||||||
});
|
});
|
||||||
|
|
||||||
test('added view descriptors are in ascending order in the event', async function () {
|
test('added view descriptors are in ascending order in the event', async function () {
|
||||||
container = ViewContainerRegistry.registerViewContainer({ id: 'test', title: { value: 'test', original: 'test' }, ctorDescriptor: new SyncDescriptor(<any>{}) }, ViewContainerLocation.Sidebar);
|
container = ViewContainerRegistry.registerViewContainer({ id: 'test', title: 'test', ctorDescriptor: new SyncDescriptor(<any>{}) }, ViewContainerLocation.Sidebar);
|
||||||
const testObject = viewDescriptorService.getViewContainerModel(container);
|
const testObject = viewDescriptorService.getViewContainerModel(container);
|
||||||
const target = disposableStore.add(new ViewDescriptorSequence(testObject));
|
const target = disposableStore.add(new ViewDescriptorSequence(testObject));
|
||||||
|
|
||||||
|
|
|
@ -15,8 +15,8 @@ import { ContextKeyService } from 'vs/platform/contextkey/browser/contextKeyServ
|
||||||
import { IContextKeyService } from 'vs/platform/contextkey/common/contextkey';
|
import { IContextKeyService } from 'vs/platform/contextkey/common/contextkey';
|
||||||
|
|
||||||
const ViewsRegistry = Registry.as<IViewsRegistry>(ViewContainerExtensions.ViewsRegistry);
|
const ViewsRegistry = Registry.as<IViewsRegistry>(ViewContainerExtensions.ViewsRegistry);
|
||||||
const sidebarContainer = Registry.as<IViewContainersRegistry>(ViewContainerExtensions.ViewContainersRegistry).registerViewContainer({ id: 'testSidebar', title: { value: 'test', original: 'test' }, ctorDescriptor: new SyncDescriptor(<any>{}) }, ViewContainerLocation.Sidebar);
|
const sidebarContainer = Registry.as<IViewContainersRegistry>(ViewContainerExtensions.ViewContainersRegistry).registerViewContainer({ id: 'testSidebar', title: 'test', ctorDescriptor: new SyncDescriptor(<any>{}) }, ViewContainerLocation.Sidebar);
|
||||||
const panelContainer = Registry.as<IViewContainersRegistry>(ViewContainerExtensions.ViewContainersRegistry).registerViewContainer({ id: 'testPanel', title: { value: 'test', original: 'test' }, ctorDescriptor: new SyncDescriptor(<any>{}) }, ViewContainerLocation.Panel);
|
const panelContainer = Registry.as<IViewContainersRegistry>(ViewContainerExtensions.ViewContainersRegistry).registerViewContainer({ id: 'testPanel', title: 'test', ctorDescriptor: new SyncDescriptor(<any>{}) }, ViewContainerLocation.Panel);
|
||||||
|
|
||||||
suite('ViewDescriptorService', () => {
|
suite('ViewDescriptorService', () => {
|
||||||
|
|
||||||
|
|
|
@ -48,7 +48,7 @@ suite('MainThreadHostTreeView', function () {
|
||||||
const instantiationService: TestInstantiationService = <TestInstantiationService>workbenchInstantiationService();
|
const instantiationService: TestInstantiationService = <TestInstantiationService>workbenchInstantiationService();
|
||||||
const viewDescriptorService = instantiationService.createInstance(ViewDescriptorService);
|
const viewDescriptorService = instantiationService.createInstance(ViewDescriptorService);
|
||||||
instantiationService.stub(IViewDescriptorService, viewDescriptorService);
|
instantiationService.stub(IViewDescriptorService, viewDescriptorService);
|
||||||
container = Registry.as<IViewContainersRegistry>(Extensions.ViewContainersRegistry).registerViewContainer({ id: 'testContainer', title: { value: 'test', original: 'test' }, ctorDescriptor: new SyncDescriptor(<any>{}) }, ViewContainerLocation.Sidebar);
|
container = Registry.as<IViewContainersRegistry>(Extensions.ViewContainersRegistry).registerViewContainer({ id: 'testContainer', title: 'test', ctorDescriptor: new SyncDescriptor(<any>{}) }, ViewContainerLocation.Sidebar);
|
||||||
const viewDescriptor: ITreeViewDescriptor = {
|
const viewDescriptor: ITreeViewDescriptor = {
|
||||||
id: testTreeViewId,
|
id: testTreeViewId,
|
||||||
ctorDescriptor: null!,
|
ctorDescriptor: null!,
|
||||||
|
|
Loading…
Reference in a new issue