Merge from vscode 8e0f348413f4f616c23a88ae30030efa85811973 (#6381)

* Merge from vscode 8e0f348413f4f616c23a88ae30030efa85811973

* disable strict null check
This commit is contained in:
Anthony Dresser
2019-07-15 22:35:46 -07:00
committed by GitHub
parent f720ec642f
commit 0b7e7ddbf9
2406 changed files with 59140 additions and 35464 deletions

View File

@@ -24,7 +24,7 @@ export class ActionBarContributor {
/**
* Returns an array of primary actions in the given context.
*/
getActions(context: unknown): IAction[] {
getActions(context: unknown): ReadonlyArray<IAction> {
return [];
}
}
@@ -66,7 +66,7 @@ export class ContributableActionProvider implements IActionProvider {
return false;
}
getActions(tree: ITree, element: unknown): IAction[] {
getActions(tree: ITree, element: unknown): ReadonlyArray<IAction> {
const actions: IAction[] = [];
const context = this.toContext(tree, element);
@@ -155,7 +155,7 @@ export interface IActionBarRegistry {
class ActionBarRegistry implements IActionBarRegistry {
private readonly actionBarContributorConstructors: { scope: string; ctor: IConstructorSignature0<ActionBarContributor>; }[] = [];
private readonly actionBarContributorInstances: { [scope: string]: ActionBarContributor[] } = Object.create(null);
private readonly actionBarContributorInstances: Map<string, ActionBarContributor[]> = new Map();
private instantiationService: IInstantiationService;
start(accessor: ServicesAccessor): void {
@@ -169,15 +169,16 @@ class ActionBarRegistry implements IActionBarRegistry {
private createActionBarContributor(scope: string, ctor: IConstructorSignature0<ActionBarContributor>): void {
const instance = this.instantiationService.createInstance(ctor);
let target = this.actionBarContributorInstances[scope];
let target = this.actionBarContributorInstances.get(scope);
if (!target) {
target = this.actionBarContributorInstances[scope] = [];
target = [];
this.actionBarContributorInstances.set(scope, target);
}
target.push(instance);
}
private getContributors(scope: string): ActionBarContributor[] {
return this.actionBarContributorInstances[scope] || [];
return this.actionBarContributorInstances.get(scope) || [];
}
registerActionBarContributor(scope: string, ctor: IConstructorSignature0<ActionBarContributor>): void {

View File

@@ -0,0 +1,222 @@
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the Source EULA. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
import { Action } from 'vs/base/common/actions';
import { IWindowService } from 'vs/platform/windows/common/windows';
import * as nls from 'vs/nls';
import { IKeybindingService } from 'vs/platform/keybinding/common/keybinding';
import { domEvent } from 'vs/base/browser/event';
import { Event } from 'vs/base/common/event';
import { IDisposable, toDisposable, dispose, Disposable, DisposableStore } from 'vs/base/common/lifecycle';
import { getDomNodePagePosition, createStyleSheet, createCSSRule, append, $ } from 'vs/base/browser/dom';
import { IContextKeyService } from 'vs/platform/contextkey/common/contextkey';
import { Context } from 'vs/platform/contextkey/browser/contextKeyService';
import { StandardKeyboardEvent } from 'vs/base/browser/keyboardEvent';
import { timeout } from 'vs/base/common/async';
import { IWorkbenchLayoutService } from 'vs/workbench/services/layout/browser/layoutService';
import { Registry } from 'vs/platform/registry/common/platform';
import { SyncActionDescriptor } from 'vs/platform/actions/common/actions';
import { IWorkbenchActionRegistry, Extensions } from 'vs/workbench/common/actions';
import { IStorageService } from 'vs/platform/storage/common/storage';
export class InspectContextKeysAction extends Action {
static readonly ID = 'workbench.action.inspectContextKeys';
static LABEL = nls.localize('inspect context keys', "Inspect Context Keys");
constructor(
id: string,
label: string,
@IContextKeyService private readonly contextKeyService: IContextKeyService,
@IWindowService private readonly windowService: IWindowService,
) {
super(id, label);
}
run(): Promise<void> {
const disposables = new DisposableStore();
const stylesheet = createStyleSheet();
disposables.add(toDisposable(() => {
if (stylesheet.parentNode) {
stylesheet.parentNode.removeChild(stylesheet);
}
}));
createCSSRule('*', 'cursor: crosshair !important;', stylesheet);
const hoverFeedback = document.createElement('div');
document.body.appendChild(hoverFeedback);
disposables.add(toDisposable(() => document.body.removeChild(hoverFeedback)));
hoverFeedback.style.position = 'absolute';
hoverFeedback.style.pointerEvents = 'none';
hoverFeedback.style.backgroundColor = 'rgba(255, 0, 0, 0.5)';
hoverFeedback.style.zIndex = '1000';
const onMouseMove = domEvent(document.body, 'mousemove', true);
disposables.add(onMouseMove(e => {
const target = e.target as HTMLElement;
const position = getDomNodePagePosition(target);
hoverFeedback.style.top = `${position.top}px`;
hoverFeedback.style.left = `${position.left}px`;
hoverFeedback.style.width = `${position.width}px`;
hoverFeedback.style.height = `${position.height}px`;
}));
const onMouseDown = Event.once(domEvent(document.body, 'mousedown', true));
onMouseDown(e => { e.preventDefault(); e.stopPropagation(); }, null, disposables);
const onMouseUp = Event.once(domEvent(document.body, 'mouseup', true));
onMouseUp(e => {
e.preventDefault();
e.stopPropagation();
const context = this.contextKeyService.getContext(e.target as HTMLElement) as Context;
console.log(context.collectAllValues());
this.windowService.openDevTools();
dispose(disposables);
}, null, disposables);
return Promise.resolve();
}
}
export class ToggleScreencastModeAction extends Action {
static readonly ID = 'workbench.action.toggleScreencastMode';
static LABEL = nls.localize('toggle screencast mode', "Toggle Screencast Mode");
static disposable: IDisposable | undefined;
constructor(
id: string,
label: string,
@IKeybindingService private readonly keybindingService: IKeybindingService,
@IWorkbenchLayoutService private readonly layoutService: IWorkbenchLayoutService
) {
super(id, label);
}
async run(): Promise<void> {
if (ToggleScreencastModeAction.disposable) {
ToggleScreencastModeAction.disposable.dispose();
ToggleScreencastModeAction.disposable = undefined;
return;
}
const container = this.layoutService.getWorkbenchElement();
const mouseMarker = append(container, $('div'));
mouseMarker.style.position = 'absolute';
mouseMarker.style.border = '2px solid red';
mouseMarker.style.borderRadius = '20px';
mouseMarker.style.width = '20px';
mouseMarker.style.height = '20px';
mouseMarker.style.top = '0';
mouseMarker.style.left = '0';
mouseMarker.style.zIndex = '100000';
mouseMarker.style.content = ' ';
mouseMarker.style.pointerEvents = 'none';
mouseMarker.style.display = 'none';
const onMouseDown = domEvent(container, 'mousedown', true);
const onMouseUp = domEvent(container, 'mouseup', true);
const onMouseMove = domEvent(container, 'mousemove', true);
const mouseListener = onMouseDown(e => {
mouseMarker.style.top = `${e.clientY - 10}px`;
mouseMarker.style.left = `${e.clientX - 10}px`;
mouseMarker.style.display = 'block';
const mouseMoveListener = onMouseMove(e => {
mouseMarker.style.top = `${e.clientY - 10}px`;
mouseMarker.style.left = `${e.clientX - 10}px`;
});
Event.once(onMouseUp)(() => {
mouseMarker.style.display = 'none';
mouseMoveListener.dispose();
});
});
const keyboardMarker = append(container, $('div'));
keyboardMarker.style.position = 'absolute';
keyboardMarker.style.backgroundColor = 'rgba(0, 0, 0 ,0.5)';
keyboardMarker.style.width = '100%';
keyboardMarker.style.height = '100px';
keyboardMarker.style.bottom = '20%';
keyboardMarker.style.left = '0';
keyboardMarker.style.zIndex = '100000';
keyboardMarker.style.pointerEvents = 'none';
keyboardMarker.style.color = 'white';
keyboardMarker.style.lineHeight = '100px';
keyboardMarker.style.textAlign = 'center';
keyboardMarker.style.fontSize = '56px';
keyboardMarker.style.display = 'none';
const onKeyDown = domEvent(container, 'keydown', true);
let keyboardTimeout: IDisposable = Disposable.None;
const keyboardListener = onKeyDown(e => {
keyboardTimeout.dispose();
const event = new StandardKeyboardEvent(e);
const keybinding = this.keybindingService.resolveKeyboardEvent(event);
const label = keybinding.getLabel();
if (!event.ctrlKey && !event.altKey && !event.metaKey && !event.shiftKey && this.keybindingService.mightProducePrintableCharacter(event) && label) {
keyboardMarker.textContent += ' ' + label;
} else {
keyboardMarker.textContent = label;
}
keyboardMarker.style.display = 'block';
const promise = timeout(800);
keyboardTimeout = toDisposable(() => promise.cancel());
promise.then(() => {
keyboardMarker.textContent = '';
keyboardMarker.style.display = 'none';
});
});
ToggleScreencastModeAction.disposable = toDisposable(() => {
mouseListener.dispose();
keyboardListener.dispose();
mouseMarker.remove();
keyboardMarker.remove();
});
}
}
export class LogStorageAction extends Action {
static readonly ID = 'workbench.action.logStorage';
static LABEL = nls.localize({ key: 'logStorage', comment: ['A developer only action to log the contents of the storage for the current window.'] }, "Log Storage Database Contents");
constructor(
id: string,
label: string,
@IStorageService private readonly storageService: IStorageService,
@IWindowService private readonly windowService: IWindowService
) {
super(id, label);
}
run(): Promise<void> {
this.storageService.logStorage();
return this.windowService.openDevTools();
}
}
const developerCategory = nls.localize('developer', "Developer");
const registry = Registry.as<IWorkbenchActionRegistry>(Extensions.WorkbenchActions);
registry.registerWorkbenchAction(new SyncActionDescriptor(InspectContextKeysAction, InspectContextKeysAction.ID, InspectContextKeysAction.LABEL), 'Developer: Inspect Context Keys', developerCategory);
registry.registerWorkbenchAction(new SyncActionDescriptor(ToggleScreencastModeAction, ToggleScreencastModeAction.ID, ToggleScreencastModeAction.LABEL), 'Developer: Toggle Screencast Mode', developerCategory);
registry.registerWorkbenchAction(new SyncActionDescriptor(LogStorageAction, LogStorageAction.ID, LogStorageAction.LABEL), 'Developer: Log Storage Database Contents', developerCategory);

View File

@@ -16,13 +16,14 @@ import { CommandsRegistry } from 'vs/platform/commands/common/commands';
import { IEditorGroupsService, GroupOrientation } from 'vs/workbench/services/editor/common/editorGroupsService';
import { ServicesAccessor } from 'vs/platform/instantiation/common/instantiation';
import { KeyMod, KeyCode, KeyChord } from 'vs/base/common/keyCodes';
import { dispose, IDisposable } from 'vs/base/common/lifecycle';
import { DisposableStore } from 'vs/base/common/lifecycle';
import { MenuBarVisibility } from 'vs/platform/windows/common/windows';
import { isWindows, isLinux } from 'vs/base/common/platform';
import { IsMacContext } from 'vs/workbench/browser/contextkeys';
import { isWindows, isLinux, isWeb } from 'vs/base/common/platform';
import { IsMacNativeContext } from 'vs/workbench/browser/contextkeys';
import { KeybindingsRegistry, KeybindingWeight } from 'vs/platform/keybinding/common/keybindingsRegistry';
import { InEditorZenModeContext } from 'vs/workbench/common/editor';
import { InEditorZenModeContext, IsCenteredLayoutContext } from 'vs/workbench/common/editor';
import { ContextKeyExpr } from 'vs/platform/contextkey/common/contextkey';
import { SideBarVisibleContext } from 'vs/workbench/common/viewlet';
const registry = Registry.as<IWorkbenchActionRegistry>(Extensions.WorkbenchActions);
const viewCategory = nls.localize('view', "View");
@@ -61,7 +62,8 @@ MenuRegistry.appendMenuItem(MenuId.MenubarAppearanceMenu, {
group: '2_workbench_layout',
command: {
id: ToggleActivityBarVisibilityAction.ID,
title: nls.localize({ key: 'miToggleActivityBar', comment: ['&& denotes a mnemonic'] }, "Toggle &&Activity Bar")
title: nls.localize({ key: 'miShowActivityBar', comment: ['&& denotes a mnemonic'] }, "Show &&Activity Bar"),
toggled: ContextKeyExpr.equals('config.workbench.activityBar.visible', true)
},
order: 4
});
@@ -95,7 +97,8 @@ MenuRegistry.appendMenuItem(MenuId.MenubarAppearanceMenu, {
group: '1_toggle_view',
command: {
id: ToggleCenteredLayout.ID,
title: nls.localize('miToggleCenteredLayout', "Toggle Centered Layout")
title: nls.localize('miToggleCenteredLayout', "Centered Layout"),
toggled: IsCenteredLayoutContext
},
order: 3
});
@@ -107,7 +110,7 @@ export class ToggleEditorLayoutAction extends Action {
static readonly ID = 'workbench.action.toggleEditorGroupLayout';
static readonly LABEL = nls.localize('flipLayout', "Toggle Vertical/Horizontal Editor Layout");
private toDispose: IDisposable[];
private readonly toDispose = this._register(new DisposableStore());
constructor(
id: string,
@@ -116,8 +119,6 @@ export class ToggleEditorLayoutAction extends Action {
) {
super(id, label);
this.toDispose = [];
this.class = 'flip-editor-layout';
this.updateEnablement();
@@ -125,8 +126,8 @@ export class ToggleEditorLayoutAction extends Action {
}
private registerListeners(): void {
this.toDispose.push(this.editorGroupService.onDidAddGroup(() => this.updateEnablement()));
this.toDispose.push(this.editorGroupService.onDidRemoveGroup(() => this.updateEnablement()));
this.toDispose.add(this.editorGroupService.onDidAddGroup(() => this.updateEnablement()));
this.toDispose.add(this.editorGroupService.onDidRemoveGroup(() => this.updateEnablement()));
}
private updateEnablement(): void {
@@ -139,12 +140,6 @@ export class ToggleEditorLayoutAction extends Action {
return Promise.resolve();
}
dispose(): void {
this.toDispose = dispose(this.toDispose);
super.dispose();
}
}
CommandsRegistry.registerCommand('_workbench.editor.setGroupOrientation', function (accessor: ServicesAccessor, args: [GroupOrientation]) {
@@ -157,7 +152,7 @@ CommandsRegistry.registerCommand('_workbench.editor.setGroupOrientation', functi
});
const group = viewCategory;
registry.registerWorkbenchAction(new SyncActionDescriptor(ToggleEditorLayoutAction, ToggleEditorLayoutAction.ID, ToggleEditorLayoutAction.LABEL, { primary: KeyMod.Shift | KeyMod.Alt | KeyCode.KEY_0, mac: { primary: KeyMod.CtrlCmd | KeyMod.Alt | KeyCode.KEY_0 } }), 'View: Flip Editor Group Layout', group);
registry.registerWorkbenchAction(new SyncActionDescriptor(ToggleEditorLayoutAction, ToggleEditorLayoutAction.ID, ToggleEditorLayoutAction.LABEL, { primary: KeyMod.Shift | KeyMod.Alt | KeyCode.KEY_0, mac: { primary: KeyMod.CtrlCmd | KeyMod.Alt | KeyCode.KEY_0 } }), 'View: Toggle Vertical/Horizontal Editor Layout', group);
MenuRegistry.appendMenuItem(MenuId.MenubarLayoutMenu, {
group: 'z_flip',
@@ -203,11 +198,22 @@ export class ToggleSidebarPositionAction extends Action {
registry.registerWorkbenchAction(new SyncActionDescriptor(ToggleSidebarPositionAction, ToggleSidebarPositionAction.ID, ToggleSidebarPositionAction.LABEL), 'View: Toggle Side Bar Position', viewCategory);
MenuRegistry.appendMenuItem(MenuId.MenubarAppearanceMenu, {
group: '2_workbench_layout',
group: '3_workbench_layout_move',
command: {
id: ToggleSidebarPositionAction.ID,
title: nls.localize({ key: 'miMoveSidebarLeftRight', comment: ['&& denotes a mnemonic'] }, "&&Move Side Bar Left/Right")
title: nls.localize({ key: 'miMoveSidebarRight', comment: ['&& denotes a mnemonic'] }, "&&Move Side Bar Right")
},
when: ContextKeyExpr.notEquals('config.workbench.sideBar.location', 'right'),
order: 2
});
MenuRegistry.appendMenuItem(MenuId.MenubarAppearanceMenu, {
group: '3_workbench_layout_move',
command: {
id: ToggleSidebarPositionAction.ID,
title: nls.localize({ key: 'miMoveSidebarLeft', comment: ['&& denotes a mnemonic'] }, "&&Move Side Bar Left")
},
when: ContextKeyExpr.equals('config.workbench.sideBar.location', 'right'),
order: 2
});
@@ -262,18 +268,26 @@ export class ToggleSidebarVisibilityAction extends Action {
registry.registerWorkbenchAction(new SyncActionDescriptor(ToggleSidebarVisibilityAction, ToggleSidebarVisibilityAction.ID, ToggleSidebarVisibilityAction.LABEL, { primary: KeyMod.CtrlCmd | KeyCode.KEY_B }), 'View: Toggle Side Bar Visibility', viewCategory);
MenuRegistry.appendMenuItem(MenuId.MenubarViewMenu, {
group: '2_appearance',
title: nls.localize({ key: 'miAppearance', comment: ['&& denotes a mnemonic'] }, "&&Appearance"),
submenu: MenuId.MenubarAppearanceMenu,
order: 1
});
MenuRegistry.appendMenuItem(MenuId.MenubarAppearanceMenu, {
group: '2_workbench_layout',
command: {
id: ToggleSidebarVisibilityAction.ID,
title: nls.localize({ key: 'miToggleSidebar', comment: ['&& denotes a mnemonic'] }, "&&Toggle Side Bar")
title: nls.localize({ key: 'miShowSidebar', comment: ['&& denotes a mnemonic'] }, "Show &&Side Bar"),
toggled: SideBarVisibleContext
},
order: 1
});
// --- Toggle Statusbar Visibility
class ToggleStatusbarVisibilityAction extends Action {
export class ToggleStatusbarVisibilityAction extends Action {
static readonly ID = 'workbench.action.toggleStatusbarVisibility';
static readonly LABEL = nls.localize('toggleStatusbar', "Toggle Status Bar Visibility");
@@ -305,7 +319,8 @@ MenuRegistry.appendMenuItem(MenuId.MenubarAppearanceMenu, {
group: '2_workbench_layout',
command: {
id: ToggleStatusbarVisibilityAction.ID,
title: nls.localize({ key: 'miToggleStatusbar', comment: ['&& denotes a mnemonic'] }, "&&Toggle Status Bar")
title: nls.localize({ key: 'miShowStatusbar', comment: ['&& denotes a mnemonic'] }, "Show S&&tatus Bar"),
toggled: ContextKeyExpr.equals('config.workbench.statusBar.visible', true)
},
order: 3
});
@@ -370,7 +385,8 @@ MenuRegistry.appendMenuItem(MenuId.MenubarAppearanceMenu, {
group: '1_toggle_view',
command: {
id: ToggleZenMode.ID,
title: nls.localize('miToggleZenMode', "Toggle Zen Mode")
title: nls.localize('miToggleZenMode', "Zen Mode"),
toggled: InEditorZenModeContext
},
order: 2
});
@@ -422,18 +438,19 @@ export class ToggleMenuBarAction extends Action {
}
}
if (isWindows || isLinux) {
if (isWindows || isLinux || isWeb) {
registry.registerWorkbenchAction(new SyncActionDescriptor(ToggleMenuBarAction, ToggleMenuBarAction.ID, ToggleMenuBarAction.LABEL), 'View: Toggle Menu Bar', viewCategory);
}
MenuRegistry.appendMenuItem(MenuId.MenubarAppearanceMenu, {
group: '1_toggle_view',
group: '2_workbench_layout',
command: {
id: ToggleMenuBarAction.ID,
title: nls.localize({ key: 'miToggleMenuBar', comment: ['&& denotes a mnemonic'] }, "Toggle Menu &&Bar")
title: nls.localize({ key: 'miShowMenuBar', comment: ['&& denotes a mnemonic'] }, "Show Menu &&Bar"),
toggled: ContextKeyExpr.and(IsMacNativeContext.toNegated(), ContextKeyExpr.notEquals('config.window.menuBarVisibility', 'hidden'), ContextKeyExpr.notEquals('config.window.menuBarVisibility', 'toggle'))
},
when: IsMacContext.toNegated(),
order: 4
when: IsMacNativeContext.toNegated(),
order: 0
});
// --- Resize View

View File

@@ -603,7 +603,17 @@ KeybindingsRegistry.registerCommandAndKeybindingRule({
const focus = list.getFocus();
if (focus.length > 0) {
list.toggleCollapsed(focus[0]);
let toggleCollapsed = true;
if (list.expandOnlyOnTwistieClick === true) {
toggleCollapsed = false;
} else if (typeof list.expandOnlyOnTwistieClick !== 'boolean' && list.expandOnlyOnTwistieClick(focus[0])) {
toggleCollapsed = false;
}
if (toggleCollapsed) {
list.toggleCollapsed(focus[0]);
}
}
list.setSelection(focus, fakeKeyboardEvent);

View File

@@ -4,10 +4,22 @@
*--------------------------------------------------------------------------------------------*/
.vs .monaco-workbench .flip-editor-layout {
background-image: url('editor-layout.svg');
background-image: url('layout-light.svg');
}
.vs-dark .monaco-workbench .flip-editor-layout,
.hc-black .monaco-workbench .flip-editor-layout {
background-image: url('editor-layout-inverse.svg') !important;
.vs-dark .monaco-workbench .flip-editor-layout {
background-image: url('layout-dark.svg');
}
.hc-black .monaco-workbench .flip-editor-layout {
background-image: url('layout-hc.svg');
}
.vs .action-remove-from-recently-opened {
background: url("remove-light.svg") center center no-repeat;
}
.vs-dark .action-remove-from-recently-opened,
.hc-black .action-remove-from-recently-opened {
background: url("remove-dark.svg") center center no-repeat;
}

View File

@@ -1 +0,0 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16"><style>.icon-canvas-transparent{opacity:0;fill:#2d2d30}.icon-vs-out{fill:#2d2d30}.icon-vs-bg{fill:#c5c5c5}.icon-vs-fg{fill:#2b282e}</style><path class="icon-canvas-transparent" d="M16 16H0V0h16v16z" id="canvas"/><path class="icon-vs-out" d="M0 16V0h11v6h5v10H0z" id="outline" style="display: none;"/><path class="icon-vs-fg" d="M4 14H2V4h7v3H4v7zm10 0H5v-4h9v4z" id="iconFg" style="display: none;"/><path class="icon-vs-bg" d="M10 7V1H1v14h14V7h-5zm-6 7H2V4h7v3H4v7zm10 0H5v-4h9v4z" id="iconBg"/></svg>

Before

Width:  |  Height:  |  Size: 562 B

View File

@@ -1 +0,0 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16"><style>.icon-canvas-transparent{opacity:0;fill:#f6f6f6}.icon-vs-out{fill:#f6f6f6}.icon-vs-bg{fill:#424242}.icon-vs-fg{fill:#f0eff1}</style><path class="icon-canvas-transparent" d="M16 16H0V0h16v16z" id="canvas"/><path class="icon-vs-out" d="M0 16V0h11v6h5v10H0z" id="outline" style="display: none;"/><path class="icon-vs-fg" d="M4 14H2V4h7v3H4v7zm10 0H5v-4h9v4z" id="iconFg" style="display: none;"/><path class="icon-vs-bg" d="M10 7V1H1v14h14V7h-5zm-6 7H2V4h7v3H4v7zm10 0H5v-4h9v4z" id="iconBg"/></svg>

Before

Width:  |  Height:  |  Size: 562 B

View File

@@ -0,0 +1,3 @@
<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M15 6.49999L14.5302 5.99999H7V1.4698L6.5302 1H1.4698L1 1.4698V9.53019L1.4698 9.99999H4V14.5302L4.4698 15H14.5302L15 14.5302V6.49999ZM2 8.99999V3H6V8.99999H2ZM14 14H5V9.99999H6.5302L7 9.53019V8.01341H14V14Z" fill="#C5C5C5"/>
</svg>

After

Width:  |  Height:  |  Size: 336 B

View File

@@ -0,0 +1,3 @@
<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M15 6.49999L14.5302 5.99999H7V1.4698L6.5302 1H1.4698L1 1.4698V9.53019L1.4698 9.99999H4V14.5302L4.4698 15H14.5302L15 14.5302V6.49999ZM2 8.99999V3H6V8.99999H2ZM14 14H5V9.99999H6.5302L7 9.53019V8.01341H14V14Z" fill="white"/>
</svg>

After

Width:  |  Height:  |  Size: 334 B

View File

@@ -0,0 +1,3 @@
<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M15 6.49999L14.5302 5.99999H7V1.4698L6.5302 1H1.4698L1 1.4698V9.53019L1.4698 9.99999H4V14.5302L4.4698 15H14.5302L15 14.5302V6.49999ZM2 8.99999V3H6V8.99999H2ZM14 14H5V9.99999H6.5302L7 9.53019V8.01341H14V14Z" fill="#424242"/>
</svg>

After

Width:  |  Height:  |  Size: 336 B

View File

@@ -0,0 +1,3 @@
<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
<path fill-rule="evenodd" clip-rule="evenodd" d="M7.99998 8.70711L11.6464 12.3536L12.3535 11.6464L8.70708 8L12.3535 4.35355L11.6464 3.64645L7.99998 7.29289L4.35353 3.64645L3.64642 4.35355L7.29287 8L3.64642 11.6464L4.35353 12.3536L7.99998 8.70711Z" fill="#C5C5C5"/>
</svg>

After

Width:  |  Height:  |  Size: 368 B

View File

@@ -0,0 +1,3 @@
<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
<path fill-rule="evenodd" clip-rule="evenodd" d="M7.99998 8.70711L11.6464 12.3536L12.3535 11.6465L8.70708 8.00001L12.3535 4.35356L11.6464 3.64645L7.99998 7.2929L4.35353 3.64645L3.64642 4.35356L7.29287 8.00001L3.64642 11.6465L4.35353 12.3536L7.99998 8.70711Z" fill="#424242"/>
</svg>

After

Width:  |  Height:  |  Size: 379 B

View File

@@ -0,0 +1,300 @@
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* 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 { Action } from 'vs/base/common/actions';
import { IWindowService, IURIToOpen } from 'vs/platform/windows/common/windows';
import { SyncActionDescriptor, MenuRegistry, MenuId } from 'vs/platform/actions/common/actions';
import { Registry } from 'vs/platform/registry/common/platform';
import { KeyCode, KeyMod } from 'vs/base/common/keyCodes';
import { IsFullscreenContext, IsDevelopmentContext } from 'vs/workbench/browser/contextkeys';
import { IWorkbenchActionRegistry, Extensions } from 'vs/workbench/common/actions';
import { IWorkbenchLayoutService } from 'vs/workbench/services/layout/browser/layoutService';
import { KeybindingsRegistry, KeybindingWeight } from 'vs/platform/keybinding/common/keybindingsRegistry';
import { IQuickInputButton, IQuickInputService, IQuickPickSeparator } from 'vs/platform/quickinput/common/quickInput';
import { IWorkspaceContextService } from 'vs/platform/workspace/common/workspace';
import { ILabelService } from 'vs/platform/label/common/label';
import { IKeybindingService } from 'vs/platform/keybinding/common/keybinding';
import { IModelService } from 'vs/editor/common/services/modelService';
import { IModeService } from 'vs/editor/common/services/modeService';
import { IRecentWorkspace, IRecentFolder, IRecentFile, IRecent, isRecentFolder, isRecentWorkspace } from 'vs/platform/history/common/history';
import { URI } from 'vs/base/common/uri';
import { getIconClasses } from 'vs/editor/common/services/getIconClasses';
import { FileKind } from 'vs/platform/files/common/files';
import { splitName } from 'vs/base/common/labels';
import { IKeyMods } from 'vs/base/parts/quickopen/common/quickOpen';
import { isMacintosh } from 'vs/base/common/platform';
import { ContextKeyExpr } from 'vs/platform/contextkey/common/contextkey';
import { inQuickOpenContext, getQuickNavigateHandler } from 'vs/workbench/browser/parts/quickopen/quickopen';
export const inRecentFilesPickerContextKey = 'inRecentFilesPicker';
abstract class BaseOpenRecentAction extends Action {
private removeFromRecentlyOpened: IQuickInputButton = {
iconClass: 'action-remove-from-recently-opened',
tooltip: nls.localize('remove', "Remove from Recently Opened")
};
constructor(
id: string,
label: string,
private windowService: IWindowService,
private quickInputService: IQuickInputService,
private contextService: IWorkspaceContextService,
private labelService: ILabelService,
private keybindingService: IKeybindingService,
private modelService: IModelService,
private modeService: IModeService,
) {
super(id, label);
}
protected abstract isQuickNavigate(): boolean;
async run(): Promise<void> {
const { workspaces, files } = await this.windowService.getRecentlyOpened();
this.openRecent(workspaces, files);
}
private async openRecent(recentWorkspaces: Array<IRecentWorkspace | IRecentFolder>, recentFiles: IRecentFile[]): Promise<void> {
const toPick = (recent: IRecent, labelService: ILabelService, buttons: IQuickInputButton[] | undefined) => {
let uriToOpen: IURIToOpen | undefined;
let iconClasses: string[];
let fullLabel: string | undefined;
let resource: URI | undefined;
// Folder
if (isRecentFolder(recent)) {
resource = recent.folderUri;
iconClasses = getIconClasses(this.modelService, this.modeService, resource, FileKind.FOLDER);
uriToOpen = { folderUri: resource };
fullLabel = recent.label || labelService.getWorkspaceLabel(resource, { verbose: true });
}
// Workspace
else if (isRecentWorkspace(recent)) {
resource = recent.workspace.configPath;
iconClasses = getIconClasses(this.modelService, this.modeService, resource, FileKind.ROOT_FOLDER);
uriToOpen = { workspaceUri: resource };
fullLabel = recent.label || labelService.getWorkspaceLabel(recent.workspace, { verbose: true });
}
// File
else {
resource = recent.fileUri;
iconClasses = getIconClasses(this.modelService, this.modeService, resource, FileKind.FILE);
uriToOpen = { fileUri: resource };
fullLabel = recent.label || labelService.getUriLabel(resource);
}
const { name, parentPath } = splitName(fullLabel);
return {
iconClasses,
label: name,
description: parentPath,
buttons,
uriToOpen,
resource
};
};
const workspacePicks = recentWorkspaces.map(workspace => toPick(workspace, this.labelService, !this.isQuickNavigate() ? [this.removeFromRecentlyOpened] : undefined));
const filePicks = recentFiles.map(p => toPick(p, this.labelService, !this.isQuickNavigate() ? [this.removeFromRecentlyOpened] : undefined));
// focus second entry if the first recent workspace is the current workspace
const firstEntry = recentWorkspaces[0];
let autoFocusSecondEntry: boolean = firstEntry && this.contextService.isCurrentWorkspace(isRecentWorkspace(firstEntry) ? firstEntry.workspace : firstEntry.folderUri);
let keyMods: IKeyMods | undefined;
const workspaceSeparator: IQuickPickSeparator = { type: 'separator', label: nls.localize('workspaces', "workspaces") };
const fileSeparator: IQuickPickSeparator = { type: 'separator', label: nls.localize('files', "files") };
const picks = [workspaceSeparator, ...workspacePicks, fileSeparator, ...filePicks];
const pick = await this.quickInputService.pick(picks, {
contextKey: inRecentFilesPickerContextKey,
activeItem: [...workspacePicks, ...filePicks][autoFocusSecondEntry ? 1 : 0],
placeHolder: isMacintosh ? nls.localize('openRecentPlaceHolderMac', "Select to open (hold Cmd-key to open in new window)") : nls.localize('openRecentPlaceHolder', "Select to open (hold Ctrl-key to open in new window)"),
matchOnDescription: true,
onKeyMods: mods => keyMods = mods,
quickNavigate: this.isQuickNavigate() ? { keybindings: this.keybindingService.lookupKeybindings(this.id) } : undefined,
onDidTriggerItemButton: async context => {
await this.windowService.removeFromRecentlyOpened([context.item.resource]);
context.removeItem();
}
});
if (pick) {
return this.windowService.openWindow([pick.uriToOpen], { forceNewWindow: keyMods && keyMods.ctrlCmd });
}
}
}
export class OpenRecentAction extends BaseOpenRecentAction {
static readonly ID = 'workbench.action.openRecent';
static readonly LABEL = nls.localize('openRecent', "Open Recent...");
constructor(
id: string,
label: string,
@IWindowService windowService: IWindowService,
@IQuickInputService quickInputService: IQuickInputService,
@IWorkspaceContextService contextService: IWorkspaceContextService,
@IKeybindingService keybindingService: IKeybindingService,
@IModelService modelService: IModelService,
@IModeService modeService: IModeService,
@ILabelService labelService: ILabelService
) {
super(id, label, windowService, quickInputService, contextService, labelService, keybindingService, modelService, modeService);
}
protected isQuickNavigate(): boolean {
return false;
}
}
export class QuickOpenRecentAction extends BaseOpenRecentAction {
static readonly ID = 'workbench.action.quickOpenRecent';
static readonly LABEL = nls.localize('quickOpenRecent', "Quick Open Recent...");
constructor(
id: string,
label: string,
@IWindowService windowService: IWindowService,
@IQuickInputService quickInputService: IQuickInputService,
@IWorkspaceContextService contextService: IWorkspaceContextService,
@IKeybindingService keybindingService: IKeybindingService,
@IModelService modelService: IModelService,
@IModeService modeService: IModeService,
@ILabelService labelService: ILabelService
) {
super(id, label, windowService, quickInputService, contextService, labelService, keybindingService, modelService, modeService);
}
protected isQuickNavigate(): boolean {
return true;
}
}
export class ToggleFullScreenAction extends Action {
static readonly ID = 'workbench.action.toggleFullScreen';
static LABEL = nls.localize('toggleFullScreen', "Toggle Full Screen");
constructor(
id: string,
label: string,
@IWindowService private readonly windowService: IWindowService,
@IWorkbenchLayoutService private readonly layoutService: IWorkbenchLayoutService) {
super(id, label);
}
run(): Promise<void> {
const container = this.layoutService.getWorkbenchElement();
return this.windowService.toggleFullScreen(container);
}
}
export class ReloadWindowAction extends Action {
static readonly ID = 'workbench.action.reloadWindow';
static LABEL = nls.localize('reloadWindow', "Reload Window");
constructor(
id: string,
label: string,
@IWindowService private readonly windowService: IWindowService
) {
super(id, label);
}
async run(): Promise<boolean> {
await this.windowService.reloadWindow();
return true;
}
}
const registry = Registry.as<IWorkbenchActionRegistry>(Extensions.WorkbenchActions);
// --- Actions Registration
const fileCategory = nls.localize('file', "File");
registry.registerWorkbenchAction(new SyncActionDescriptor(QuickOpenRecentAction, QuickOpenRecentAction.ID, QuickOpenRecentAction.LABEL), 'File: Quick Open Recent...', fileCategory);
registry.registerWorkbenchAction(new SyncActionDescriptor(OpenRecentAction, OpenRecentAction.ID, OpenRecentAction.LABEL, { primary: KeyMod.CtrlCmd | KeyCode.KEY_R, mac: { primary: KeyMod.WinCtrl | KeyCode.KEY_R } }), 'File: Open Recent...', fileCategory);
const viewCategory = nls.localize('view', "View");
registry.registerWorkbenchAction(new SyncActionDescriptor(ToggleFullScreenAction, ToggleFullScreenAction.ID, ToggleFullScreenAction.LABEL, { primary: KeyCode.F11, mac: { primary: KeyMod.CtrlCmd | KeyMod.WinCtrl | KeyCode.KEY_F } }), 'View: Toggle Full Screen', viewCategory);
const developerCategory = nls.localize('developer', "Developer");
registry.registerWorkbenchAction(new SyncActionDescriptor(ReloadWindowAction, ReloadWindowAction.ID, ReloadWindowAction.LABEL), 'Developer: Reload Window', developerCategory);
// --- Commands/Keybindings Registration
const recentFilesPickerContext = ContextKeyExpr.and(inQuickOpenContext, ContextKeyExpr.has(inRecentFilesPickerContextKey));
const quickOpenNavigateNextInRecentFilesPickerId = 'workbench.action.quickOpenNavigateNextInRecentFilesPicker';
KeybindingsRegistry.registerCommandAndKeybindingRule({
id: quickOpenNavigateNextInRecentFilesPickerId,
weight: KeybindingWeight.WorkbenchContrib + 50,
handler: getQuickNavigateHandler(quickOpenNavigateNextInRecentFilesPickerId, true),
when: recentFilesPickerContext,
primary: KeyMod.CtrlCmd | KeyCode.KEY_R,
mac: { primary: KeyMod.WinCtrl | KeyCode.KEY_R }
});
const quickOpenNavigatePreviousInRecentFilesPicker = 'workbench.action.quickOpenNavigatePreviousInRecentFilesPicker';
KeybindingsRegistry.registerCommandAndKeybindingRule({
id: quickOpenNavigatePreviousInRecentFilesPicker,
weight: KeybindingWeight.WorkbenchContrib + 50,
handler: getQuickNavigateHandler(quickOpenNavigatePreviousInRecentFilesPicker, false),
when: recentFilesPickerContext,
primary: KeyMod.CtrlCmd | KeyMod.Shift | KeyCode.KEY_R,
mac: { primary: KeyMod.WinCtrl | KeyMod.Shift | KeyCode.KEY_R }
});
KeybindingsRegistry.registerKeybindingRule({
id: ReloadWindowAction.ID,
weight: KeybindingWeight.WorkbenchContrib + 50,
when: IsDevelopmentContext,
primary: KeyMod.CtrlCmd | KeyCode.KEY_R
});
// --- Menu Registration
MenuRegistry.appendMenuItem(MenuId.MenubarFileMenu, {
title: nls.localize({ key: 'miOpenRecent', comment: ['&& denotes a mnemonic'] }, "Open &&Recent"),
submenu: MenuId.MenubarRecentMenu,
group: '2_open',
order: 4
});
MenuRegistry.appendMenuItem(MenuId.MenubarRecentMenu, {
group: 'y_more',
command: {
id: OpenRecentAction.ID,
title: nls.localize({ key: 'miMore', comment: ['&& denotes a mnemonic'] }, "&&More...")
},
order: 1
});
MenuRegistry.appendMenuItem(MenuId.MenubarAppearanceMenu, {
group: '1_toggle_view',
command: {
id: ToggleFullScreenAction.ID,
title: nls.localize({ key: 'miToggleFullScreen', comment: ['&& denotes a mnemonic'] }, "&&Full Screen"),
toggled: IsFullscreenContext
},
order: 1
});

View File

@@ -11,12 +11,15 @@ import { IWorkspaceContextService, WorkbenchState, IWorkspaceFolder } from 'vs/p
import { IWorkspaceEditingService } from 'vs/workbench/services/workspace/common/workspaceEditing';
import { IWorkspacesService } from 'vs/platform/workspaces/common/workspaces';
import { IEditorService } from 'vs/workbench/services/editor/common/editorService';
import { ICommandService } from 'vs/platform/commands/common/commands';
import { ICommandService, ICommandHandler } from 'vs/platform/commands/common/commands';
import { ADD_ROOT_FOLDER_COMMAND_ID, ADD_ROOT_FOLDER_LABEL, PICK_WORKSPACE_FOLDER_COMMAND_ID } from 'vs/workbench/browser/actions/workspaceCommands';
import { IFileDialogService } from 'vs/platform/dialogs/common/dialogs';
import { INotificationService } from 'vs/platform/notification/common/notification';
import { Schemas } from 'vs/base/common/network';
import { IWorkbenchEnvironmentService } from 'vs/workbench/services/environment/common/environmentService';
import { ITextFileService, ISaveOptions } from 'vs/workbench/services/textfile/common/textfiles';
import { toResource } from 'vs/workbench/common/editor';
import { URI } from 'vs/base/common/uri';
export class OpenFileAction extends Action {
@@ -36,21 +39,33 @@ export class OpenFileAction extends Action {
}
}
export class OpenLocalFileAction extends Action {
export namespace OpenLocalFileCommand {
export const ID = 'workbench.action.files.openLocalFile';
export const LABEL = nls.localize('openLocalFile', "Open Local File...");
static readonly ID = 'workbench.action.files.openLocalFile';
static LABEL = nls.localize('openLocalFile', "Open Local File...");
constructor(
id: string,
label: string,
@IFileDialogService private readonly dialogService: IFileDialogService
) {
super(id, label);
export function handler(): ICommandHandler {
return accessor => {
const dialogService = accessor.get(IFileDialogService);
return dialogService.pickFileAndOpen({ forceNewWindow: false, availableFileSystems: [Schemas.file] });
};
}
}
run(event?: any, data?: ITelemetryData): Promise<any> {
return this.dialogService.pickFileAndOpen({ forceNewWindow: false, telemetryExtraData: data, availableFileSystems: [Schemas.file] });
export namespace SaveLocalFileCommand {
export const ID = 'workbench.action.files.saveLocalFile';
export const LABEL = nls.localize('saveLocalFile', "Save Local File...");
export function handler(): ICommandHandler {
return accessor => {
const textFileService = accessor.get(ITextFileService);
const editorService = accessor.get(IEditorService);
let resource: URI | undefined = toResource(editorService.activeEditor);
const options: ISaveOptions = { force: true, availableFileSystems: [Schemas.file] };
if (resource) {
return textFileService.saveAs(resource, undefined, options);
}
return Promise.resolve(undefined);
};
}
}
@@ -72,21 +87,15 @@ export class OpenFolderAction extends Action {
}
}
export class OpenLocalFolderAction extends Action {
export namespace OpenLocalFolderCommand {
export const ID = 'workbench.action.files.openLocalFolder';
export const LABEL = nls.localize('openLocalFolder', "Open Local Folder...");
static readonly ID = 'workbench.action.files.openLocalFolder';
static LABEL = nls.localize('openLocalFolder', "Open Local Folder...");
constructor(
id: string,
label: string,
@IFileDialogService private readonly dialogService: IFileDialogService
) {
super(id, label);
}
run(event?: any, data?: ITelemetryData): Promise<any> {
return this.dialogService.pickFolderAndOpen({ forceNewWindow: false, telemetryExtraData: data, availableFileSystems: [Schemas.file] });
export function handler(): ICommandHandler {
return accessor => {
const dialogService = accessor.get(IFileDialogService);
return dialogService.pickFolderAndOpen({ forceNewWindow: false, availableFileSystems: [Schemas.file] });
};
}
}
@@ -109,21 +118,16 @@ export class OpenFileFolderAction extends Action {
}
}
export class OpenLocalFileFolderAction extends Action {
export namespace OpenLocalFileFolderCommand {
static readonly ID = 'workbench.action.files.openLocalFileFolder';
static LABEL = nls.localize('openLocalFileFolder', "Open Local...");
export const ID = 'workbench.action.files.openLocalFileFolder';
export const LABEL = nls.localize('openLocalFileFolder', "Open Local...");
constructor(
id: string,
label: string,
@IFileDialogService private readonly dialogService: IFileDialogService
) {
super(id, label);
}
run(event?: any, data?: ITelemetryData): Promise<any> {
return this.dialogService.pickFileFolderAndOpen({ forceNewWindow: false, telemetryExtraData: data, availableFileSystems: [Schemas.file] });
export function handler(): ICommandHandler {
return accessor => {
const dialogService = accessor.get(IFileDialogService);
return dialogService.pickFileFolderAndOpen({ forceNewWindow: false, availableFileSystems: [Schemas.file] });
};
}
}

View File

@@ -30,10 +30,10 @@ import { Disposable } from 'vs/base/common/lifecycle';
export abstract class Composite extends Component implements IComposite {
private readonly _onTitleAreaUpdate: Emitter<void> = this._register(new Emitter<void>());
get onTitleAreaUpdate(): Event<void> { return this._onTitleAreaUpdate.event; }
readonly onTitleAreaUpdate: Event<void> = this._onTitleAreaUpdate.event;
private readonly _onDidChangeVisibility: Emitter<boolean> = this._register(new Emitter<boolean>());
get onDidChangeVisibility(): Event<boolean> { return this._onDidChangeVisibility.event; }
readonly onDidChangeVisibility: Event<boolean> = this._onDidChangeVisibility.event;
private _onDidFocus: Emitter<void>;
get onDidFocus(): Event<void> {
@@ -150,7 +150,7 @@ export abstract class Composite extends Component implements IComposite {
/**
* Returns an array of actions to show in the action bar of the composite.
*/
getActions(): IAction[] {
getActions(): ReadonlyArray<IAction> {
return [];
}
@@ -158,14 +158,14 @@ export abstract class Composite extends Component implements IComposite {
* Returns an array of actions to show in the action bar of the composite
* in a less prominent way then action from getActions.
*/
getSecondaryActions(): IAction[] {
getSecondaryActions(): ReadonlyArray<IAction> {
return [];
}
/**
* Returns an array of actions to show in the context menu of the composite
*/
getContextMenuActions(): IAction[] {
getContextMenuActions(): ReadonlyArray<IAction> {
return [];
}

View File

@@ -8,7 +8,7 @@ import { Disposable } from 'vs/base/common/lifecycle';
import { IContextKeyService, IContextKey, RawContextKey } from 'vs/platform/contextkey/common/contextkey';
import { InputFocusedContext } from 'vs/platform/contextkey/common/contextkeys';
import { IWindowsConfiguration } from 'vs/platform/windows/common/windows';
import { ActiveEditorContext, EditorsVisibleContext, TextCompareEditorVisibleContext, TextCompareEditorActiveContext, ActiveEditorGroupEmptyContext, MultipleEditorGroupsContext, TEXT_DIFF_EDITOR_ID, SplitEditorsVertically, InEditorZenModeContext } from 'vs/workbench/common/editor';
import { ActiveEditorContext, EditorsVisibleContext, TextCompareEditorVisibleContext, TextCompareEditorActiveContext, ActiveEditorGroupEmptyContext, MultipleEditorGroupsContext, TEXT_DIFF_EDITOR_ID, SplitEditorsVertically, InEditorZenModeContext, IsCenteredLayoutContext } from 'vs/workbench/common/editor';
import { trackFocus, addDisposableListener, EventType } from 'vs/base/browser/dom';
import { preferredSideBySideGroupDirection, GroupDirection, IEditorGroupsService } from 'vs/workbench/services/editor/common/editorGroupsService';
import { IConfigurationService } from 'vs/platform/configuration/common/configuration';
@@ -16,16 +16,22 @@ import { IWorkbenchEnvironmentService } from 'vs/workbench/services/environment/
import { IEditorService } from 'vs/workbench/services/editor/common/editorService';
import { WorkbenchState, IWorkspaceContextService } from 'vs/platform/workspace/common/workspace';
import { SideBarVisibleContext } from 'vs/workbench/common/viewlet';
import { IWorkbenchLayoutService, Parts } from 'vs/workbench/services/layout/browser/layoutService';
import { IWorkbenchLayoutService, Parts, Position } from 'vs/workbench/services/layout/browser/layoutService';
import { IViewletService } from 'vs/workbench/services/viewlet/browser/viewlet';
import { isMacintosh, isLinux, isWindows } from 'vs/base/common/platform';
import { isMacintosh, isLinux, isWindows, isWeb } from 'vs/base/common/platform';
import { PanelPositionContext } from 'vs/workbench/common/panel';
export const IsMacContext = new RawContextKey<boolean>('isMac', isMacintosh);
export const IsLinuxContext = new RawContextKey<boolean>('isLinux', isLinux);
export const IsWindowsContext = new RawContextKey<boolean>('isWindows', isWindows);
export const IsWebContext = new RawContextKey<boolean>('isWeb', isWeb);
export const IsMacNativeContext = new RawContextKey<boolean>('isMacNative', isMacintosh && !isWeb);
export const RemoteAuthorityContext = new RawContextKey<string>('remoteAuthority', '');
export const RemoteConnectionState = new RawContextKey<'' | 'initializing' | 'disconnected' | 'connected'>('remoteConnectionState', '');
export const HasMacNativeTabsContext = new RawContextKey<boolean>('hasMacNativeTabs', false);
export const SupportsWorkspacesContext = new RawContextKey<boolean>('supportsWorkspaces', true);
@@ -38,6 +44,8 @@ export const WorkspaceFolderCountContext = new RawContextKey<number>('workspaceF
export const RemoteFileDialogContext = new RawContextKey<boolean>('remoteFileDialogVisible', false);
export const IsFullscreenContext = new RawContextKey<boolean>('isFullscreen', false);
export class WorkbenchContextKeysHandler extends Disposable {
private inputFocusedContext: IContextKey<boolean>;
@@ -54,8 +62,10 @@ export class WorkbenchContextKeysHandler extends Disposable {
private inZenModeContext: IContextKey<boolean>;
private isFullscreenContext: IContextKey<boolean>;
private isCenteredLayoutContext: IContextKey<boolean>;
private sideBarVisibleContext: IContextKey<boolean>;
private panelPositionContext: IContextKey<string>;
constructor(
@IContextKeyService private contextKeyService: IContextKeyService,
@@ -93,6 +103,9 @@ export class WorkbenchContextKeysHandler extends Disposable {
}));
this._register(this.layoutService.onZenModeChange(enabled => this.inZenModeContext.set(enabled)));
this._register(this.layoutService.onFullscreenChange(fullscreen => this.isFullscreenContext.set(fullscreen)));
this._register(this.layoutService.onCenteredLayoutChange(centered => this.isCenteredLayoutContext.set(centered)));
this._register(this.layoutService.onPanelPositionChange(position => this.panelPositionContext.set(position)));
this._register(this.viewletService.onDidViewletClose(() => this.updateSideBarContextKeys()));
this._register(this.viewletService.onDidViewletOpen(() => this.updateSideBarContextKeys()));
@@ -105,6 +118,9 @@ export class WorkbenchContextKeysHandler extends Disposable {
IsLinuxContext.bindTo(this.contextKeyService);
IsWindowsContext.bindTo(this.contextKeyService);
IsWebContext.bindTo(this.contextKeyService);
IsMacNativeContext.bindTo(this.contextKeyService);
RemoteAuthorityContext.bindTo(this.contextKeyService).set(this.environmentService.configuration.remoteAuthority || '');
// macOS Native Tabs
@@ -140,11 +156,21 @@ export class WorkbenchContextKeysHandler extends Disposable {
this.splitEditorsVerticallyContext = SplitEditorsVertically.bindTo(this.contextKeyService);
this.updateSplitEditorsVerticallyContext();
// Fullscreen
this.isFullscreenContext = IsFullscreenContext.bindTo(this.contextKeyService);
// Zen Mode
this.inZenModeContext = InEditorZenModeContext.bindTo(this.contextKeyService);
// Centered Layout
this.isCenteredLayoutContext = IsCenteredLayoutContext.bindTo(this.contextKeyService);
// Sidebar
this.sideBarVisibleContext = SideBarVisibleContext.bindTo(this.contextKeyService);
// Panel Position
this.panelPositionContext = PanelPositionContext.bindTo(this.contextKeyService);
this.panelPositionContext.set(this.layoutService.getPanelPosition() === Position.RIGHT ? 'right' : 'bottom');
}
private updateEditorContextKeys(): void {

View File

@@ -7,7 +7,7 @@ import { hasWorkspaceFileExtension, IWorkspaceFolderCreationData } from 'vs/plat
import { normalize } from 'vs/base/common/path';
import { basename } from 'vs/base/common/resources';
import { IFileService } from 'vs/platform/files/common/files';
import { IWindowsService, IWindowService, IURIToOpen } from 'vs/platform/windows/common/windows';
import { IWindowService, IURIToOpen } from 'vs/platform/windows/common/windows';
import { URI } from 'vs/base/common/uri';
import { ITextFileService } from 'vs/workbench/services/textfile/common/textfiles';
import { IBackupFileService } from 'vs/workbench/services/backup/common/backup';
@@ -20,7 +20,7 @@ import { DataTransfers } from 'vs/base/browser/dnd';
import { DragMouseEvent } from 'vs/base/browser/mouseEvent';
import { normalizeDriveLetter } from 'vs/base/common/labels';
import { MIME_BINARY } from 'vs/base/common/mime';
import { isWindows } from 'vs/base/common/platform';
import { isWindows, isLinux } from 'vs/base/common/platform';
import { ServicesAccessor } from 'vs/platform/instantiation/common/instantiation';
import { isCodeEditor } from 'vs/editor/browser/editorBrowser';
import { IEditorIdentifier, GroupIdentifier } from 'vs/workbench/common/editor';
@@ -31,6 +31,7 @@ import { IEditorGroup } from 'vs/workbench/services/editor/common/editorGroupsSe
import { IRecentFile } from 'vs/platform/history/common/history';
import { IWorkspaceEditingService } from 'vs/workbench/services/workspace/common/workspaceEditing';
import { withNullAsUndefined } from 'vs/base/common/types';
import { IWorkbenchEnvironmentService } from 'vs/workbench/services/environment/common/environmentService';
export interface IDraggedResource {
resource: URI;
@@ -159,7 +160,6 @@ export class ResourcesDropHandler {
constructor(
private options: IResourcesDropHandlerOptions,
@IFileService private readonly fileService: IFileService,
@IWindowsService private readonly windowsService: IWindowsService,
@IWindowService private readonly windowService: IWindowService,
@ITextFileService private readonly textFileService: ITextFileService,
@IBackupFileService private readonly backupFileService: IBackupFileService,
@@ -189,7 +189,7 @@ export class ResourcesDropHandler {
// Add external ones to recently open list unless dropped resource is a workspace
const recents: IRecentFile[] = untitledOrFileResources.filter(d => d.isExternal && d.resource.scheme === Schemas.file).map(d => ({ fileUri: d.resource }));
if (recents.length) {
this.windowsService.addRecentlyOpened(recents);
this.windowService.addRecentlyOpened(recents);
}
const editors: IResourceEditor[] = untitledOrFileResources.map(untitledOrFileResource => ({
@@ -327,8 +327,10 @@ export function fillResourceDataTransfers(accessor: ServicesAccessor, resources:
const lineDelimiter = isWindows ? '\r\n' : '\n';
event.dataTransfer.setData(DataTransfers.TEXT, sources.map(source => source.resource.scheme === Schemas.file ? normalize(normalizeDriveLetter(source.resource.fsPath)) : source.resource.toString()).join(lineDelimiter));
// Download URL: enables support to drag a tab as file to desktop (only single file supported)
if (firstSource.resource.scheme === Schemas.file) {
const envService = accessor.get(IWorkbenchEnvironmentService);
if (!(isLinux && envService.configuration.remoteAuthority)) {
// Download URL: enables support to drag a tab as file to desktop (only single file supported)
// Not supported on linux remote due to chrome limitation https://github.com/microsoft/vscode-remote-release/issues/849
event.dataTransfer.setData(DataTransfers.DOWNLOAD_URL, [MIME_BINARY, basename(firstSource.resource), firstSource.resource.toString()].join(':'));
}

View File

@@ -8,7 +8,6 @@ import { SyncDescriptor } from 'vs/platform/instantiation/common/descriptors';
import { Registry } from 'vs/platform/registry/common/platform';
import { BaseEditor } from 'vs/workbench/browser/parts/editor/baseEditor';
import { IConstructorSignature0, IInstantiationService } from 'vs/platform/instantiation/common/instantiation';
import { isArray } from 'vs/base/common/types';
export interface IEditorDescriptor {
instantiate(instantiationService: IInstantiationService): BaseEditor;
@@ -27,26 +26,25 @@ export interface IEditorRegistry {
* input, the input itself will be asked which editor it prefers if this method is provided. Otherwise
* the first editor in the list will be returned.
*
* @param editorInputDescriptor a constructor function that returns an instance of EditorInput for which the
* @param inputDescriptors A set of constructor functions that return an instance of EditorInput for which the
* registered editor should be used for.
*/
registerEditor(descriptor: IEditorDescriptor, editorInputDescriptor: SyncDescriptor<EditorInput>): void;
registerEditor(descriptor: IEditorDescriptor, editorInputDescriptor: SyncDescriptor<EditorInput>[]): void;
registerEditor(descriptor: IEditorDescriptor, inputDescriptors: readonly SyncDescriptor<EditorInput>[]): void;
/**
* Returns the editor descriptor for the given input or null if none.
* Returns the editor descriptor for the given input or `undefined` if none.
*/
getEditor(input: EditorInput): IEditorDescriptor | null;
getEditor(input: EditorInput): IEditorDescriptor | undefined;
/**
* Returns the editor descriptor for the given identifier or null if none.
* Returns the editor descriptor for the given identifier or `undefined` if none.
*/
getEditorById(editorId: string): IEditorDescriptor | null;
getEditorById(editorId: string): IEditorDescriptor | undefined;
/**
* Returns an array of registered editors known to the platform.
*/
getEditors(): IEditorDescriptor[];
getEditors(): readonly IEditorDescriptor[];
}
/**
@@ -54,15 +52,12 @@ export interface IEditorRegistry {
* can load lazily in the workbench.
*/
export class EditorDescriptor implements IEditorDescriptor {
private ctor: IConstructorSignature0<BaseEditor>;
private id: string;
private name: string;
constructor(ctor: IConstructorSignature0<BaseEditor>, id: string, name: string) {
this.ctor = ctor;
this.id = id;
this.name = name;
}
constructor(
private readonly ctor: IConstructorSignature0<BaseEditor>,
private readonly id: string,
private readonly name: string
) { }
instantiate(instantiationService: IInstantiationService): BaseEditor {
return instantiationService.createInstance(this.ctor);
@@ -81,34 +76,24 @@ export class EditorDescriptor implements IEditorDescriptor {
}
}
const INPUT_DESCRIPTORS_PROPERTY = '__$inputDescriptors';
class EditorRegistry implements IEditorRegistry {
private editors: EditorDescriptor[] = [];
private readonly mapEditorToInputs = new Map<EditorDescriptor, readonly SyncDescriptor<EditorInput>[]>();
registerEditor(descriptor: EditorDescriptor, editorInputDescriptor: SyncDescriptor<EditorInput>): void;
registerEditor(descriptor: EditorDescriptor, editorInputDescriptor: SyncDescriptor<EditorInput>[]): void;
registerEditor(descriptor: EditorDescriptor, editorInputDescriptor: SyncDescriptor<EditorInput> | SyncDescriptor<EditorInput>[]): void {
// Support both non-array and array parameter
let inputDescriptors: SyncDescriptor<EditorInput>[] = [];
if (!isArray(editorInputDescriptor)) {
inputDescriptors.push(editorInputDescriptor);
} else {
inputDescriptors = editorInputDescriptor;
}
registerEditor(descriptor: EditorDescriptor, inputDescriptors: readonly SyncDescriptor<EditorInput>[]): void {
// Register (Support multiple Editors per Input)
descriptor[INPUT_DESCRIPTORS_PROPERTY] = inputDescriptors;
this.mapEditorToInputs.set(descriptor, inputDescriptors);
this.editors.push(descriptor);
}
getEditor(input: EditorInput): EditorDescriptor | null {
getEditor(input: EditorInput): EditorDescriptor | undefined {
const findEditorDescriptors = (input: EditorInput, byInstanceOf?: boolean): EditorDescriptor[] => {
const matchingDescriptors: EditorDescriptor[] = [];
for (const editor of this.editors) {
const inputDescriptors: SyncDescriptor<EditorInput>[] = editor[INPUT_DESCRIPTORS_PROPERTY];
const inputDescriptors = this.mapEditorToInputs.get(editor) || [];
for (const inputDescriptor of inputDescriptors) {
const inputClass = inputDescriptor.ctor;
@@ -139,7 +124,7 @@ class EditorRegistry implements IEditorRegistry {
};
const descriptors = findEditorDescriptors(input);
if (descriptors && descriptors.length > 0) {
if (descriptors.length > 0) {
// Ask the input for its preferred Editor
const preferredEditorId = input.getPreferredEditorId(descriptors.map(d => d.getId()));
@@ -151,20 +136,20 @@ class EditorRegistry implements IEditorRegistry {
return descriptors[0];
}
return null;
return undefined;
}
getEditorById(editorId: string): EditorDescriptor | null {
getEditorById(editorId: string): EditorDescriptor | undefined {
for (const editor of this.editors) {
if (editor.getId() === editorId) {
return editor;
}
}
return null;
return undefined;
}
getEditors(): EditorDescriptor[] {
getEditors(): readonly EditorDescriptor[] {
return this.editors.slice(0);
}
@@ -175,8 +160,10 @@ class EditorRegistry implements IEditorRegistry {
getEditorInputs(): SyncDescriptor<EditorInput>[] {
const inputClasses: SyncDescriptor<EditorInput>[] = [];
for (const editor of this.editors) {
const editorInputDescriptors: SyncDescriptor<EditorInput>[] = editor[INPUT_DESCRIPTORS_PROPERTY];
inputClasses.push(...editorInputDescriptors.map(descriptor => descriptor.ctor));
const editorInputDescriptors = this.mapEditorToInputs.get(editor);
if (editorInputDescriptors) {
inputClasses.push(...editorInputDescriptors.map(descriptor => descriptor.ctor));
}
}
return inputClasses;

View File

@@ -8,7 +8,7 @@ import * as resources from 'vs/base/common/resources';
import { IconLabel, IIconLabelValueOptions, IIconLabelCreationOptions } from 'vs/base/browser/ui/iconLabel/iconLabel';
import { IExtensionService } from 'vs/workbench/services/extensions/common/extensions';
import { IModeService } from 'vs/editor/common/services/modeService';
import { toResource, IEditorInput, SideBySideEditor } from 'vs/workbench/common/editor';
import { toResource, IEditorInput, SideBySideEditor, Verbosity } from 'vs/workbench/common/editor';
import { PLAINTEXT_MODE_ID } from 'vs/editor/common/modes/modesRegistry';
import { IWorkspaceContextService } from 'vs/platform/workspace/common/workspace';
import { IConfigurationService } from 'vs/platform/configuration/common/configuration';
@@ -35,6 +35,7 @@ export interface IResourceLabelProps {
export interface IResourceLabelOptions extends IIconLabelValueOptions {
fileKind?: FileKind;
fileDecorations?: { colors: boolean, badges: boolean, data?: IDecorationData };
descriptionVerbosity?: Verbosity;
}
export interface IFileLabelOptions extends IResourceLabelOptions {
@@ -52,19 +53,19 @@ export interface IResourceLabel extends IDisposable {
setLabel(label?: string, description?: string, options?: IIconLabelValueOptions): void;
/**
* Convinient method to apply a label by passing a resource along.
* Convenient method to apply a label by passing a resource along.
*
* Note: for file resources consider to use the #setFile() method instead.
*/
setResource(label: IResourceLabelProps, options?: IResourceLabelOptions): void;
/**
* Convinient method to render a file label based on a resource.
* Convenient method to render a file label based on a resource.
*/
setFile(resource: URI, options?: IFileLabelOptions): void;
/**
* Convinient method to apply a label by passing an editor along.
* Convenient method to apply a label by passing an editor along.
*/
setEditor(editor: IEditorInput, options?: IResourceLabelOptions): void;
@@ -94,7 +95,8 @@ export class ResourceLabels extends Disposable {
@IModelService private readonly modelService: IModelService,
@IDecorationsService private readonly decorationsService: IDecorationsService,
@IThemeService private readonly themeService: IThemeService,
@IFileService private readonly fileService: IFileService
@IFileService private readonly fileService: IFileService,
@ILabelService private readonly labelService: ILabelService
) {
super();
@@ -145,6 +147,10 @@ export class ResourceLabels extends Disposable {
this._widgets.forEach(widget => widget.notifyFileAssociationsChange());
}
}));
this._register(this.labelService.onDidChangeFormatters(() => {
this._widgets.forEach(widget => widget.notifyFormattersChange());
}));
}
get(index: number): IResourceLabel {
@@ -212,9 +218,10 @@ export class ResourceLabel extends ResourceLabels {
@IModelService modelService: IModelService,
@IDecorationsService decorationsService: IDecorationsService,
@IThemeService themeService: IThemeService,
@IFileService fileService: IFileService
@IFileService fileService: IFileService,
@ILabelService labelService: ILabelService
) {
super(DEFAULT_LABELS_CONTAINER, instantiationService, extensionService, configurationService, modelService, decorationsService, themeService, fileService);
super(DEFAULT_LABELS_CONTAINER, instantiationService, extensionService, configurationService, modelService, decorationsService, themeService, fileService, labelService);
this._label = this._register(this.create(container, options));
}
@@ -232,7 +239,7 @@ enum Redraw {
class ResourceLabelWidget extends IconLabel {
private _onDidRender = this._register(new Emitter<void>());
get onDidRender(): Event<void> { return this._onDidRender.event; }
readonly onDidRender: Event<void> = this._onDidRender.event;
private label?: IResourceLabelProps;
private options?: IResourceLabelOptions;
@@ -309,6 +316,13 @@ class ResourceLabelWidget extends IconLabel {
this.render(true);
}
notifyFormattersChange(): void {
if (this.label && this.label.resource) {
this.setFile(this.label.resource, this.options);
}
this.render(false);
}
setResource(label: IResourceLabelProps, options?: IResourceLabelOptions): void {
const hasResourceChanged = this.hasResourceChanged(label, options);
@@ -352,7 +366,7 @@ class ResourceLabelWidget extends IconLabel {
this.setResource({
resource: toResource(editor, { supportSideBySide: SideBySideEditor.MASTER }),
name: withNullAsUndefined(editor.getName()),
description: withNullAsUndefined(editor.getDescription())
description: editor.getDescription(options ? options.descriptionVerbosity : undefined)
}, options);
}

View File

@@ -3,20 +3,20 @@
* Licensed under the Source EULA. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
import { IDisposable, dispose, Disposable } from 'vs/base/common/lifecycle';
import { Disposable, DisposableStore } from 'vs/base/common/lifecycle';
import { Event, Emitter } from 'vs/base/common/event';
import { EventType, addDisposableListener, addClass, removeClass, isAncestor, getClientArea, position, size } from 'vs/base/browser/dom';
import { EventType, addDisposableListener, addClass, removeClass, isAncestor, getClientArea, position, size, EventHelper } from 'vs/base/browser/dom';
import { onDidChangeFullscreen, isFullscreen, getZoomFactor } from 'vs/base/browser/browser';
import { IBackupFileService } from 'vs/workbench/services/backup/common/backup';
import { Registry } from 'vs/platform/registry/common/platform';
import { isWindows, isLinux, isMacintosh } from 'vs/base/common/platform';
import { isWindows, isLinux, isMacintosh, isWeb, isNative } from 'vs/base/common/platform';
import { pathsToEditors } from 'vs/workbench/common/editor';
import { SidebarPart } from 'vs/workbench/browser/parts/sidebar/sidebarPart';
import { PanelPart } from 'vs/workbench/browser/parts/panel/panelPart';
import { PanelRegistry, Extensions as PanelExtensions } from 'vs/workbench/browser/panel';
import { Position, Parts, IWorkbenchLayoutService, ILayoutOptions } from 'vs/workbench/services/layout/browser/layoutService';
import { IWorkspaceContextService, WorkbenchState } from 'vs/platform/workspace/common/workspace';
import { IStorageService, StorageScope, IWillSaveStateEvent, WillSaveStateReason } from 'vs/platform/storage/common/storage';
import { IStorageService, StorageScope, WillSaveStateReason } from 'vs/platform/storage/common/storage';
import { IConfigurationService } from 'vs/platform/configuration/common/configuration';
import { IViewletService } from 'vs/workbench/services/viewlet/browser/viewlet';
import { IPanelService } from 'vs/workbench/services/panel/common/panelService';
@@ -27,13 +27,14 @@ import { IWindowService, MenuBarVisibility, getTitleBarStyle } from 'vs/platform
import { IWorkbenchEnvironmentService } from 'vs/workbench/services/environment/common/environmentService';
import { IEditorService, IResourceEditor } from 'vs/workbench/services/editor/common/editorService';
import { IEditorGroupsService } from 'vs/workbench/services/editor/common/editorGroupsService';
import { Sizing, Direction, Grid, View } from 'vs/base/browser/ui/grid/grid';
import { Sizing, Direction, Grid } from 'vs/base/browser/ui/grid/grid';
import { WorkbenchLegacyLayout } from 'vs/workbench/browser/legacyLayout';
import { IDimension } from 'vs/platform/layout/browser/layoutService';
import { Part } from 'vs/workbench/browser/part';
import { IStatusbarService } from 'vs/platform/statusbar/common/statusbar';
import { IActivityBarService } from 'vs/workbench/services/activityBar/browser/activityBarService';
import { IFileService } from 'vs/platform/files/common/files';
import { IView } from 'vs/base/browser/ui/grid/gridview';
enum Settings {
MENUBAR_VISIBLE = 'window.menuBarVisibility',
@@ -43,7 +44,8 @@ enum Settings {
SIDEBAR_POSITION = 'workbench.sideBar.location',
PANEL_POSITION = 'workbench.panel.defaultLocation',
ZEN_MODE_RESTORE = 'zenMode.restore'
ZEN_MODE_RESTORE = 'zenMode.restore',
}
enum Storage {
@@ -51,6 +53,7 @@ enum Storage {
PANEL_HIDDEN = 'workbench.panel.hidden',
PANEL_POSITION = 'workbench.panel.location',
PANEL_SIZE_BEFORE_MAXIMIZED = 'workbench.panel.sizeBeforeMaximized',
ZEN_MODE_ENABLED = 'workbench.zenmode.active',
CENTERED_LAYOUT_ENABLED = 'workbench.centerededitorlayout.active',
@@ -61,13 +64,22 @@ export abstract class Layout extends Disposable implements IWorkbenchLayoutServi
_serviceBrand: ServiceIdentifier<any>;
private readonly _onTitleBarVisibilityChange: Emitter<void> = this._register(new Emitter<void>());
get onTitleBarVisibilityChange(): Event<void> { return this._onTitleBarVisibilityChange.event; }
readonly onTitleBarVisibilityChange: Event<void> = this._onTitleBarVisibilityChange.event;
private readonly _onZenMode: Emitter<boolean> = this._register(new Emitter<boolean>());
get onZenModeChange(): Event<boolean> { return this._onZenMode.event; }
private readonly _onZenModeChange: Emitter<boolean> = this._register(new Emitter<boolean>());
readonly onZenModeChange: Event<boolean> = this._onZenModeChange.event;
private readonly _onFullscreenChange: Emitter<boolean> = this._register(new Emitter<boolean>());
readonly onFullscreenChange: Event<boolean> = this._onFullscreenChange.event;
private readonly _onCenteredLayoutChange: Emitter<boolean> = this._register(new Emitter<boolean>());
readonly onCenteredLayoutChange: Event<boolean> = this._onCenteredLayoutChange.event;
private readonly _onPanelPositionChange: Emitter<string> = this._register(new Emitter<string>());
readonly onPanelPositionChange: Event<string> = this._onPanelPositionChange.event;
private readonly _onLayout = this._register(new Emitter<IDimension>());
get onLayout(): Event<IDimension> { return this._onLayout.event; }
readonly onLayout: Event<IDimension> = this._onLayout.event;
private _dimension: IDimension;
get dimension(): IDimension { return this._dimension; }
@@ -77,16 +89,16 @@ export abstract class Layout extends Disposable implements IWorkbenchLayoutServi
private parts: Map<string, Part> = new Map<string, Part>();
private workbenchGrid: Grid<View> | WorkbenchLegacyLayout;
private workbenchGrid: Grid | WorkbenchLegacyLayout;
private disposed: boolean;
private titleBarPartView: View;
private activityBarPartView: View;
private sideBarPartView: View;
private panelPartView: View;
private editorPartView: View;
private statusBarPartView: View;
private titleBarPartView: IView;
private activityBarPartView: IView;
private sideBarPartView: IView;
private panelPartView: IView;
private editorPartView: IView;
private statusBarPartView: IView;
private environmentService: IWorkbenchEnvironmentService;
private configurationService: IConfigurationService;
@@ -130,6 +142,7 @@ export abstract class Layout extends Disposable implements IWorkbenchLayoutServi
panel: {
hidden: false,
sizeBeforeMaximize: 0,
position: Position.BOTTOM,
height: 350,
width: 350,
@@ -147,7 +160,7 @@ export abstract class Layout extends Disposable implements IWorkbenchLayoutServi
transitionedToCenteredEditorLayout: false,
wasSideBarVisible: false,
wasPanelVisible: false,
transitionDisposeables: [] as IDisposable[]
transitionDisposables: new DisposableStore()
}
};
@@ -186,9 +199,6 @@ export abstract class Layout extends Disposable implements IWorkbenchLayoutServi
private registerLayoutListeners(): void {
// Storage
this._register(this.storageService.onWillSaveState(e => this.saveLayoutState(e)));
// Restore editor if hidden and it changes
this._register(this.editorService.onDidVisibleEditorsChange(() => this.setEditorHidden(false)));
this._register(this.editorGroupService.onDidActivateGroup(() => this.setEditorHidden(false)));
@@ -206,8 +216,13 @@ export abstract class Layout extends Disposable implements IWorkbenchLayoutServi
// Prevent workbench from scrolling #55456
this._register(addDisposableListener(this.container, EventType.SCROLL, () => this.container.scrollTop = 0));
// Prevent native context menus in web #73781
if (isWeb) {
this._register(addDisposableListener(this.container, EventType.CONTEXT_MENU, (e) => EventHelper.stop(e, true)));
}
// Menubar visibility changes
if ((isWindows || isLinux) && getTitleBarStyle(this.configurationService, this.environmentService) === 'custom') {
if ((isWindows || isLinux || isWeb) && getTitleBarStyle(this.configurationService, this.environmentService) === 'custom') {
this._register(this.titleService.onMenubarVisibilityChange(visible => this.onMenubarToggled(visible)));
}
}
@@ -242,6 +257,8 @@ export abstract class Layout extends Disposable implements IWorkbenchLayoutServi
this._onTitleBarVisibilityChange.fire();
this.layout(); // handle title bar when fullscreen changes
}
this._onFullscreenChange.fire(this.state.fullscreen);
}
private doUpdateLayoutConfiguration(skipLayout?: boolean): void {
@@ -274,6 +291,7 @@ export abstract class Layout extends Disposable implements IWorkbenchLayoutServi
// Menubar visibility
const newMenubarVisibility = this.configurationService.getValue<MenuBarVisibility>(Settings.MENUBAR_VISIBLE);
this.setMenubarVisibility(newMenubarVisibility, !!skipLayout);
}
private setSideBarPosition(position: Position): void {
@@ -302,7 +320,7 @@ export abstract class Layout extends Disposable implements IWorkbenchLayoutServi
// Layout
if (this.workbenchGrid instanceof Grid) {
if (!wasHidden) {
this.state.sideBar.width = this.workbenchGrid.getViewSize(this.sideBarPartView);
this.state.sideBar.width = this.workbenchGrid.getViewSize(this.sideBarPartView).width;
}
this.workbenchGrid.removeView(this.sideBarPartView);
@@ -381,11 +399,15 @@ export abstract class Layout extends Disposable implements IWorkbenchLayoutServi
}
}
// Panel size before maximized
this.state.panel.sizeBeforeMaximize = this.storageService.getNumber(Storage.PANEL_SIZE_BEFORE_MAXIMIZED, StorageScope.GLOBAL, 0);
// Statusbar visibility
this.state.statusBar.hidden = !this.configurationService.getValue<string>(Settings.STATUSBAR_VISIBLE);
// Zen mode enablement
this.state.zenMode.restore = this.storageService.getBoolean(Storage.ZEN_MODE_ENABLED, StorageScope.WORKSPACE, false) && this.configurationService.getValue(Settings.ZEN_MODE_RESTORE);
}
private resolveEditorsToOpen(fileService: IFileService): Promise<IResourceEditor[]> | IResourceEditor[] {
@@ -500,7 +522,7 @@ export abstract class Layout extends Disposable implements IWorkbenchLayoutServi
return false;
} else if (!this.state.fullscreen) {
return true;
} else if (isMacintosh) {
} else if (isMacintosh && isNative) {
return false;
} else if (this.state.menuBar.visibility === 'visible') {
return true;
@@ -541,13 +563,17 @@ export abstract class Layout extends Disposable implements IWorkbenchLayoutServi
return offset;
}
getWorkbenchContainer(): HTMLElement {
return this.parent;
}
getWorkbenchElement(): HTMLElement {
return this.container;
}
toggleZenMode(skipLayout?: boolean, restoring = false): void {
this.state.zenMode.active = !this.state.zenMode.active;
this.state.zenMode.transitionDisposeables = dispose(this.state.zenMode.transitionDisposeables);
this.state.zenMode.transitionDisposables.clear();
const setLineNumbers = (lineNumbers: any) => this.editorService.visibleTextEditorWidgets.forEach(editor => editor.updateOptions({ lineNumbers }));
@@ -586,11 +612,11 @@ export abstract class Layout extends Disposable implements IWorkbenchLayoutServi
if (config.hideLineNumbers) {
setLineNumbers('off');
this.state.zenMode.transitionDisposeables.push(this.editorService.onDidVisibleEditorsChange(() => setLineNumbers('off')));
this.state.zenMode.transitionDisposables.add(this.editorService.onDidVisibleEditorsChange(() => setLineNumbers('off')));
}
if (config.hideTabs && this.editorGroupService.partOptions.showTabs) {
this.state.zenMode.transitionDisposeables.push(this.editorGroupService.enforcePartOptions({ showTabs: false }));
this.state.zenMode.transitionDisposables.add(this.editorGroupService.enforcePartOptions({ showTabs: false }));
}
if (config.centerLayout) {
@@ -631,7 +657,23 @@ export abstract class Layout extends Disposable implements IWorkbenchLayoutServi
}
// Event
this._onZenMode.fire(this.state.zenMode.active);
this._onZenModeChange.fire(this.state.zenMode.active);
// State
if (this.state.zenMode.active) {
this.storageService.store(Storage.ZEN_MODE_ENABLED, true, StorageScope.WORKSPACE);
// Exit zen mode on shutdown unless configured to keep
this.state.zenMode.transitionDisposables.add(this.storageService.onWillSaveState(e => {
if (e.reason === WillSaveStateReason.SHUTDOWN && this.state.zenMode.active) {
if (!this.configurationService.getValue(Settings.ZEN_MODE_RESTORE)) {
this.toggleZenMode(true); // We will not restore zen mode, need to clear all zen mode state changes
}
}
}));
} else {
this.storageService.remove(Storage.ZEN_MODE_ENABLED, StorageScope.WORKSPACE);
}
}
private setStatusBarHidden(hidden: boolean, skipLayout?: boolean): void {
@@ -665,16 +707,24 @@ export abstract class Layout extends Disposable implements IWorkbenchLayoutServi
if (this.configurationService.getValue('workbench.useExperimentalGridLayout')) {
// Create view wrappers for all parts
this.titleBarPartView = new View(titleBar);
this.sideBarPartView = new View(sideBar);
this.activityBarPartView = new View(activityBar);
this.editorPartView = new View(editorPart);
this.panelPartView = new View(panelPart);
this.statusBarPartView = new View(statusBar);
this.titleBarPartView = titleBar;
this.sideBarPartView = sideBar;
this.activityBarPartView = activityBar;
this.editorPartView = editorPart;
this.panelPartView = panelPart;
this.statusBarPartView = statusBar;
this.workbenchGrid = new Grid(this.editorPartView, { proportionalLayout: false });
this.container.prepend(this.workbenchGrid.element);
this._register((this.sideBarPartView as SidebarPart).onDidVisibilityChange((visible) => {
this.setSideBarHidden(!visible, true);
}));
this._register((this.panelPartView as PanelPart).onDidVisibilityChange((visible) => {
this.setPanelHidden(!visible, true);
}));
} else {
this.workbenchGrid = instantiationService.createInstance(
WorkbenchLegacyLayout,
@@ -753,52 +803,52 @@ export abstract class Layout extends Disposable implements IWorkbenchLayoutServi
// Hide parts
if (this.state.panel.hidden) {
this.panelPartView.hide();
this.workbenchGrid.setViewVisible(this.panelPartView, false);
}
if (this.state.statusBar.hidden) {
this.statusBarPartView.hide();
this.workbenchGrid.setViewVisible(this.statusBarPartView, false);
}
if (!this.isVisible(Parts.TITLEBAR_PART)) {
this.titleBarPartView.hide();
if (titlebarInGrid && !this.isVisible(Parts.TITLEBAR_PART)) {
this.workbenchGrid.setViewVisible(this.titleBarPartView, false);
}
if (this.state.activityBar.hidden) {
this.activityBarPartView.hide();
this.workbenchGrid.setViewVisible(this.activityBarPartView, false);
}
if (this.state.sideBar.hidden) {
this.sideBarPartView.hide();
this.workbenchGrid.setViewVisible(this.sideBarPartView, false);
}
if (this.state.editor.hidden) {
this.editorPartView.hide();
this.workbenchGrid.setViewVisible(this.editorPartView, false);
}
// Show visible parts
if (!this.state.editor.hidden) {
this.editorPartView.show();
this.workbenchGrid.setViewVisible(this.editorPartView, true);
}
if (!this.state.statusBar.hidden) {
this.statusBarPartView.show();
this.workbenchGrid.setViewVisible(this.statusBarPartView, true);
}
if (this.isVisible(Parts.TITLEBAR_PART)) {
this.titleBarPartView.show();
this.workbenchGrid.setViewVisible(this.titleBarPartView, true);
}
if (!this.state.activityBar.hidden) {
this.activityBarPartView.show();
this.workbenchGrid.setViewVisible(this.activityBarPartView, true);
}
if (!this.state.sideBar.hidden) {
this.sideBarPartView.show();
this.workbenchGrid.setViewVisible(this.sideBarPartView, true);
}
if (!this.state.panel.hidden) {
this.panelPartView.show();
this.workbenchGrid.setViewVisible(this.panelPartView, true);
}
}
@@ -828,25 +878,68 @@ export abstract class Layout extends Disposable implements IWorkbenchLayoutServi
this.layout();
}
}
this._onCenteredLayoutChange.fire(this.state.editor.centered);
}
resizePart(part: Parts, sizeChange: number): void {
let view: View;
switch (part) {
case Parts.SIDEBAR_PART:
view = this.sideBarPartView;
case Parts.PANEL_PART:
view = this.panelPartView;
case Parts.EDITOR_PART:
view = this.editorPartView;
if (this.workbenchGrid instanceof Grid) {
this.workbenchGrid.resizeView(view, this.workbenchGrid.getViewSize(view) + sizeChange);
} else {
this.workbenchGrid.resizePart(part, sizeChange);
}
break;
default:
return; // Cannot resize other parts
if (this.workbenchGrid instanceof Grid) {
let viewSize;
const sizeChangePxWidth = this.workbenchGrid.width * sizeChange / 100;
const sizeChangePxHeight = this.workbenchGrid.height * sizeChange / 100;
switch (part) {
case Parts.SIDEBAR_PART:
viewSize = this.workbenchGrid.getViewSize(this.sideBarPartView);
this.workbenchGrid.resizeView(this.sideBarPartView,
{
width: viewSize.width + sizeChangePxWidth,
height: viewSize.height
});
break;
case Parts.PANEL_PART:
viewSize = this.workbenchGrid.getViewSize(this.panelPartView);
this.workbenchGrid.resizeView(this.panelPartView,
{
width: viewSize.width + (this.getPanelPosition() !== Position.BOTTOM ? sizeChangePxWidth : 0),
height: viewSize.height + (this.getPanelPosition() !== Position.BOTTOM ? 0 : sizeChangePxHeight)
});
break;
case Parts.EDITOR_PART:
viewSize = this.workbenchGrid.getViewSize(this.editorPartView);
// Single Editor Group
if (this.editorGroupService.count === 1) {
if (this.isVisible(Parts.SIDEBAR_PART)) {
this.workbenchGrid.resizeView(this.editorPartView,
{
width: viewSize.width + sizeChangePxWidth,
height: viewSize.height
});
} else if (this.isVisible(Parts.PANEL_PART)) {
this.workbenchGrid.resizeView(this.editorPartView,
{
width: viewSize.width + (this.getPanelPosition() !== Position.BOTTOM ? sizeChangePxWidth : 0),
height: viewSize.height + (this.getPanelPosition() !== Position.BOTTOM ? 0 : sizeChangePxHeight)
});
}
} else {
const activeGroup = this.editorGroupService.activeGroup;
const { width, height } = this.editorGroupService.getSize(activeGroup);
this.editorGroupService.setSize(activeGroup, { width: width + sizeChangePxWidth, height: height + sizeChangePxHeight });
}
break;
default:
return; // Cannot resize other parts
}
} else {
// Legacy Layout
this.workbenchGrid.resizePart(part, sizeChange);
}
}
@@ -981,7 +1074,28 @@ export abstract class Layout extends Disposable implements IWorkbenchLayoutServi
toggleMaximizedPanel(): void {
if (this.workbenchGrid instanceof Grid) {
this.workbenchGrid.maximizeViewSize(this.panelPartView);
const curSize = this.workbenchGrid.getViewSize2(this.panelPartView);
const size = { ...curSize };
if (!this.isPanelMaximized()) {
if (this.state.panel.position === Position.BOTTOM) {
size.height = this.panelPartView.maximumHeight;
this.state.panel.sizeBeforeMaximize = curSize.height;
} else {
size.width = this.panelPartView.maximumWidth;
this.state.panel.sizeBeforeMaximize = curSize.width;
}
this.storageService.store(Storage.PANEL_SIZE_BEFORE_MAXIMIZED, this.state.panel.sizeBeforeMaximize, StorageScope.GLOBAL);
} else {
if (this.state.panel.position === Position.BOTTOM) {
size.height = this.state.panel.sizeBeforeMaximize;
} else {
size.width = this.state.panel.sizeBeforeMaximize;
}
}
this.workbenchGrid.resizeView(this.panelPartView, size);
} else {
this.workbenchGrid.layout({ toggleMaximizedPanel: true, source: Parts.PANEL_PART });
}
@@ -990,7 +1104,12 @@ export abstract class Layout extends Disposable implements IWorkbenchLayoutServi
isPanelMaximized(): boolean {
if (this.workbenchGrid instanceof Grid) {
try {
return this.workbenchGrid.getViewSize2(this.panelPartView).height === this.getPart(Parts.PANEL_PART).maximumHeight;
// The panel is maximum when the editor is minimum
if (this.state.panel.position === Position.BOTTOM) {
return this.workbenchGrid.getViewSize2(this.editorPartView).height <= this.editorPartView.minimumHeight;
} else {
return this.workbenchGrid.getViewSize2(this.editorPartView).width <= this.editorPartView.minimumWidth;
}
} catch (e) {
return false;
}
@@ -1069,6 +1188,8 @@ export abstract class Layout extends Disposable implements IWorkbenchLayoutServi
} else {
this.workbenchGrid.layout();
}
this._onPanelPositionChange.fire(positionToString(this.state.panel.position));
}
private savePanelDimension(): void {
@@ -1077,25 +1198,9 @@ export abstract class Layout extends Disposable implements IWorkbenchLayoutServi
}
if (this.state.panel.position === Position.BOTTOM) {
this.state.panel.height = this.workbenchGrid.getViewSize(this.panelPartView);
this.state.panel.height = this.workbenchGrid.getViewSize(this.panelPartView).height;
} else {
this.state.panel.width = this.workbenchGrid.getViewSize(this.panelPartView);
}
}
private saveLayoutState(e: IWillSaveStateEvent): void {
// Zen Mode
if (this.state.zenMode.active) {
this.storageService.store(Storage.ZEN_MODE_ENABLED, true, StorageScope.WORKSPACE);
} else {
this.storageService.remove(Storage.ZEN_MODE_ENABLED, StorageScope.WORKSPACE);
}
if (e.reason === WillSaveStateReason.SHUTDOWN && this.state.zenMode.active) {
if (!this.configurationService.getValue(Settings.ZEN_MODE_RESTORE)) {
this.toggleZenMode(true); // We will not restore zen mode, need to clear all zen mode state changes
}
this.state.panel.width = this.workbenchGrid.getViewSize(this.panelPartView).width;
}
}

View File

@@ -10,16 +10,16 @@ import { IStorageService, StorageScope } from 'vs/platform/storage/common/storag
import { IContextViewService } from 'vs/platform/contextview/browser/contextView';
import { Disposable } from 'vs/base/common/lifecycle';
import { IThemeService } from 'vs/platform/theme/common/themeService';
import { isMacintosh } from 'vs/base/common/platform';
import { isMacintosh, isWeb } from 'vs/base/common/platform';
import { memoize } from 'vs/base/common/decorators';
import { Dimension, getClientArea, size, position, hide, show } from 'vs/base/browser/dom';
import { IEditorGroupsService } from 'vs/workbench/services/editor/common/editorGroupsService';
import { getZoomFactor } from 'vs/base/browser/browser';
import { Part } from 'vs/workbench/browser/part';
const TITLE_BAR_HEIGHT = isMacintosh ? 22 : 30;
const TITLE_BAR_HEIGHT = isMacintosh && !isWeb ? 22 : 30;
const STATUS_BAR_HEIGHT = 22;
const ACTIVITY_BAR_WIDTH = 50;
const ACTIVITY_BAR_WIDTH = 48;
const MIN_SIDEBAR_PART_WIDTH = 170;
const DEFAULT_SIDEBAR_PART_WIDTH = 300;
@@ -726,8 +726,8 @@ export class WorkbenchLegacyLayout extends Disposable implements IVerticalSashLa
} else {
const activeGroup = this.editorGroupService.activeGroup;
const activeGroupSize = this.editorGroupService.getSize(activeGroup);
this.editorGroupService.setSize(activeGroup, activeGroupSize + sizeChangePxWidth);
const { width, height } = this.editorGroupService.getSize(activeGroup);
this.editorGroupService.setSize(activeGroup, { width: width + sizeChangePxWidth, height: height + sizeChangePxHeight });
}
}

View File

@@ -161,6 +161,7 @@ body.web {
/* START Keyboard Focus Indication Styles */
.monaco-workbench [tabindex="0"]:focus,
.monaco-workbench [tabindex="-1"]:focus,
.monaco-workbench .synthetic-focus,
.monaco-workbench select:focus,
.monaco-workbench input[type="button"]:focus,
@@ -174,6 +175,7 @@ body.web {
}
.monaco-workbench [tabindex="0"]:active,
.monaco-workbench [tabindex="-1"]:active,
.monaco-workbench select:active,
.monaco-workbench input[type="button"]:active,
.monaco-workbench input[type="checkbox"]:active,

View File

@@ -41,6 +41,13 @@ export class PanelRegistry extends CompositeRegistry<Panel> {
super.deregisterComposite(id);
}
/**
* Returns a panel by id.
*/
getPanel(id: string): PanelDescriptor | null {
return this.getComposite(id);
}
/**
* Returns an array of registered panels known to the platform.
*/

View File

@@ -8,11 +8,11 @@ import * as nls from 'vs/nls';
import * as DOM from 'vs/base/browser/dom';
import { StandardKeyboardEvent } from 'vs/base/browser/keyboardEvent';
import { EventType as TouchEventType, GestureEvent } from 'vs/base/browser/touch';
import { Action } from 'vs/base/common/actions';
import { Action, IAction } from 'vs/base/common/actions';
import { KeyCode } from 'vs/base/common/keyCodes';
import { dispose } from 'vs/base/common/lifecycle';
import { URI } from 'vs/base/common/uri';
import { SyncActionDescriptor } from 'vs/platform/actions/common/actions';
import { SyncActionDescriptor, IMenuService, MenuId } from 'vs/platform/actions/common/actions';
import { IContextMenuService } from 'vs/platform/contextview/browser/contextView';
import { Registry } from 'vs/platform/registry/common/platform';
import { ITelemetryService } from 'vs/platform/telemetry/common/telemetry';
@@ -21,11 +21,13 @@ import { ICssStyleCollector, ITheme, IThemeService, registerThemingParticipant }
import { ActivityAction, ActivityActionViewItem, ICompositeBar, ICompositeBarColors, ToggleCompositePinnedAction } from 'vs/workbench/browser/parts/compositeBarActions';
import { ViewletDescriptor } from 'vs/workbench/browser/viewlet';
import { Extensions as ActionExtensions, IWorkbenchActionRegistry } from 'vs/workbench/common/actions';
import { IActivity, IGlobalActivity } from 'vs/workbench/common/activity';
import { IActivity } from 'vs/workbench/common/activity';
import { ACTIVITY_BAR_FOREGROUND } from 'vs/workbench/common/theme';
import { IActivityBarService } from 'vs/workbench/services/activityBar/browser/activityBarService';
import { IWorkbenchLayoutService, Parts } from 'vs/workbench/services/layout/browser/layoutService';
import { IViewletService } from 'vs/workbench/services/viewlet/browser/viewlet';
import { IContextKeyService } from 'vs/platform/contextkey/common/contextkey';
import { createAndFillInActionBarActions } from 'vs/platform/actions/browser/menuEntryActionViewItem';
export class ViewletActivityAction extends ActivityAction {
@@ -104,20 +106,15 @@ export class ToggleViewletAction extends Action {
}
}
export class GlobalActivityAction extends ActivityAction {
constructor(activity: IGlobalActivity) {
super(activity);
}
}
export class GlobalActivityActionViewItem extends ActivityActionViewItem {
constructor(
action: GlobalActivityAction,
action: ActivityAction,
colors: (theme: ITheme) => ICompositeBarColors,
@IThemeService themeService: IThemeService,
@IContextMenuService protected contextMenuService: IContextMenuService
@IMenuService private readonly menuService: IMenuService,
@IContextMenuService protected contextMenuService: IContextMenuService,
@IContextKeyService private readonly contextKeyService: IContextKeyService,
) {
super(action, { draggable: false, colors, icon: true }, themeService);
}
@@ -148,16 +145,19 @@ export class GlobalActivityActionViewItem extends ActivityActionViewItem {
}
private showContextMenu(): void {
const globalAction = this._action as GlobalActivityAction;
const activity = globalAction.activity as IGlobalActivity;
const actions = activity.getActions();
const globalActivityActions: IAction[] = [];
const globalActivityMenu = this.menuService.createMenu(MenuId.GlobalActivity, this.contextKeyService);
const actionsDisposable = createAndFillInActionBarActions(globalActivityMenu, undefined, { primary: [], secondary: globalActivityActions });
const containerPosition = DOM.getDomNodePagePosition(this.container);
const location = { x: containerPosition.left + containerPosition.width / 2, y: containerPosition.top };
this.contextMenuService.showContextMenu({
getAnchor: () => location,
getActions: () => actions,
onHide: () => dispose(actions)
getActions: () => globalActivityActions,
onHide: () => {
globalActivityMenu.dispose();
dispose(actionsDisposable);
}
});
}
}
@@ -173,7 +173,7 @@ export class PlaceHolderViewletActivityAction extends ViewletActivityAction {
super({ id, name: id, cssClass: `extensionViewlet-placeholder-${id.replace(/\./g, '-')}` }, viewletService, layoutService, telemetryService);
const iconClass = `.monaco-workbench .activitybar .monaco-action-bar .action-label.${this.class}`; // Generate Placeholder CSS to show the icon in the activity bar
DOM.createCSSRule(iconClass, `-webkit-mask: url('${iconUrl || ''}') no-repeat 50% 50%`);
DOM.createCSSRule(iconClass, `-webkit-mask: url('${DOM.asDomUri(iconUrl) || ''}') no-repeat 50% 50%; -webkit-mask-size: 24px;`);
}
setActivity(activity: IActivity): void {
@@ -260,8 +260,8 @@ export class NextSideBarViewAction extends SwitchSideBarViewAction {
}
const registry = Registry.as<IWorkbenchActionRegistry>(ActionExtensions.WorkbenchActions);
registry.registerWorkbenchAction(new SyncActionDescriptor(PreviousSideBarViewAction, PreviousSideBarViewAction.ID, PreviousSideBarViewAction.LABEL), 'View: Open Previous Side Bar View', nls.localize('view', "View"));
registry.registerWorkbenchAction(new SyncActionDescriptor(NextSideBarViewAction, NextSideBarViewAction.ID, NextSideBarViewAction.LABEL), 'View: Open Next Side Bar View', nls.localize('view', "View"));
registry.registerWorkbenchAction(new SyncActionDescriptor(PreviousSideBarViewAction, PreviousSideBarViewAction.ID, PreviousSideBarViewAction.LABEL), 'View: Previous Side Bar View', nls.localize('view', "View"));
registry.registerWorkbenchAction(new SyncActionDescriptor(NextSideBarViewAction, NextSideBarViewAction.ID, NextSideBarViewAction.LABEL), 'View: Next Side Bar View', nls.localize('view', "View"));
registerThemingParticipant((theme: ITheme, collector: ICssStyleCollector) => {

View File

@@ -7,15 +7,15 @@ import 'vs/css!./media/activitybarpart';
import * as nls from 'vs/nls';
import { illegalArgument } from 'vs/base/common/errors';
import { ActionsOrientation, ActionBar } from 'vs/base/browser/ui/actionbar/actionbar';
import { GlobalActivityExtensions, IGlobalActivityRegistry } from 'vs/workbench/common/activity';
import { GLOBAL_ACTIVITY_ID } from 'vs/workbench/common/activity';
import { Registry } from 'vs/platform/registry/common/platform';
import { Part } from 'vs/workbench/browser/part';
import { GlobalActivityActionViewItem, GlobalActivityAction, ViewletActivityAction, ToggleViewletAction, PlaceHolderToggleCompositePinnedAction, PlaceHolderViewletActivityAction } from 'vs/workbench/browser/parts/activitybar/activitybarActions';
import { GlobalActivityActionViewItem, ViewletActivityAction, ToggleViewletAction, PlaceHolderToggleCompositePinnedAction, PlaceHolderViewletActivityAction } from 'vs/workbench/browser/parts/activitybar/activitybarActions';
import { IViewletService } from 'vs/workbench/services/viewlet/browser/viewlet';
import { IBadge } from 'vs/workbench/services/activity/common/activity';
import { IWorkbenchLayoutService, Parts, Position as SideBarPosition } from 'vs/workbench/services/layout/browser/layoutService';
import { IInstantiationService, ServiceIdentifier } from 'vs/platform/instantiation/common/instantiation';
import { IDisposable, toDisposable, dispose } from 'vs/base/common/lifecycle';
import { IDisposable, toDisposable, DisposableStore } from 'vs/base/common/lifecycle';
import { ToggleActivityBarVisibilityAction } from 'vs/workbench/browser/actions/layoutActions';
import { IThemeService, ITheme } from 'vs/platform/theme/common/themeService';
import { ACTIVITY_BAR_BACKGROUND, ACTIVITY_BAR_BORDER, ACTIVITY_BAR_FOREGROUND, ACTIVITY_BAR_BADGE_BACKGROUND, ACTIVITY_BAR_BADGE_FOREGROUND, ACTIVITY_BAR_DRAG_AND_DROP_BACKGROUND, ACTIVITY_BAR_INACTIVE_FOREGROUND } from 'vs/workbench/common/theme';
@@ -25,7 +25,7 @@ import { Dimension, addClass } from 'vs/base/browser/dom';
import { IStorageService, StorageScope, IWorkspaceStorageChangeEvent } from 'vs/platform/storage/common/storage';
import { IExtensionService } from 'vs/workbench/services/extensions/common/extensions';
import { URI, UriComponents } from 'vs/base/common/uri';
import { ToggleCompositePinnedAction, ICompositeBarColors } from 'vs/workbench/browser/parts/compositeBarActions';
import { ToggleCompositePinnedAction, ICompositeBarColors, ActivityAction } from 'vs/workbench/browser/parts/compositeBarActions';
import { ViewletDescriptor } from 'vs/workbench/browser/viewlet';
import { IViewsService, IViewContainersRegistry, Extensions as ViewContainerExtensions, ViewContainer, TEST_VIEW_CONTAINER_ID, IViewDescriptorCollection } from 'vs/workbench/common/views';
import { IContextKeyService, ContextKeyExpr } from 'vs/platform/contextkey/common/contextkey';
@@ -48,24 +48,26 @@ export class ActivitybarPart extends Part implements IActivityBarService {
_serviceBrand: ServiceIdentifier<any>;
private static readonly ACTION_HEIGHT = 50;
private static readonly ACTION_HEIGHT = 48;
private static readonly PINNED_VIEWLETS = 'workbench.activity.pinnedViewlets';
//#region IView
readonly minimumWidth: number = 50;
readonly maximumWidth: number = 50;
readonly minimumWidth: number = 48;
readonly maximumWidth: number = 48;
readonly minimumHeight: number = 0;
readonly maximumHeight: number = Number.POSITIVE_INFINITY;
//#endregion
private globalActionBar: ActionBar;
private globalActivityIdToActions: { [globalActivityId: string]: GlobalActivityAction; } = Object.create(null);
private globalActivityAction: ActivityAction;
private globalActivityActionBar: ActionBar;
private cachedViewlets: ICachedViewlet[] = [];
private compositeBar: CompositeBar;
private compositeActions: { [compositeId: string]: { activityAction: ViewletActivityAction, pinnedAction: ToggleCompositePinnedAction } } = Object.create(null);
private compositeActions: Map<string, { activityAction: ViewletActivityAction, pinnedAction: ToggleCompositePinnedAction }> = new Map();
private readonly viewletDisposables: Map<string, IDisposable> = new Map<string, IDisposable>();
constructor(
@@ -119,15 +121,13 @@ export class ActivitybarPart extends Part implements IActivityBarService {
this._register(this.viewletService.onDidViewletClose(viewlet => this.compositeBar.deactivateComposite(viewlet.getId())));
// Extension registration
let disposables: IDisposable[] = [];
let disposables = this._register(new DisposableStore());
this._register(this.extensionService.onDidRegisterExtensions(() => {
disposables = dispose(disposables);
disposables.clear();
this.onDidRegisterExtensions();
this.compositeBar.onDidChange(() => this.saveCachedViewlets(), this, disposables);
this.storageService.onDidChangeStorage(e => this.onDidStorageChange(e), this, disposables);
}));
this._register(toDisposable(() => dispose(disposables)));
}
private onDidRegisterExtensions(): void {
@@ -161,34 +161,30 @@ export class ActivitybarPart extends Part implements IActivityBarService {
return this.compositeBar.showActivity(viewletOrActionId, badge, clazz, priority);
}
return this.showGlobalActivity(viewletOrActionId, badge, clazz);
if (viewletOrActionId === GLOBAL_ACTIVITY_ID) {
return this.showGlobalActivity(badge, clazz);
}
throw illegalArgument('globalActivityId');
}
private showGlobalActivity(globalActivityId: string, badge: IBadge, clazz?: string): IDisposable {
if (!badge) {
throw illegalArgument('badge');
}
private showGlobalActivity(badge: IBadge, clazz?: string): IDisposable {
this.globalActivityAction.setBadge(badge, clazz);
const action = this.globalActivityIdToActions[globalActivityId];
if (!action) {
throw illegalArgument('globalActivityId');
}
action.setBadge(badge, clazz);
return toDisposable(() => action.setBadge(undefined));
return toDisposable(() => this.globalActivityAction.setBadge(undefined));
}
createContentArea(parent: HTMLElement): HTMLElement {
this.element = parent;
const content = document.createElement('div');
addClass(content, 'content');
parent.appendChild(content);
// Top Actionbar with action items for each viewlet action
// Viewlets action bar
this.compositeBar.create(content);
// Top Actionbar with action items for each viewlet action
// Global action bar
const globalActivities = document.createElement('div');
addClass(globalActivities, 'global-activity');
content.appendChild(globalActivities);
@@ -208,7 +204,7 @@ export class ActivitybarPart extends Part implements IActivityBarService {
const borderColor = this.getColor(ACTIVITY_BAR_BORDER) || this.getColor(contrastBorder);
const isPositionLeft = this.layoutService.getSideBarPosition() === SideBarPosition.LEFT;
container.style.boxSizing = borderColor && isPositionLeft ? 'border-box' : null;
container.style.boxSizing = borderColor && isPositionLeft ? 'border-box' : '';
container.style.borderRightWidth = borderColor && isPositionLeft ? '1px' : null;
container.style.borderRightStyle = borderColor && isPositionLeft ? 'solid' : null;
container.style.borderRightColor = isPositionLeft ? borderColor : null;
@@ -229,27 +225,23 @@ export class ActivitybarPart extends Part implements IActivityBarService {
}
private createGlobalActivityActionBar(container: HTMLElement): void {
const activityRegistry = Registry.as<IGlobalActivityRegistry>(GlobalActivityExtensions);
const descriptors = activityRegistry.getActivities();
const actions = descriptors
.map(d => this.instantiationService.createInstance(d))
.map(a => new GlobalActivityAction(a));
this.globalActionBar = this._register(new ActionBar(container, {
this.globalActivityActionBar = this._register(new ActionBar(container, {
actionViewItemProvider: a => this.instantiationService.createInstance(GlobalActivityActionViewItem, a, (theme: ITheme) => this.getActivitybarItemColors(theme)),
orientation: ActionsOrientation.VERTICAL,
ariaLabel: nls.localize('globalActions', "Global Actions"),
ariaLabel: nls.localize('manage', "Manage"),
animated: false
}));
actions.forEach(a => {
this.globalActivityIdToActions[a.id] = a;
this.globalActionBar.push(a);
this.globalActivityAction = new ActivityAction({
id: 'workbench.actions.manage',
name: nls.localize('manage', "Manage"),
cssClass: 'update-activity'
});
this.globalActivityActionBar.push(this.globalActivityAction);
}
private getCompositeActions(compositeId: string): { activityAction: ViewletActivityAction, pinnedAction: ToggleCompositePinnedAction } {
let compositeActions = this.compositeActions[compositeId];
let compositeActions = this.compositeActions.get(compositeId);
if (!compositeActions) {
const viewlet = this.viewletService.getViewlet(compositeId);
if (viewlet) {
@@ -265,7 +257,7 @@ export class ActivitybarPart extends Part implements IActivityBarService {
};
}
this.compositeActions[compositeId] = compositeActions;
this.compositeActions.set(compositeId, compositeActions);
}
return compositeActions;
@@ -341,11 +333,11 @@ export class ActivitybarPart extends Part implements IActivityBarService {
private hideComposite(compositeId: string): void {
this.compositeBar.hideComposite(compositeId);
const compositeActions = this.compositeActions[compositeId];
const compositeActions = this.compositeActions.get(compositeId);
if (compositeActions) {
compositeActions.activityAction.dispose();
compositeActions.pinnedAction.dispose();
delete this.compositeActions[compositeId];
this.compositeActions.delete(compositeId);
}
}
@@ -379,8 +371,8 @@ export class ActivitybarPart extends Part implements IActivityBarService {
// Layout composite bar
let availableHeight = contentAreaSize.height;
if (this.globalActionBar) {
availableHeight -= (this.globalActionBar.viewItems.length * ActivitybarPart.ACTION_HEIGHT); // adjust height for global actions showing
if (this.globalActivityActionBar) {
availableHeight -= (this.globalActivityActionBar.viewItems.length * ActivitybarPart.ACTION_HEIGHT); // adjust height for global actions showing
}
this.compositeBar.layout(new Dimension(width, availableHeight));
}

View File

@@ -15,7 +15,7 @@
height: 40px;
line-height: 40px;
margin-right: 0;
padding: 0 0 0 50px;
padding: 0 0 0 48px;
box-sizing: border-box;
font-size: 15px;
}
@@ -54,11 +54,12 @@
position: absolute;
top: 20px;
right: 8px;
font-size: 11px;
font-size: 9px;
font-weight: 600;
min-width: 8px;
height: 18px;
line-height: 18px;
padding: 0 5px;
height: 16px;
line-height: 16px;
padding: 0 4px;
border-radius: 20px;
text-align: center;
}

View File

@@ -4,7 +4,7 @@
*--------------------------------------------------------------------------------------------*/
.monaco-workbench .part.activitybar {
width: 50px;
width: 48px;
}
.monaco-workbench .activitybar > .content {
@@ -24,5 +24,9 @@
}
.monaco-workbench .activitybar > .content > .composite-bar > .monaco-action-bar .action-label.toggle-more {
-webkit-mask: url('ellipsis-global.svg') no-repeat 50% 50%;
-webkit-mask: url('ellipsis-activity-bar.svg') no-repeat 50% 50%;
}
.monaco-workbench .activitybar .global-activity .monaco-action-bar .action-label.update-activity {
-webkit-mask: url('settings-activity-bar.svg') no-repeat 50% 50%;
}

View File

@@ -0,0 +1,5 @@
<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M6 12C6 12.2967 5.91203 12.5867 5.74721 12.8334C5.58238 13.08 5.34812 13.2723 5.07403 13.3858C4.79994 13.4994 4.49834 13.5291 4.20737 13.4712C3.91639 13.4133 3.64912 13.2704 3.43934 13.0607C3.22956 12.8509 3.0867 12.5836 3.02882 12.2926C2.97094 12.0017 3.00065 11.7001 3.11418 11.426C3.22771 11.1519 3.41997 10.9176 3.66665 10.7528C3.91332 10.588 4.20333 10.5 4.5 10.5C4.89783 10.5 5.27936 10.658 5.56066 10.9393C5.84197 11.2206 6 11.6022 6 12Z" fill="white"/>
<path d="M13.5 12C13.5 12.2967 13.412 12.5867 13.2472 12.8334C13.0824 13.08 12.8481 13.2723 12.574 13.3858C12.2999 13.4994 11.9983 13.5291 11.7074 13.4712C11.4164 13.4133 11.1491 13.2704 10.9393 13.0607C10.7296 12.8509 10.5867 12.5836 10.5288 12.2926C10.4709 12.0017 10.5006 11.7001 10.6142 11.426C10.7277 11.1519 10.92 10.9176 11.1666 10.7528C11.4133 10.588 11.7033 10.5 12 10.5C12.3978 10.5 12.7794 10.658 13.0607 10.9393C13.342 11.2206 13.5 11.6022 13.5 12Z" fill="white"/>
<path d="M21 12C21 12.2967 20.912 12.5867 20.7472 12.8334C20.5824 13.08 20.3481 13.2723 20.074 13.3858C19.7999 13.4994 19.4983 13.5291 19.2074 13.4712C18.9164 13.4133 18.6491 13.2704 18.4393 13.0607C18.2296 12.8509 18.0867 12.5836 18.0288 12.2926C17.9709 12.0017 18.0006 11.7001 18.1142 11.426C18.2277 11.1519 18.42 10.9176 18.6666 10.7528C18.9133 10.588 19.2033 10.5 19.5 10.5C19.8978 10.5 20.2794 10.658 20.5607 10.9393C20.842 11.2206 21 11.6022 21 12Z" fill="white"/>
</svg>

After

Width:  |  Height:  |  Size: 1.5 KiB

View File

@@ -1 +0,0 @@
<svg fill="none" height="28" viewBox="0 0 28 28" width="28" xmlns="http://www.w3.org/2000/svg"><path d="m7.53846 13.7692c0 .5477-.16241 1.0831-.4667 1.5385-.30428.4554-.73678.8104-1.24279 1.02s-1.06281.2644-1.59999.1576c-.53718-.1069-1.03061-.3706-1.41789-.7579s-.65103-.8807-.75788-1.4179-.05201-1.094.15759-1.6c.20959-.506.56453-.9385 1.01993-1.2428s.9908-.4667 1.5385-.4667c.73445 0 1.43881.2918 1.95814.8111.51934.5193.81109 1.2237.81109 1.9581zm6.46154-2.7692c-.5477 0-1.0831.1624-1.5385.4667s-.8103.7368-1.0199 1.2428-.2645 1.0628-.1576 1.6c.1068.5372.3706 1.0306.7579 1.4179.3872.3873.8807.651 1.4179.7579.5371.1068 1.0939.052 1.5999-.1576s.9385-.5646 1.2428-1.02.4667-.9908.4667-1.5385c0-.7344-.2917-1.4388-.8111-1.9581-.5193-.5193-1.2237-.8111-1.9581-.8111zm9.2308 0c-.5477 0-1.0831.1624-1.5385.4667s-.8104.7368-1.02 1.2428-.2644 1.0628-.1576 1.6c.1069.5372.3706 1.0306.7579 1.4179s.8807.651 1.4179.7579c.5372.1068 1.094.052 1.6-.1576s.9385-.5646 1.2428-1.02.4667-.9908.4667-1.5385c0-.7344-.2918-1.4388-.8111-1.9581s-1.2237-.8111-1.9581-.8111z" fill="#fff"/></svg>

Before

Width:  |  Height:  |  Size: 1.0 KiB

View File

@@ -0,0 +1,3 @@
<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
<path fill-rule="evenodd" clip-rule="evenodd" d="M14.4198 0L15.2504 4.15289L18.7742 1.80367L22.1963 5.22578L19.8471 8.74964L24 9.58022V14.4198L19.8471 15.2504L22.1963 18.7742L18.7742 22.1963L15.2504 19.8471L14.4198 24H9.5802L8.74962 19.8471L5.22579 22.1963L1.80368 18.7742L4.15291 15.2504L0 14.4198V9.58022L4.1529 8.74964L1.80367 5.2258L5.22578 1.80369L8.74963 4.15292L9.5802 3.68124e-05L14.4198 0ZM18.2347 10.184L17.6927 8.87549L19.9795 5.44529L18.5547 4.02052L15.1245 6.30732L13.816 5.76534L13.0075 1.72278L10.9925 1.7228L10.184 5.76536L8.87549 6.30734L5.4453 4.02055L4.02053 5.44531L6.30734 8.87553L5.7653 10.184L1.72277 10.9926V13.0075L5.7653 13.816L6.30735 15.1245L4.02053 18.5547L5.4453 19.9795L8.87551 17.6927L10.184 18.2347L10.9925 22.2772H13.0075L13.816 18.2347L15.1245 17.6927L18.5547 19.9795L19.9795 18.5547L17.6927 15.1245L18.2347 13.816L22.2772 13.0075V10.9926L18.2347 10.184ZM13.7143 12C13.7143 12.9468 12.9468 13.7143 12 13.7143C11.0532 13.7143 10.2857 12.9468 10.2857 12C10.2857 11.0532 11.0532 10.2857 12 10.2857C12.9468 10.2857 13.7143 11.0532 13.7143 12ZM15.4286 12C15.4286 13.8935 13.8935 15.4286 12 15.4286C10.1065 15.4286 8.57143 13.8935 8.57143 12C8.57143 10.1065 10.1065 8.57143 12 8.57143C13.8935 8.57143 15.4286 10.1065 15.4286 12Z" fill="#F4F4F4"/>
</svg>

After

Width:  |  Height:  |  Size: 1.3 KiB

View File

@@ -201,6 +201,7 @@ export class CompositeBar extends Widget implements ICompositeBar {
const activity: ICompositeActivity = { badge, clazz, priority };
this.model.addActivity(compositeId, activity);
return toDisposable(() => this.model.removeActivity(compositeId, activity));
}
@@ -427,7 +428,7 @@ export class CompositeBar extends Widget implements ICompositeBar {
});
}
private getContextMenuActions(): IAction[] {
private getContextMenuActions(): ReadonlyArray<IAction> {
const actions: IAction[] = this.model.visibleItems
.map(({ id, name, activityAction }) => (<IAction>{
id,

View File

@@ -8,7 +8,7 @@ import { Action } from 'vs/base/common/actions';
import * as dom from 'vs/base/browser/dom';
import { BaseActionViewItem, IBaseActionViewItemOptions, Separator } from 'vs/base/browser/ui/actionbar/actionbar';
import { ICommandService } from 'vs/platform/commands/common/commands';
import { dispose, IDisposable, Disposable, toDisposable } from 'vs/base/common/lifecycle';
import { dispose, toDisposable, MutableDisposable } from 'vs/base/common/lifecycle';
import { IContextMenuService } from 'vs/platform/contextview/browser/contextView';
import { IThemeService, ITheme } from 'vs/platform/theme/common/themeService';
import { TextBadge, NumberBadge, IBadge, IconBadge, ProgressBadge } from 'vs/workbench/services/activity/common/activity';
@@ -52,10 +52,10 @@ export interface ICompositeBar {
export class ActivityAction extends Action {
private _onDidChangeActivity = new Emitter<this>();
get onDidChangeActivity(): Event<this> { return this._onDidChangeActivity.event; }
readonly onDidChangeActivity: Event<this> = this._onDidChangeActivity.event;
private _onDidChangeBadge = new Emitter<this>();
get onDidChangeBadge(): Event<this> { return this._onDidChangeBadge.event; }
readonly onDidChangeBadge: Event<this> = this._onDidChangeBadge.event;
private badge?: IBadge;
private clazz: string | undefined;
@@ -130,7 +130,7 @@ export class ActivityActionViewItem extends BaseActionViewItem {
protected options: IActivityActionViewItemOptions;
private badgeContent: HTMLElement;
private badgeDisposable: IDisposable = Disposable.None;
private readonly badgeDisposable = this._register(new MutableDisposable());
private mouseUpTimeout: any;
constructor(
@@ -236,8 +236,7 @@ export class ActivityActionViewItem extends BaseActionViewItem {
const badge = action.getBadge();
const clazz = action.getClass();
this.badgeDisposable.dispose();
this.badgeDisposable = Disposable.None;
this.badgeDisposable.clear();
dom.clearNode(this.badgeContent);
dom.hide(this.badge);
@@ -280,7 +279,7 @@ export class ActivityActionViewItem extends BaseActionViewItem {
if (clazz) {
dom.addClasses(this.badge, clazz);
this.badgeDisposable = toDisposable(() => dom.removeClasses(this.badge, clazz));
this.badgeDisposable.value = toDisposable(() => dom.removeClasses(this.badge, clazz));
}
}
@@ -549,11 +548,11 @@ export class CompositeActionViewItem extends ActivityActionViewItem {
}));
// Activate on drag over to reveal targets
[this.badge, this.label].forEach(b => new DelayedDragHandler(b, () => {
[this.badge, this.label].forEach(b => this._register(new DelayedDragHandler(b, () => {
if (!this.compositeTransfer.hasData(DraggedCompositeIdentifier.prototype) && !this.getAction().checked) {
this.getAction().run();
}
}));
})));
this.updateStyles();
}

View File

@@ -6,7 +6,7 @@
import 'vs/css!./media/compositepart';
import * as nls from 'vs/nls';
import { defaultGenerator } from 'vs/base/common/idGenerator';
import { IDisposable, dispose, toDisposable } from 'vs/base/common/lifecycle';
import { IDisposable, dispose, DisposableStore, MutableDisposable } from 'vs/base/common/lifecycle';
import * as strings from 'vs/base/common/strings';
import { Emitter } from 'vs/base/common/event';
import * as errors from 'vs/base/common/errors';
@@ -14,17 +14,17 @@ import { ToolBar } from 'vs/base/browser/ui/toolbar/toolbar';
import { IActionViewItem, ActionsOrientation } from 'vs/base/browser/ui/actionbar/actionbar';
import { ProgressBar } from 'vs/base/browser/ui/progressbar/progressbar';
import { prepareActions } from 'vs/workbench/browser/actions';
import { IAction } from 'vs/base/common/actions';
import { IAction, WorkbenchActionExecutedEvent, WorkbenchActionExecutedClassification } from 'vs/base/common/actions';
import { Part, IPartOptions } from 'vs/workbench/browser/part';
import { Composite, CompositeRegistry } from 'vs/workbench/browser/composite';
import { IComposite } from 'vs/workbench/common/composite';
import { ScopedProgressService } from 'vs/workbench/services/progress/browser/progressService';
import { CompositeProgressIndicator } from 'vs/workbench/services/progress/browser/progressIndicator';
import { IWorkbenchLayoutService } from 'vs/workbench/services/layout/browser/layoutService';
import { IStorageService, StorageScope } from 'vs/platform/storage/common/storage';
import { IContextMenuService } from 'vs/platform/contextview/browser/contextView';
import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation';
import { ServiceCollection } from 'vs/platform/instantiation/common/serviceCollection';
import { IProgressService } from 'vs/platform/progress/common/progress';
import { IProgressIndicator, IEditorProgressService } from 'vs/platform/progress/common/progress';
import { ITelemetryService } from 'vs/platform/telemetry/common/telemetry';
import { IKeybindingService } from 'vs/platform/keybinding/common/keybinding';
import { IThemeService } from 'vs/platform/theme/common/themeService';
@@ -50,7 +50,7 @@ export interface ICompositeTitleLabel {
interface CompositeItem {
composite: Composite;
disposable: IDisposable;
progressService: IProgressService;
progress: IProgressIndicator;
}
export abstract class CompositePart<T extends Composite> extends Part {
@@ -60,15 +60,15 @@ export abstract class CompositePart<T extends Composite> extends Part {
protected toolBar: ToolBar;
private mapCompositeToCompositeContainer: { [compositeId: string]: HTMLElement; };
private mapActionsBindingToComposite: { [compositeId: string]: () => void; };
private mapCompositeToCompositeContainer = new Map<string, HTMLElement>();
private mapActionsBindingToComposite = new Map<string, () => void>();
private activeComposite: Composite | null;
private lastActiveCompositeId: string;
private instantiatedCompositeItems: Map<string, CompositeItem>;
private titleLabel: ICompositeTitleLabel;
private progressBar: ProgressBar;
private contentAreaSize: Dimension;
private telemetryActionsListener: IDisposable | null;
private readonly telemetryActionsListener = this._register(new MutableDisposable());
private currentCompositeOpenToken: string;
constructor(
@@ -91,8 +91,6 @@ export abstract class CompositePart<T extends Composite> extends Part {
) {
super(id, options, themeService, storageService, layoutService);
this.mapCompositeToCompositeContainer = {};
this.mapActionsBindingToComposite = {};
this.activeComposite = null;
this.instantiatedCompositeItems = new Map<string, CompositeItem>();
this.lastActiveCompositeId = storageService.get(activeCompositeSettingsKey, StorageScope.WORKSPACE, this.defaultCompositeId);
@@ -171,17 +169,19 @@ export abstract class CompositePart<T extends Composite> extends Part {
// Instantiate composite from registry otherwise
const compositeDescriptor = this.registry.getComposite(id);
if (compositeDescriptor) {
const progressService = this.instantiationService.createInstance(ScopedProgressService, this.progressBar, compositeDescriptor.id, isActive);
const compositeInstantiationService = this.instantiationService.createChild(new ServiceCollection([IProgressService, progressService]));
const compositeProgressIndicator = this.instantiationService.createInstance(CompositeProgressIndicator, this.progressBar, compositeDescriptor.id, isActive);
const compositeInstantiationService = this.instantiationService.createChild(new ServiceCollection(
[IEditorProgressService, compositeProgressIndicator] // provide the editor progress service for any editors instantiated within the composite
));
const composite = compositeDescriptor.instantiate(compositeInstantiationService);
const disposables: IDisposable[] = [];
const disposable = new DisposableStore();
// Remember as Instantiated
this.instantiatedCompositeItems.set(id, { composite, disposable: toDisposable(() => dispose(disposables)), progressService });
this.instantiatedCompositeItems.set(id, { composite, disposable, progress: compositeProgressIndicator });
// Register to title area update events from the composite
composite.onTitleAreaUpdate(() => this.onTitleAreaUpdate(composite.getId()), this, disposables);
disposable.add(composite.onTitleAreaUpdate(() => this.onTitleAreaUpdate(composite.getId()), this));
return composite;
}
@@ -206,7 +206,7 @@ export abstract class CompositePart<T extends Composite> extends Part {
this.lastActiveCompositeId = this.activeComposite.getId();
// Composites created for the first time
let compositeContainer = this.mapCompositeToCompositeContainer[composite.getId()];
let compositeContainer = this.mapCompositeToCompositeContainer.get(composite.getId());
if (!compositeContainer) {
// Build Container off-DOM
@@ -218,13 +218,7 @@ export abstract class CompositePart<T extends Composite> extends Part {
composite.updateStyles();
// Remember composite container
this.mapCompositeToCompositeContainer[composite.getId()] = compositeContainer;
}
// Report progress for slow loading composites (but only if we did not create the composites before already)
const compositeItem = this.instantiatedCompositeItems.get(composite.getId());
if (compositeItem && !compositeContainer) {
compositeItem.progressService.showWhile(Promise.resolve(), this.layoutService.isRestored() ? 800 : 3200 /* less ugly initial startup */);
this.mapCompositeToCompositeContainer.set(composite.getId(), compositeContainer);
}
// Fill Content and Actions
@@ -250,20 +244,15 @@ export abstract class CompositePart<T extends Composite> extends Part {
}
// Handle Composite Actions
let actionsBinding = this.mapActionsBindingToComposite[composite.getId()];
let actionsBinding = this.mapActionsBindingToComposite.get(composite.getId());
if (!actionsBinding) {
actionsBinding = this.collectCompositeActions(composite);
this.mapActionsBindingToComposite[composite.getId()] = actionsBinding;
this.mapActionsBindingToComposite.set(composite.getId(), actionsBinding);
}
actionsBinding();
if (this.telemetryActionsListener) {
this.telemetryActionsListener.dispose();
this.telemetryActionsListener = null;
}
// Action Run Handling
this.telemetryActionsListener = this.toolBar.actionRunner.onDidRun(e => {
this.telemetryActionsListener.value = this.toolBar.actionRunner.onDidRun(e => {
// Check for Error
if (e.error && !errors.isPromiseCanceledError(e.error)) {
@@ -272,13 +261,7 @@ export abstract class CompositePart<T extends Composite> extends Part {
// Log in telemetry
if (this.telemetryService) {
/* __GDPR__
"workbenchActionExecuted" : {
"id" : { "classification": "SystemMetaData", "purpose": "FeatureInsight" },
"from": { "classification": "SystemMetaData", "purpose": "FeatureInsight" }
}
*/
this.telemetryService.publicLog('workbenchActionExecuted', { id: e.action.id, from: this.nameForTelemetry });
this.telemetryService.publicLog2<WorkbenchActionExecutedEvent, WorkbenchActionExecutedClassification>('workbenchActionExecuted', { id: e.action.id, from: this.nameForTelemetry });
}
});
@@ -306,13 +289,13 @@ export abstract class CompositePart<T extends Composite> extends Part {
// Actions
const actionsBinding = this.collectCompositeActions(this.activeComposite);
this.mapActionsBindingToComposite[this.activeComposite.getId()] = actionsBinding;
this.mapActionsBindingToComposite.set(this.activeComposite.getId(), actionsBinding);
actionsBinding();
}
// Otherwise invalidate actions binding for next time when the composite becomes visible
else {
delete this.mapActionsBindingToComposite[compositeId];
this.mapActionsBindingToComposite.delete(compositeId);
}
}
@@ -366,14 +349,16 @@ export abstract class CompositePart<T extends Composite> extends Part {
const composite = this.activeComposite;
this.activeComposite = null;
const compositeContainer = this.mapCompositeToCompositeContainer[composite.getId()];
const compositeContainer = this.mapCompositeToCompositeContainer.get(composite.getId());
// Indicate to Composite
composite.setVisible(false);
// Take Container Off-DOM and hide
compositeContainer.remove();
hide(compositeContainer);
if (compositeContainer) {
compositeContainer.remove();
hide(compositeContainer);
}
// Clear any running Progress
this.progressBar.stop().hide();
@@ -462,17 +447,17 @@ export abstract class CompositePart<T extends Composite> extends Part {
return contentContainer;
}
getProgressIndicator(id: string): IProgressService | null {
getProgressIndicator(id: string): IProgressIndicator | null {
const compositeItem = this.instantiatedCompositeItems.get(id);
return compositeItem ? compositeItem.progressService : null;
return compositeItem ? compositeItem.progress : null;
}
protected getActions(): IAction[] {
protected getActions(): ReadonlyArray<IAction> {
return [];
}
protected getSecondaryActions(): IAction[] {
protected getSecondaryActions(): ReadonlyArray<IAction> {
return [];
}
@@ -496,8 +481,8 @@ export abstract class CompositePart<T extends Composite> extends Part {
return false; // do not remove active composite
}
delete this.mapCompositeToCompositeContainer[compositeId];
delete this.mapActionsBindingToComposite[compositeId];
this.mapCompositeToCompositeContainer.delete(compositeId);
this.mapActionsBindingToComposite.delete(compositeId);
const compositeItem = this.instantiatedCompositeItems.get(compositeId);
if (compositeItem) {
compositeItem.composite.dispose();
@@ -509,8 +494,8 @@ export abstract class CompositePart<T extends Composite> extends Part {
}
dispose(): void {
this.mapCompositeToCompositeContainer = null!; // StrictNullOverride: nulling out ok in dispose
this.mapActionsBindingToComposite = null!; // StrictNullOverride: nulling out ok in dispose
this.mapCompositeToCompositeContainer.clear();
this.mapActionsBindingToComposite.clear();
this.instantiatedCompositeItems.forEach(compositeItem => {
compositeItem.composite.dispose();

View File

@@ -15,6 +15,7 @@ import { URI } from 'vs/base/common/uri';
import { Event } from 'vs/base/common/event';
import { isEmptyObject } from 'vs/base/common/types';
import { DEFAULT_EDITOR_MIN_DIMENSIONS, DEFAULT_EDITOR_MAX_DIMENSIONS } from 'vs/workbench/browser/parts/editor/editor';
import { MementoObject } from 'vs/workbench/common/memento';
/**
* The base class of editors in the workbench. Editors register themselves for specific editor inputs.
@@ -177,7 +178,7 @@ export class EditorMemento<T> implements IEditorMemento<T> {
constructor(
private _id: string,
private key: string,
private memento: object,
private memento: MementoObject,
private limit: number,
private editorGroupService: IEditorGroupsService
) { }

View File

@@ -15,11 +15,12 @@ import { IThemeService } from 'vs/platform/theme/common/themeService';
import { ResourceViewerContext, ResourceViewer } from 'vs/workbench/browser/parts/editor/resourceViewer';
import { URI } from 'vs/base/common/uri';
import { Dimension, size, clearNode } from 'vs/base/browser/dom';
import { ITextFileService } from 'vs/workbench/services/textfile/common/textfiles';
import { CancellationToken } from 'vs/base/common/cancellation';
import { dispose } from 'vs/base/common/lifecycle';
import { IStorageService } from 'vs/platform/storage/common/storage';
import { IWorkbenchEnvironmentService } from 'vs/workbench/services/environment/common/environmentService';
import { IFileService } from 'vs/platform/files/common/files';
import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation';
export interface IOpenCallbacks {
openInternal: (input: EditorInput, options: EditorOptions) => Promise<void>;
@@ -32,10 +33,10 @@ export interface IOpenCallbacks {
export abstract class BaseBinaryResourceEditor extends BaseEditor {
private readonly _onMetadataChanged: Emitter<void> = this._register(new Emitter<void>());
get onMetadataChanged(): Event<void> { return this._onMetadataChanged.event; }
readonly onMetadataChanged: Event<void> = this._onMetadataChanged.event;
private readonly _onDidOpenInPlace: Emitter<void> = this._register(new Emitter<void>());
get onDidOpenInPlace(): Event<void> { return this._onDidOpenInPlace.event; }
readonly onDidOpenInPlace: Event<void> = this._onDidOpenInPlace.event;
private callbacks: IOpenCallbacks;
private metadata: string | undefined;
@@ -48,9 +49,10 @@ export abstract class BaseBinaryResourceEditor extends BaseEditor {
callbacks: IOpenCallbacks,
telemetryService: ITelemetryService,
themeService: IThemeService,
@ITextFileService private readonly textFileService: ITextFileService,
@IFileService private readonly fileService: IFileService,
@IWorkbenchEnvironmentService private readonly environmentService: IWorkbenchEnvironmentService,
@IStorageService storageService: IStorageService
@IStorageService storageService: IStorageService,
@IInstantiationService private readonly instantiationService: IInstantiationService,
) {
super(id, telemetryService, themeService, storageService);
@@ -89,11 +91,15 @@ export abstract class BaseBinaryResourceEditor extends BaseEditor {
}
// Render Input
this.resourceViewerContext = ResourceViewer.show({ name: model.getName(), resource: model.getResource(), size: model.getSize(), etag: model.getETag(), mime: model.getMime() }, this.textFileService, this.binaryContainer, this.scrollbar, {
if (this.resourceViewerContext) {
this.resourceViewerContext.dispose();
}
this.resourceViewerContext = ResourceViewer.show({ name: model.getName(), resource: model.getResource(), size: model.getSize(), etag: model.getETag(), mime: model.getMime() }, this.fileService, this.binaryContainer, this.scrollbar, {
openInternalClb: () => this.handleOpenInternalCallback(input, options),
openExternalClb: this.environmentService.configuration.remoteAuthority ? undefined : resource => this.callbacks.openExternal(resource),
metadataClb: meta => this.handleMetadataChanged(meta)
});
}, this.instantiationService);
}
private async handleOpenInternalCallback(input: EditorInput, options: EditorOptions): Promise<void> {

View File

@@ -71,7 +71,6 @@ export abstract class BreadcrumbsConfig<T> {
static FilePath = BreadcrumbsConfig._stub<'on' | 'off' | 'last'>('breadcrumbs.filePath');
static SymbolPath = BreadcrumbsConfig._stub<'on' | 'off' | 'last'>('breadcrumbs.symbolPath');
static SymbolSortOrder = BreadcrumbsConfig._stub<'position' | 'name' | 'type'>('breadcrumbs.symbolSortOrder');
static FilterOnType = BreadcrumbsConfig._stub<boolean>('breadcrumbs.filterOnType');
static FileExcludes = BreadcrumbsConfig._stub<glob.IExpression>('files.exclude');
@@ -122,7 +121,7 @@ Registry.as<IConfigurationRegistry>(Extensions.Configuration).registerConfigurat
'breadcrumbs.enabled': {
description: localize('enabled', "Enable/disable navigation breadcrumbs."),
type: 'boolean',
default: false
default: true
},
// 'breadcrumbs.useQuickPick': {
// description: localize('useQuickPick', "Use quick pick instead of breadcrumb-pickers."),
@@ -161,12 +160,7 @@ Registry.as<IConfigurationRegistry>(Extensions.Configuration).registerConfigurat
localize('symbolSortOrder.name', "Show symbol outline in alphabetical order."),
localize('symbolSortOrder.type', "Show symbol outline in symbol type order."),
]
},
// 'breadcrumbs.filterOnType': {
// description: localize('filterOnType', "Controls whether the breadcrumb picker filters or highlights when typing."),
// type: 'boolean',
// default: false
// },
}
}
});

View File

@@ -10,8 +10,7 @@ import { IconLabel } from 'vs/base/browser/ui/iconLabel/iconLabel';
import { tail } from 'vs/base/common/arrays';
import { timeout } from 'vs/base/common/async';
import { KeyCode, KeyMod } from 'vs/base/common/keyCodes';
import { combinedDisposable, dispose, IDisposable } from 'vs/base/common/lifecycle';
import { Schemas } from 'vs/base/common/network';
import { combinedDisposable, DisposableStore } from 'vs/base/common/lifecycle';
import { isEqual } from 'vs/base/common/resources';
import { URI } from 'vs/base/common/uri';
import 'vs/css!./media/breadcrumbscontrol';
@@ -51,7 +50,7 @@ import { ILabelService } from 'vs/platform/label/common/label';
class Item extends BreadcrumbsItem {
private readonly _disposables: IDisposable[] = [];
private readonly _disposables = new DisposableStore();
constructor(
readonly element: BreadcrumbElement,
@@ -62,7 +61,7 @@ class Item extends BreadcrumbsItem {
}
dispose(): void {
dispose(this._disposables);
this._disposables.dispose();
}
equals(other: BreadcrumbsItem): boolean {
@@ -89,7 +88,7 @@ class Item extends BreadcrumbsItem {
fileDecorations: { colors: this.options.showDecorationColors, badges: false },
});
dom.addClass(container, FileKind[this.element.kind].toLowerCase());
this._disposables.push(label);
this._disposables.add(label);
} else if (this.element instanceof OutlineModel) {
// has outline element but not in one
@@ -102,7 +101,7 @@ class Item extends BreadcrumbsItem {
// provider
let label = new IconLabel(container);
label.setLabel(this.element.provider.displayName);
this._disposables.push(label);
this._disposables.add(label);
} else if (this.element instanceof OutlineElement) {
// symbol
@@ -115,7 +114,7 @@ class Item extends BreadcrumbsItem {
let label = new IconLabel(container);
let title = this.element.symbol.name.replace(/\r|\n|\r\n/g, '\u23CE');
label.setLabel(title);
this._disposables.push(label);
this._disposables.add(label);
}
}
}
@@ -148,8 +147,8 @@ export class BreadcrumbsControl {
readonly domNode: HTMLDivElement;
private readonly _widget: BreadcrumbsWidget;
private _disposables = new Array<IDisposable>();
private _breadcrumbsDisposables = new Array<IDisposable>();
private readonly _disposables = new DisposableStore();
private readonly _breadcrumbsDisposables = new DisposableStore();
private _breadcrumbsPickerShowing = false;
private _breadcrumbsPickerIgnoreOnceItem: BreadcrumbsItem | undefined;
@@ -179,7 +178,7 @@ export class BreadcrumbsControl {
this._widget.onDidSelectItem(this._onSelectEvent, this, this._disposables);
this._widget.onDidFocusItem(this._onFocusEvent, this, this._disposables);
this._widget.onDidChangeFocus(this._updateCkBreadcrumbsActive, this, this._disposables);
this._disposables.push(attachBreadcrumbsStyler(this._widget, this._themeService, { breadcrumbsBackground: _options.breadcrumbsBackground }));
this._disposables.add(attachBreadcrumbsStyler(this._widget, this._themeService, { breadcrumbsBackground: _options.breadcrumbsBackground }));
this._ckBreadcrumbsPossible = BreadcrumbsControl.CK_BreadcrumbsPossible.bindTo(this._contextKeyService);
this._ckBreadcrumbsVisible = BreadcrumbsControl.CK_BreadcrumbsVisible.bindTo(this._contextKeyService);
@@ -187,12 +186,12 @@ export class BreadcrumbsControl {
this._cfUseQuickPick = BreadcrumbsConfig.UseQuickPick.bindTo(_configurationService);
this._disposables.push(breadcrumbsService.register(this._editorGroup.id, this._widget));
this._disposables.add(breadcrumbsService.register(this._editorGroup.id, this._widget));
}
dispose(): void {
this._disposables = dispose(this._disposables);
this._breadcrumbsDisposables = dispose(this._breadcrumbsDisposables);
this._disposables.dispose();
this._breadcrumbsDisposables.dispose();
this._ckBreadcrumbsPossible.reset();
this._ckBreadcrumbsVisible.reset();
this._ckBreadcrumbsActive.reset();
@@ -210,13 +209,13 @@ export class BreadcrumbsControl {
}
hide(): void {
this._breadcrumbsDisposables = dispose(this._breadcrumbsDisposables);
this._breadcrumbsDisposables.clear();
this._ckBreadcrumbsVisible.set(false);
dom.toggleClass(this.domNode, 'hidden', true);
}
update(): boolean {
this._breadcrumbsDisposables = dispose(this._breadcrumbsDisposables);
this._breadcrumbsDisposables.clear();
// honor diff editors and such
let input = this._editorGroup.activeEditor;
@@ -224,7 +223,7 @@ export class BreadcrumbsControl {
input = input.master;
}
if (!input || !input.getResource() || (input.getResource()!.scheme !== Schemas.untitled && !this._fileService.canHandleResource(input.getResource()!))) {
if (!input || !input.getResource() || !this._fileService.canHandleResource(input.getResource()!)) {
// cleanup and return when there is no input or when
// we cannot handle this input
this._ckBreadcrumbsPossible.set(false);
@@ -253,10 +252,12 @@ export class BreadcrumbsControl {
};
const listener = model.onDidUpdate(updateBreadcrumbs);
updateBreadcrumbs();
this._breadcrumbsDisposables = [model, listener];
this._breadcrumbsDisposables.clear();
this._breadcrumbsDisposables.add(model);
this._breadcrumbsDisposables.add(listener);
// close picker on hide/update
this._breadcrumbsDisposables.push({
this._breadcrumbsDisposables.add({
dispose: () => {
if (this._breadcrumbsPickerShowing) {
this._contextViewService.hideContextView(this);
@@ -283,7 +284,8 @@ export class BreadcrumbsControl {
private _onFocusEvent(event: IBreadcrumbsItemEvent): void {
if (event.item && this._breadcrumbsPickerShowing) {
return this._widget.setSelection(event.item);
this._breadcrumbsPickerIgnoreOnceItem = undefined;
this._widget.setSelection(event.item);
}
}
@@ -328,6 +330,7 @@ export class BreadcrumbsControl {
// show picker
let picker: BreadcrumbsPicker;
let pickerAnchor: { x: number; y: number };
let editor = this._getActiveCodeEditor();
let editorDecorations: string[] = [];
let editorViewState: ICodeEditorViewState | undefined;
@@ -384,44 +387,47 @@ export class BreadcrumbsControl {
this._breadcrumbsPickerShowing = true;
this._updateCkBreadcrumbsActive();
return combinedDisposable([
return combinedDisposable(
picker,
selectListener,
focusListener,
zoomListener,
focusTracker,
blurListener
]);
);
},
getAnchor: () => {
let maxInnerWidth = window.innerWidth - 8 /*a little less the full widget*/;
let maxHeight = Math.min(window.innerHeight * 0.7, 300);
if (!pickerAnchor) {
let maxInnerWidth = window.innerWidth - 8 /*a little less the full widget*/;
let maxHeight = Math.min(window.innerHeight * 0.7, 300);
let pickerWidth = Math.min(maxInnerWidth, Math.max(240, maxInnerWidth / 4.17));
let pickerArrowSize = 8;
let pickerArrowOffset: number;
let pickerWidth = Math.min(maxInnerWidth, Math.max(240, maxInnerWidth / 4.17));
let pickerArrowSize = 8;
let pickerArrowOffset: number;
let data = dom.getDomNodePagePosition(event.node.firstChild as HTMLElement);
let y = data.top + data.height + pickerArrowSize;
if (y + maxHeight >= window.innerHeight) {
maxHeight = window.innerHeight - y - 30 /* room for shadow and status bar*/;
}
let x = data.left;
if (x + pickerWidth >= maxInnerWidth) {
x = maxInnerWidth - pickerWidth;
}
if (event.payload instanceof StandardMouseEvent) {
let maxPickerArrowOffset = pickerWidth - 2 * pickerArrowSize;
pickerArrowOffset = event.payload.posx - x;
if (pickerArrowOffset > maxPickerArrowOffset) {
x = Math.min(maxInnerWidth - pickerWidth, x + pickerArrowOffset - maxPickerArrowOffset);
pickerArrowOffset = maxPickerArrowOffset;
let data = dom.getDomNodePagePosition(event.node.firstChild as HTMLElement);
let y = data.top + data.height + pickerArrowSize;
if (y + maxHeight >= window.innerHeight) {
maxHeight = window.innerHeight - y - 30 /* room for shadow and status bar*/;
}
} else {
pickerArrowOffset = (data.left + (data.width * 0.3)) - x;
let x = data.left;
if (x + pickerWidth >= maxInnerWidth) {
x = maxInnerWidth - pickerWidth;
}
if (event.payload instanceof StandardMouseEvent) {
let maxPickerArrowOffset = pickerWidth - 2 * pickerArrowSize;
pickerArrowOffset = event.payload.posx - x;
if (pickerArrowOffset > maxPickerArrowOffset) {
x = Math.min(maxInnerWidth - pickerWidth, x + pickerArrowOffset - maxPickerArrowOffset);
pickerArrowOffset = maxPickerArrowOffset;
}
} else {
pickerArrowOffset = (data.left + (data.width * 0.3)) - x;
}
picker.show(element, maxHeight, pickerWidth, pickerArrowSize, Math.max(0, pickerArrowOffset));
pickerAnchor = { x, y };
}
picker.show(element, maxHeight, pickerWidth, pickerArrowSize, Math.max(0, pickerArrowOffset));
return { x, y };
return pickerAnchor;
},
onHide: (data) => {
if (editor) {
@@ -490,21 +496,21 @@ export class BreadcrumbsControl {
MenuRegistry.appendMenuItem(MenuId.CommandPalette, {
command: {
id: 'breadcrumbs.toggle',
title: { value: localize('cmd.toggle', "Toggle Breadcrumbs"), original: 'View: Toggle Breadcrumbs' },
category: localize('cmd.category', "View")
title: { value: localize('cmd.toggle', "Toggle Breadcrumbs"), original: 'Toggle Breadcrumbs' },
category: { value: localize('cmd.category', "View"), original: 'View' }
}
});
// {{SQL CARBON EDIT}} - Disable unused menu item
// MenuRegistry.appendMenuItem(MenuId.MenubarViewMenu, {
// group: '5_editor',
// order: 99,
// command: {
// id: 'breadcrumbs.toggle',
// title: localize('miToggleBreadcrumbs', "Toggle &&Breadcrumbs"),
// toggled: ContextKeyExpr.equals('config.breadcrumbs.enabled', true)
// }
// });
// {{SQL CARBON EDIT}} - End
/* {{SQL CARBON EDIT}} - Disable unused menu item
MenuRegistry.appendMenuItem(MenuId.MenubarViewMenu, {
group: '5_editor',
order: 3,
command: {
id: 'breadcrumbs.toggle',
title: localize('miShowBreadcrumbs', "Show &&Breadcrumbs"),
toggled: ContextKeyExpr.equals('config.breadcrumbs.enabled', true)
}
});
*/
CommandsRegistry.registerCommand('breadcrumbs.toggle', accessor => {
let config = accessor.get(IConfigurationService);
let value = BreadcrumbsConfig.IsEnabled.bindTo(config).getValue();
@@ -608,6 +614,42 @@ KeybindingsRegistry.registerCommandAndKeybindingRule({
widget.focusPrev();
}
});
KeybindingsRegistry.registerCommandAndKeybindingRule({
id: 'breadcrumbs.focusNextWithPicker',
weight: KeybindingWeight.WorkbenchContrib + 1,
primary: KeyMod.CtrlCmd | KeyCode.RightArrow,
mac: {
primary: KeyMod.Alt | KeyCode.RightArrow,
},
when: ContextKeyExpr.and(BreadcrumbsControl.CK_BreadcrumbsVisible, BreadcrumbsControl.CK_BreadcrumbsActive, WorkbenchListFocusContextKey),
handler(accessor) {
const groups = accessor.get(IEditorGroupsService);
const breadcrumbs = accessor.get(IBreadcrumbsService);
const widget = breadcrumbs.getWidget(groups.activeGroup.id);
if (!widget) {
return;
}
widget.focusNext();
}
});
KeybindingsRegistry.registerCommandAndKeybindingRule({
id: 'breadcrumbs.focusPreviousWithPicker',
weight: KeybindingWeight.WorkbenchContrib + 1,
primary: KeyMod.CtrlCmd | KeyCode.LeftArrow,
mac: {
primary: KeyMod.Alt | KeyCode.LeftArrow,
},
when: ContextKeyExpr.and(BreadcrumbsControl.CK_BreadcrumbsVisible, BreadcrumbsControl.CK_BreadcrumbsActive, WorkbenchListFocusContextKey),
handler(accessor) {
const groups = accessor.get(IEditorGroupsService);
const breadcrumbs = accessor.get(IBreadcrumbsService);
const widget = breadcrumbs.getWidget(groups.activeGroup.id);
if (!widget) {
return;
}
widget.focusPrev();
}
});
KeybindingsRegistry.registerCommandAndKeybindingRule({
id: 'breadcrumbs.selectFocused',
weight: KeybindingWeight.WorkbenchContrib,
@@ -667,7 +709,7 @@ KeybindingsRegistry.registerCommandAndKeybindingRule({
handler(accessor) {
const editors = accessor.get(IEditorService);
const lists = accessor.get(IListService);
const element = lists.lastFocusedList ? <OutlineElement | IFileStat>lists.lastFocusedList.getFocus() : undefined;
const element = lists.lastFocusedList ? <OutlineElement | IFileStat>lists.lastFocusedList.getFocus()[0] : undefined;
if (element instanceof OutlineElement) {
const outlineElement = OutlineModel.get(element);
if (!outlineElement) {

View File

@@ -9,13 +9,13 @@ import { onUnexpectedError } from 'vs/base/common/errors';
import { Emitter, Event } from 'vs/base/common/event';
import { createMatches, FuzzyScore } from 'vs/base/common/filters';
import * as glob from 'vs/base/common/glob';
import { dispose, IDisposable } from 'vs/base/common/lifecycle';
import { DisposableStore } from 'vs/base/common/lifecycle';
import { posix } from 'vs/base/common/path';
import { basename, dirname, isEqual } from 'vs/base/common/resources';
import { URI } from 'vs/base/common/uri';
import 'vs/css!./media/breadcrumbscontrol';
import { OutlineElement, OutlineModel, TreeElement } from 'vs/editor/contrib/documentSymbols/outlineModel';
import { IConfigurationService, ConfigurationTarget } from 'vs/platform/configuration/common/configuration';
import { IConfigurationService } from 'vs/platform/configuration/common/configuration';
import { FileKind, IFileService, IFileStat } from 'vs/platform/files/common/files';
import { IConstructorSignature1, IInstantiationService } from 'vs/platform/instantiation/common/instantiation';
import { WorkbenchDataTree, WorkbenchAsyncDataTree } from 'vs/platform/list/browser/listService';
@@ -55,7 +55,7 @@ export interface SelectEvent {
export abstract class BreadcrumbsPicker {
protected readonly _disposables = new Array<IDisposable>();
protected readonly _disposables = new DisposableStore();
protected readonly _domNode: HTMLDivElement;
protected _arrow: HTMLDivElement;
protected _treeContainer: HTMLDivElement;
@@ -81,7 +81,7 @@ export abstract class BreadcrumbsPicker {
}
dispose(): void {
dispose(this._disposables);
this._disposables.dispose();
this._onDidPickElement.dispose();
this._tree.dispose();
}
@@ -102,14 +102,10 @@ export abstract class BreadcrumbsPicker {
this._treeContainer.style.boxShadow = `0px 5px 8px ${this._themeService.getTheme().getColor(widgetShadow)}`;
this._domNode.appendChild(this._treeContainer);
const filterConfig = BreadcrumbsConfig.FilterOnType.bindTo(this._configurationService);
this._disposables.push(filterConfig);
this._layoutInfo = { maxHeight, width, arrowSize, arrowOffset, inputHeight: 0 };
this._tree = this._createTree(this._treeContainer);
this._disposables.push(this._tree.onDidChangeSelection(e => {
this._disposables.add(this._tree.onDidChangeSelection(e => {
if (e.browserEvent !== this._fakeEvent) {
const target = this._getTargetFromEvent(e.elements[0]);
if (target) {
@@ -119,23 +115,16 @@ export abstract class BreadcrumbsPicker {
}
}
}));
this._disposables.push(this._tree.onDidChangeFocus(e => {
this._disposables.add(this._tree.onDidChangeFocus(e => {
const target = this._getTargetFromEvent(e.elements[0]);
if (target) {
this._onDidFocusElement.fire({ target, browserEvent: e.browserEvent || new UIEvent('fake') });
}
}));
this._disposables.push(this._tree.onDidChangeContentHeight(() => {
this._disposables.add(this._tree.onDidChangeContentHeight(() => {
this._layout();
}));
// filter on type: state
const cfgFilterOnType = BreadcrumbsConfig.FilterOnType.bindTo(this._configurationService);
this._tree.updateOptions({ filterOnType: cfgFilterOnType.getValue() });
this._disposables.push(this._tree.onDidUpdateOptions(e => {
this._configurationService.updateValue(cfgFilterOnType.name, e.filterOnType, ConfigurationTarget.MEMORY);
}));
this._domNode.focus();
this._setInput(input).then(() => {
@@ -287,7 +276,7 @@ class FileNavigationLabelProvider implements IKeyboardNavigationLabelProvider<IW
class FileFilter implements ITreeFilter<IWorkspaceFolder | IFileStat> {
private readonly _cachedExpressions = new Map<string, glob.ParsedExpression>();
private readonly _disposables: IDisposable[] = [];
private readonly _disposables = new DisposableStore();
constructor(
@IWorkspaceContextService private readonly _workspaceService: IWorkspaceContextService,
@@ -317,15 +306,13 @@ class FileFilter implements ITreeFilter<IWorkspaceFolder | IFileStat> {
});
};
update();
this._disposables.push(
config,
config.onDidChange(update),
_workspaceService.onDidChangeWorkspaceFolders(update)
);
this._disposables.add(config);
this._disposables.add(config.onDidChange(update));
this._disposables.add(_workspaceService.onDidChangeWorkspaceFolders(update));
}
dispose(): void {
dispose(this._disposables);
this._disposables.dispose();
}
filter(element: IWorkspaceFolder | IFileStat, _parentVisibility: TreeVisibility): boolean {
@@ -382,14 +369,13 @@ export class BreadcrumbsFilePicker extends BreadcrumbsPicker {
dom.toggleClass(this._treeContainer, 'align-icons-and-twisties', fileIconTheme.hasFileIcons && !fileIconTheme.hasFolderIcons);
dom.toggleClass(this._treeContainer, 'hide-arrows', fileIconTheme.hidesExplorerArrows === true);
};
this._disposables.push(this._themeService.onDidFileIconThemeChange(onFileIconThemeChange));
this._disposables.add(this._themeService.onDidFileIconThemeChange(onFileIconThemeChange));
onFileIconThemeChange(this._themeService.getFileIconTheme());
const labels = this._instantiationService.createInstance(ResourceLabels, DEFAULT_LABELS_CONTAINER /* TODO@Jo visibility propagation */);
this._disposables.push(labels);
this._disposables.add(labels);
return this._instantiationService.createInstance(WorkbenchAsyncDataTree, container, new FileVirtualDelegate(), [this._instantiationService.createInstance(FileRenderer, labels)], this._instantiationService.createInstance(FileDataSource), {
filterOnType: true,
multipleSelectionSupport: false,
sorter: new FileSorter(),
filter: this._instantiationService.createInstance(FileFilter),
@@ -467,12 +453,11 @@ export class BreadcrumbsOutlinePicker extends BreadcrumbsPicker {
[new OutlineGroupRenderer(), this._instantiationService.createInstance(OutlineElementRenderer)],
new OutlineDataSource(),
{
filterOnType: true,
expandOnlyOnTwistieClick: true,
multipleSelectionSupport: false,
sorter: new OutlineItemComparator(this._getOutlineItemCompareType()),
identityProvider: new OutlineIdentityProvider(),
keyboardNavigationLabelProvider: this._instantiationService.createInstance(OutlineNavigationLabelProvider)
keyboardNavigationLabelProvider: new OutlineNavigationLabelProvider()
}
) as WorkbenchDataTree<OutlineModel, OutlineItem, FuzzyScore>;
}

View File

@@ -8,10 +8,8 @@ import * as nls from 'vs/nls';
import { URI, UriComponents } from 'vs/base/common/uri';
import { Action, IAction } from 'vs/base/common/actions';
import { IEditorQuickOpenEntry, IQuickOpenRegistry, Extensions as QuickOpenExtensions, QuickOpenHandlerDescriptor } from 'vs/workbench/browser/quickopen';
import { StatusbarItemDescriptor, IStatusbarRegistry, Extensions as StatusExtensions } from 'vs/workbench/browser/parts/statusbar/statusbar';
import { StatusbarAlignment } from 'vs/platform/statusbar/common/statusbar';
import { IEditorRegistry, EditorDescriptor, Extensions as EditorExtensions } from 'vs/workbench/browser/editor';
import { EditorInput, IEditorInputFactory, SideBySideEditorInput, IEditorInputFactoryRegistry, Extensions as EditorInputExtensions, TextCompareEditorActiveContext } from 'vs/workbench/common/editor';
import { EditorInput, IEditorInputFactory, SideBySideEditorInput, IEditorInputFactoryRegistry, Extensions as EditorInputExtensions, TextCompareEditorActiveContext, EditorPinnedContext, EditorGroupEditorsCountContext } from 'vs/workbench/common/editor';
import { TextResourceEditor } from 'vs/workbench/browser/parts/editor/textResourceEditor';
import { SideBySideEditor } from 'vs/workbench/browser/parts/editor/sideBySideEditor';
import { DiffEditorInput } from 'vs/workbench/common/editor/diffEditorInput';
@@ -49,9 +47,11 @@ import { isMacintosh } from 'vs/base/common/platform';
import { AllEditorsPicker, ActiveEditorGroupPicker } from 'vs/workbench/browser/parts/editor/editorPicker';
import { registerEditorContribution } from 'vs/editor/browser/editorExtensions';
import { OpenWorkspaceButtonContribution } from 'vs/workbench/browser/parts/editor/editorWidgets';
import { ZoomStatusbarItem } from 'vs/workbench/browser/parts/editor/resourceViewer';
import { IWorkbenchEnvironmentService } from 'vs/workbench/services/environment/common/environmentService';
import { toLocalResource } from 'vs/base/common/resources';
import { Extensions as WorkbenchExtensions, IWorkbenchContributionsRegistry } from 'vs/workbench/common/contributions';
import { LifecyclePhase } from 'vs/platform/lifecycle/common/lifecycle';
import { withNullAsUndefined } from 'vs/base/common/types';
// Register String Editor
Registry.as<IEditorRegistry>(EditorExtensions.Editors).registerEditor(
@@ -211,7 +211,7 @@ class SideBySideEditorInputFactory implements IEditorInputFactory {
const masterInput = masterInputFactory.deserialize(instantiationService, deserialized.masterSerialized);
if (detailsInput && masterInput) {
return new SideBySideEditorInput(deserialized.name, deserialized.description, detailsInput, masterInput);
return new SideBySideEditorInput(deserialized.name, withNullAsUndefined(deserialized.description), detailsInput, masterInput);
}
}
@@ -225,11 +225,7 @@ Registry.as<IEditorInputFactoryRegistry>(EditorInputExtensions.EditorInputFactor
registerEditorContribution(OpenWorkspaceButtonContribution);
// Register Editor Status
const statusBar = Registry.as<IStatusbarRegistry>(StatusExtensions.Statusbar);
statusBar.registerStatusbarItem(new StatusbarItemDescriptor(EditorStatus, StatusbarAlignment.RIGHT, 100 /* towards the left of the right hand side */));
// Register Zoom Status
statusBar.registerStatusbarItem(new StatusbarItemDescriptor(ZoomStatusbarItem, StatusbarAlignment.RIGHT, 101 /* to the left of editor status (100) */));
Registry.as<IWorkbenchContributionsRegistry>(WorkbenchExtensions.Workbench).registerWorkbenchContribution(EditorStatus, LifecyclePhase.Ready);
// Register Status Actions
const registry = Registry.as<IWorkbenchActionRegistry>(ActionExtensions.WorkbenchActions);
@@ -250,7 +246,7 @@ export class QuickOpenActionContributor extends ActionBarContributor {
return !!entry;
}
getActions(context: any): IAction[] {
getActions(context: any): ReadonlyArray<IAction> {
const actions: Action[] = [];
const entry = this.getEntry(context);
@@ -330,7 +326,7 @@ registry.registerWorkbenchAction(new SyncActionDescriptor(ReopenClosedEditorActi
registry.registerWorkbenchAction(new SyncActionDescriptor(ClearRecentFilesAction, ClearRecentFilesAction.ID, ClearRecentFilesAction.LABEL), 'File: Clear Recently Opened', nls.localize('file', "File"));
registry.registerWorkbenchAction(new SyncActionDescriptor(CloseAllEditorsAction, CloseAllEditorsAction.ID, CloseAllEditorsAction.LABEL, { primary: KeyChord(KeyMod.CtrlCmd | KeyCode.KEY_K, KeyMod.CtrlCmd | KeyCode.KEY_W) }), 'View: Close All Editors', category);
registry.registerWorkbenchAction(new SyncActionDescriptor(CloseAllEditorGroupsAction, CloseAllEditorGroupsAction.ID, CloseAllEditorGroupsAction.LABEL, { primary: KeyChord(KeyMod.CtrlCmd | KeyCode.KEY_K, KeyMod.CtrlCmd | KeyMod.Shift | KeyCode.KEY_W) }), 'View: Close All Editor Groups', category);
registry.registerWorkbenchAction(new SyncActionDescriptor(CloseLeftEditorsInGroupAction, CloseLeftEditorsInGroupAction.ID, CloseLeftEditorsInGroupAction.LABEL), 'View: Close Editors in Group to the Left', category);
registry.registerWorkbenchAction(new SyncActionDescriptor(CloseLeftEditorsInGroupAction, CloseLeftEditorsInGroupAction.ID, CloseLeftEditorsInGroupAction.LABEL), 'View: Close Editors to the Left in Group', category);
registry.registerWorkbenchAction(new SyncActionDescriptor(CloseEditorsInOtherGroupsAction, CloseEditorsInOtherGroupsAction.ID, CloseEditorsInOtherGroupsAction.LABEL), 'View: Close Editors in Other Groups', category);
registry.registerWorkbenchAction(new SyncActionDescriptor(CloseEditorInAllGroupsAction, CloseEditorInAllGroupsAction.ID, CloseEditorInAllGroupsAction.LABEL), 'View: Close Editor in All Groups', category);
registry.registerWorkbenchAction(new SyncActionDescriptor(SplitEditorAction, SplitEditorAction.ID, SplitEditorAction.LABEL, { primary: KeyMod.CtrlCmd | KeyCode.US_BACKSLASH }), 'View: Split Editor', category);
@@ -339,8 +335,8 @@ registry.registerWorkbenchAction(new SyncActionDescriptor(SplitEditorLeftAction,
registry.registerWorkbenchAction(new SyncActionDescriptor(SplitEditorRightAction, SplitEditorRightAction.ID, SplitEditorRightAction.LABEL), 'View: Split Editor Right', category);
registry.registerWorkbenchAction(new SyncActionDescriptor(SplitEditorUpAction, SplitEditorUpAction.ID, SplitEditorUpAction.LABEL), 'Split Editor Up', category);
registry.registerWorkbenchAction(new SyncActionDescriptor(SplitEditorDownAction, SplitEditorDownAction.ID, SplitEditorDownAction.LABEL), 'View: Split Editor Down', category);
registry.registerWorkbenchAction(new SyncActionDescriptor(JoinTwoGroupsAction, JoinTwoGroupsAction.ID, JoinTwoGroupsAction.LABEL), 'View: Join Editors of Two Groups', category);
registry.registerWorkbenchAction(new SyncActionDescriptor(JoinAllGroupsAction, JoinAllGroupsAction.ID, JoinAllGroupsAction.LABEL), 'View: Join Editors of All Groups', category);
registry.registerWorkbenchAction(new SyncActionDescriptor(JoinTwoGroupsAction, JoinTwoGroupsAction.ID, JoinTwoGroupsAction.LABEL), 'View: Join Editor Group with Next Group', category);
registry.registerWorkbenchAction(new SyncActionDescriptor(JoinAllGroupsAction, JoinAllGroupsAction.ID, JoinAllGroupsAction.LABEL), 'View: Join All Editor Groups', category);
registry.registerWorkbenchAction(new SyncActionDescriptor(NavigateBetweenGroupsAction, NavigateBetweenGroupsAction.ID, NavigateBetweenGroupsAction.LABEL), 'View: Navigate Between Editor Groups', category);
registry.registerWorkbenchAction(new SyncActionDescriptor(ResetGroupSizesAction, ResetGroupSizesAction.ID, ResetGroupSizesAction.LABEL), 'View: Reset Editor Group Sizes', category);
registry.registerWorkbenchAction(new SyncActionDescriptor(MaximizeGroupAction, MaximizeGroupAction.ID, MaximizeGroupAction.LABEL), 'View: Maximize Editor Group and Hide Side Bar', category);
@@ -439,11 +435,11 @@ MenuRegistry.appendMenuItem(MenuId.EmptyEditorGroupContext, { command: { id: edi
// Editor Title Context Menu
MenuRegistry.appendMenuItem(MenuId.EditorTitleContext, { command: { id: editorCommands.CLOSE_EDITOR_COMMAND_ID, title: nls.localize('close', "Close") }, group: '1_close', order: 10 });
MenuRegistry.appendMenuItem(MenuId.EditorTitleContext, { command: { id: editorCommands.CLOSE_OTHER_EDITORS_IN_GROUP_COMMAND_ID, title: nls.localize('closeOthers', "Close Others") }, group: '1_close', order: 20 });
MenuRegistry.appendMenuItem(MenuId.EditorTitleContext, { command: { id: editorCommands.CLOSE_EDITORS_TO_THE_RIGHT_COMMAND_ID, title: nls.localize('closeRight', "Close to the Right") }, group: '1_close', order: 30, when: ContextKeyExpr.has('config.workbench.editor.showTabs') });
MenuRegistry.appendMenuItem(MenuId.EditorTitleContext, { command: { id: editorCommands.CLOSE_OTHER_EDITORS_IN_GROUP_COMMAND_ID, title: nls.localize('closeOthers', "Close Others"), precondition: EditorGroupEditorsCountContext.notEqualsTo('1') }, group: '1_close', order: 20 });
MenuRegistry.appendMenuItem(MenuId.EditorTitleContext, { command: { id: editorCommands.CLOSE_EDITORS_TO_THE_RIGHT_COMMAND_ID, title: nls.localize('closeRight', "Close to the Right"), precondition: EditorGroupEditorsCountContext.notEqualsTo('1') }, group: '1_close', order: 30, when: ContextKeyExpr.has('config.workbench.editor.showTabs') });
MenuRegistry.appendMenuItem(MenuId.EditorTitleContext, { command: { id: editorCommands.CLOSE_SAVED_EDITORS_COMMAND_ID, title: nls.localize('closeAllSaved', "Close Saved") }, group: '1_close', order: 40 });
MenuRegistry.appendMenuItem(MenuId.EditorTitleContext, { command: { id: editorCommands.CLOSE_EDITORS_IN_GROUP_COMMAND_ID, title: nls.localize('closeAll', "Close All") }, group: '1_close', order: 50 });
MenuRegistry.appendMenuItem(MenuId.EditorTitleContext, { command: { id: editorCommands.KEEP_EDITOR_COMMAND_ID, title: nls.localize('keepOpen', "Keep Open") }, group: '3_preview', order: 10, when: ContextKeyExpr.has('config.workbench.editor.enablePreview') });
MenuRegistry.appendMenuItem(MenuId.EditorTitleContext, { command: { id: editorCommands.KEEP_EDITOR_COMMAND_ID, title: nls.localize('keepOpen', "Keep Open"), precondition: EditorPinnedContext.toNegated() }, group: '3_preview', order: 10, when: ContextKeyExpr.has('config.workbench.editor.enablePreview') });
MenuRegistry.appendMenuItem(MenuId.EditorTitleContext, { command: { id: editorCommands.SPLIT_EDITOR_UP, title: nls.localize('splitUp', "Split Up") }, group: '5_split', order: 10 });
MenuRegistry.appendMenuItem(MenuId.EditorTitleContext, { command: { id: editorCommands.SPLIT_EDITOR_DOWN, title: nls.localize('splitDown', "Split Down") }, group: '5_split', order: 20 });
MenuRegistry.appendMenuItem(MenuId.EditorTitleContext, { command: { id: editorCommands.SPLIT_EDITOR_LEFT, title: nls.localize('splitLeft', "Split Left") }, group: '5_split', order: 30 });
@@ -491,16 +487,16 @@ appendEditorToolItem(
{
id: SplitEditorAction.ID,
title: nls.localize('splitEditorRight', "Split Editor Right"),
iconDark: 'split-editor-horizontal-inverse.svg',
iconLight: 'split-editor-horizontal.svg'
iconDark: 'split-editor-horizontal-dark.svg',
iconLight: 'split-editor-horizontal-light.svg'
},
ContextKeyExpr.not('splitEditorsVertically'),
100000, // towards the end
{
id: editorCommands.SPLIT_EDITOR_DOWN,
title: nls.localize('splitEditorDown', "Split Editor Down"),
iconDark: 'split-editor-vertical-inverse.svg',
iconLight: 'split-editor-vertical.svg'
iconDark: 'split-editor-vertical-dark.svg',
iconLight: 'split-editor-vertical-light.svg'
}
);
@@ -508,16 +504,16 @@ appendEditorToolItem(
{
id: SplitEditorAction.ID,
title: nls.localize('splitEditorDown', "Split Editor Down"),
iconDark: 'split-editor-vertical-inverse.svg',
iconLight: 'split-editor-vertical.svg'
iconDark: 'split-editor-vertical-dark.svg',
iconLight: 'split-editor-vertical-light.svg'
},
ContextKeyExpr.has('splitEditorsVertically'),
100000, // towards the end
{
id: editorCommands.SPLIT_EDITOR_RIGHT,
title: nls.localize('splitEditorRight', "Split Editor Right"),
iconDark: 'split-editor-horizontal-inverse.svg',
iconLight: 'split-editor-horizontal.svg'
iconDark: 'split-editor-horizontal-dark.svg',
iconLight: 'split-editor-horizontal-light.svg'
}
);
@@ -526,16 +522,16 @@ appendEditorToolItem(
{
id: editorCommands.CLOSE_EDITOR_COMMAND_ID,
title: nls.localize('close', "Close"),
iconDark: 'close-big-inverse-alt.svg',
iconLight: 'close-big-alt.svg'
iconDark: 'close-dark-alt.svg',
iconLight: 'close-light-alt.svg'
},
ContextKeyExpr.and(ContextKeyExpr.not('config.workbench.editor.showTabs'), ContextKeyExpr.not('groupActiveEditorDirty')),
1000000, // towards the far end
{
id: editorCommands.CLOSE_EDITORS_IN_GROUP_COMMAND_ID,
title: nls.localize('closeAll', "Close All"),
iconDark: 'closeall-editors-inverse.svg',
iconLight: 'closeall-editors.svg'
iconDark: 'close-all-dark.svg',
iconLight: 'close-all-light.svg'
}
);
@@ -543,16 +539,16 @@ appendEditorToolItem(
{
id: editorCommands.CLOSE_EDITOR_COMMAND_ID,
title: nls.localize('close', "Close"),
iconDark: 'close-dirty-inverse-alt.svg',
iconLight: 'close-dirty-alt.svg'
iconDark: 'close-dirty-dark-alt.svg',
iconLight: 'close-dirty-light-alt.svg'
},
ContextKeyExpr.and(ContextKeyExpr.not('config.workbench.editor.showTabs'), ContextKeyExpr.has('groupActiveEditorDirty')),
1000000, // towards the far end
{
id: editorCommands.CLOSE_EDITORS_IN_GROUP_COMMAND_ID,
title: nls.localize('closeAll', "Close All"),
iconDark: 'closeall-editors-inverse.svg',
iconLight: 'closeall-editors.svg'
iconDark: 'close-all-dark.svg',
iconLight: 'close-all-light.svg'
}
);
@@ -561,8 +557,8 @@ appendEditorToolItem(
{
id: editorCommands.GOTO_PREVIOUS_CHANGE,
title: nls.localize('navigate.prev.label', "Previous Change"),
iconDark: 'previous-diff-inverse.svg',
iconLight: 'previous-diff.svg'
iconDark: 'previous-diff-dark.svg',
iconLight: 'previous-diff-light.svg'
},
TextCompareEditorActiveContext,
10
@@ -573,8 +569,8 @@ appendEditorToolItem(
{
id: editorCommands.GOTO_NEXT_CHANGE,
title: nls.localize('navigate.next.label', "Next Change"),
iconDark: 'next-diff-inverse.svg',
iconLight: 'next-diff.svg'
iconDark: 'next-diff-dark.svg',
iconLight: 'next-diff-light.svg'
},
TextCompareEditorActiveContext,
11
@@ -585,8 +581,8 @@ appendEditorToolItem(
{
id: editorCommands.TOGGLE_DIFF_IGNORE_TRIM_WHITESPACE,
title: nls.localize('ignoreTrimWhitespace.label', "Ignore Trim Whitespace"),
iconDark: 'paragraph-inverse.svg',
iconLight: 'paragraph.svg'
iconDark: 'paragraph-dark.svg',
iconLight: 'paragraph-light.svg'
},
ContextKeyExpr.and(TextCompareEditorActiveContext, ContextKeyExpr.notEquals('config.diffEditor.ignoreTrimWhitespace', true)),
20
@@ -597,19 +593,20 @@ appendEditorToolItem(
{
id: editorCommands.TOGGLE_DIFF_IGNORE_TRIM_WHITESPACE,
title: nls.localize('showTrimWhitespace.label', "Show Trim Whitespace"),
iconDark: 'paragraph-disabled-inverse.svg',
iconLight: 'paragraph-disabled.svg'
iconDark: 'paragraph-disabled-dark.svg',
iconLight: 'paragraph-disabled-light.svg'
},
ContextKeyExpr.and(TextCompareEditorActiveContext, ContextKeyExpr.notEquals('config.diffEditor.ignoreTrimWhitespace', false)),
20
);
// Editor Commands for Command Palette
MenuRegistry.appendMenuItem(MenuId.CommandPalette, { command: { id: editorCommands.KEEP_EDITOR_COMMAND_ID, title: { value: nls.localize('keepEditor', "Keep Editor"), original: 'View: Keep Editor' }, category }, when: ContextKeyExpr.has('config.workbench.editor.enablePreview') });
MenuRegistry.appendMenuItem(MenuId.CommandPalette, { command: { id: editorCommands.CLOSE_EDITORS_IN_GROUP_COMMAND_ID, title: { value: nls.localize('closeEditorsInGroup', "Close All Editors in Group"), original: 'View: Close All Editors in Group' }, category } });
MenuRegistry.appendMenuItem(MenuId.CommandPalette, { command: { id: editorCommands.CLOSE_SAVED_EDITORS_COMMAND_ID, title: { value: nls.localize('closeSavedEditors', "Close Saved Editors in Group"), original: 'View: Close Saved Editors in Group' }, category } });
MenuRegistry.appendMenuItem(MenuId.CommandPalette, { command: { id: editorCommands.CLOSE_OTHER_EDITORS_IN_GROUP_COMMAND_ID, title: { value: nls.localize('closeOtherEditors', "Close Other Editors in Group"), original: 'View: Close Other Editors in Group' }, category } });
MenuRegistry.appendMenuItem(MenuId.CommandPalette, { command: { id: editorCommands.CLOSE_EDITORS_TO_THE_RIGHT_COMMAND_ID, title: { value: nls.localize('closeRightEditors', "Close Editors to the Right in Group"), original: 'View: Close Editors to the Right in Group' }, category } });
const viewCategory = { value: nls.localize('view', "View"), original: 'View' };
MenuRegistry.appendMenuItem(MenuId.CommandPalette, { command: { id: editorCommands.KEEP_EDITOR_COMMAND_ID, title: { value: nls.localize('keepEditor', "Keep Editor"), original: 'Keep Editor' }, category: viewCategory }, when: ContextKeyExpr.has('config.workbench.editor.enablePreview') });
MenuRegistry.appendMenuItem(MenuId.CommandPalette, { command: { id: editorCommands.CLOSE_EDITORS_IN_GROUP_COMMAND_ID, title: { value: nls.localize('closeEditorsInGroup', "Close All Editors in Group"), original: 'Close All Editors in Group' }, category: viewCategory } });
MenuRegistry.appendMenuItem(MenuId.CommandPalette, { command: { id: editorCommands.CLOSE_SAVED_EDITORS_COMMAND_ID, title: { value: nls.localize('closeSavedEditors', "Close Saved Editors in Group"), original: 'Close Saved Editors in Group' }, category: viewCategory } });
MenuRegistry.appendMenuItem(MenuId.CommandPalette, { command: { id: editorCommands.CLOSE_OTHER_EDITORS_IN_GROUP_COMMAND_ID, title: { value: nls.localize('closeOtherEditors', "Close Other Editors in Group"), original: 'Close Other Editors in Group' }, category: viewCategory } });
MenuRegistry.appendMenuItem(MenuId.CommandPalette, { command: { id: editorCommands.CLOSE_EDITORS_TO_THE_RIGHT_COMMAND_ID, title: { value: nls.localize('closeRightEditors', "Close Editors to the Right in Group"), original: 'Close Editors to the Right in Group' }, category: viewCategory } });
// File menu
MenuRegistry.appendMenuItem(MenuId.MenubarRecentMenu, {

View File

@@ -21,7 +21,7 @@ import { CLOSE_EDITOR_COMMAND_ID, NAVIGATE_ALL_EDITORS_GROUP_PREFIX, MOVE_ACTIVE
import { IEditorGroupsService, IEditorGroup, GroupsArrangement, EditorsOrder, GroupLocation, GroupDirection, preferredSideBySideGroupDirection, IFindGroupScope, GroupOrientation, EditorGroupLayout, GroupsOrder } from 'vs/workbench/services/editor/common/editorGroupsService';
import { IEditorService, SIDE_GROUP } from 'vs/workbench/services/editor/common/editorService';
import { IConfigurationService } from 'vs/platform/configuration/common/configuration';
import { IDisposable, dispose } from 'vs/base/common/lifecycle';
import { DisposableStore } from 'vs/base/common/lifecycle';
export class ExecuteCommandAction extends Action {
@@ -41,7 +41,7 @@ export class ExecuteCommandAction extends Action {
}
export class BaseSplitEditorAction extends Action {
private toDispose: IDisposable[] = [];
private readonly toDispose = this._register(new DisposableStore());
private direction: GroupDirection;
constructor(
@@ -62,7 +62,7 @@ export class BaseSplitEditorAction extends Action {
}
private registerListeners(): void {
this.toDispose.push(this.configurationService.onDidChangeConfiguration(e => {
this.toDispose.add(this.configurationService.onDidChangeConfiguration(e => {
if (e.affectsConfiguration('workbench.editor.openSideBySideDirection')) {
this.direction = preferredSideBySideGroupDirection(this.configurationService);
}
@@ -74,12 +74,6 @@ export class BaseSplitEditorAction extends Action {
return Promise.resolve(true);
}
dispose(): void {
super.dispose();
this.toDispose = dispose(this.toDispose);
}
}
export class SplitEditorAction extends BaseSplitEditorAction {

View File

@@ -443,11 +443,11 @@ export function splitEditor(editorGroupService: IEditorGroupsService, direction:
const newGroup = editorGroupService.addGroup(sourceGroup, direction);
// Split editor (if it can be split)
let editorToCopy: IEditorInput | null;
let editorToCopy: IEditorInput | undefined;
if (context && typeof context.editorIndex === 'number') {
editorToCopy = sourceGroup.getEditor(context.editorIndex);
} else {
editorToCopy = sourceGroup.activeEditor;
editorToCopy = types.withNullAsUndefined(sourceGroup.activeEditor);
}
if (editorToCopy && (editorToCopy as EditorInput).supportsSplitEditor()) {

View File

@@ -3,7 +3,7 @@
* Licensed under the Source EULA. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
import { dispose, Disposable, IDisposable } from 'vs/base/common/lifecycle';
import { Disposable, DisposableStore } from 'vs/base/common/lifecycle';
import { EditorInput, EditorOptions } from 'vs/workbench/common/editor';
import { Dimension, show, hide, addClass } from 'vs/base/browser/dom';
import { Registry } from 'vs/platform/registry/common/platform';
@@ -11,7 +11,7 @@ import { IEditorRegistry, Extensions as EditorExtensions, IEditorDescriptor } fr
import { IWorkbenchLayoutService } from 'vs/workbench/services/layout/browser/layoutService';
import { BaseEditor } from 'vs/workbench/browser/parts/editor/baseEditor';
import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation';
import { IProgressService, LongRunningOperation } from 'vs/platform/progress/common/progress';
import { IEditorProgressService, LongRunningOperation } from 'vs/platform/progress/common/progress';
import { IEditorGroupView, DEFAULT_EDITOR_MIN_DIMENSIONS, DEFAULT_EDITOR_MAX_DIMENSIONS } from 'vs/workbench/browser/parts/editor/editor';
import { Event, Emitter } from 'vs/base/common/event';
import { IVisibleEditor } from 'vs/workbench/services/editor/common/editorService';
@@ -30,7 +30,7 @@ export class EditorControl extends Disposable {
get maximumHeight() { return this._activeControl ? this._activeControl.maximumHeight : DEFAULT_EDITOR_MAX_DIMENSIONS.height; }
private readonly _onDidFocus: Emitter<void> = this._register(new Emitter<void>());
get onDidFocus(): Event<void> { return this._onDidFocus.event; }
readonly onDidFocus: Event<void> = this._onDidFocus.event;
private _onDidSizeConstraintsChange = this._register(new Emitter<{ width: number; height: number; } | undefined>());
get onDidSizeConstraintsChange(): Event<{ width: number; height: number; } | undefined> { return this._onDidSizeConstraintsChange.event; }
@@ -38,7 +38,7 @@ export class EditorControl extends Disposable {
private _activeControl: BaseEditor | null;
private controls: BaseEditor[] = [];
private activeControlDisposeables: IDisposable[] = [];
private readonly activeControlDisposables = this._register(new DisposableStore());
private dimension: Dimension;
private editorOperation: LongRunningOperation;
@@ -47,11 +47,11 @@ export class EditorControl extends Disposable {
private groupView: IEditorGroupView,
@IWorkbenchLayoutService private readonly layoutService: IWorkbenchLayoutService,
@IInstantiationService private readonly instantiationService: IInstantiationService,
@IProgressService progressService: IProgressService
@IEditorProgressService editorProgressService: IEditorProgressService
) {
super();
this.editorOperation = this._register(new LongRunningOperation(progressService));
this.editorOperation = this._register(new LongRunningOperation(editorProgressService));
}
get activeControl(): IVisibleEditor | null {
@@ -139,12 +139,12 @@ export class EditorControl extends Disposable {
this._activeControl = control;
// Clear out previous active control listeners
this.activeControlDisposeables = dispose(this.activeControlDisposeables);
this.activeControlDisposables.clear();
// Listen to control changes
if (control) {
this.activeControlDisposeables.push(control.onDidSizeConstraintsChange(e => this._onDidSizeConstraintsChange.fire(e)));
this.activeControlDisposeables.push(control.onDidFocus(() => this._onDidFocus.fire()));
this.activeControlDisposables.add(control.onDidSizeConstraintsChange(e => this._onDidSizeConstraintsChange.fire(e)));
this.activeControlDisposables.add(control.onDidFocus(() => this._onDidFocus.fire()));
}
// Indicate that size constraints could have changed due to new editor
@@ -228,10 +228,4 @@ export class EditorControl extends Disposable {
this._activeControl.layout(this.dimension);
}
}
dispose(): void {
this.activeControlDisposeables = dispose(this.activeControlDisposeables);
super.dispose();
}
}

View File

@@ -88,10 +88,10 @@ class DropOverlay extends Themable {
// Overlay contrast border (if any)
const activeContrastBorderColor = this.getColor(activeContrastBorder);
this.overlay.style.outlineColor = activeContrastBorderColor;
this.overlay.style.outlineOffset = activeContrastBorderColor ? '-2px' : null;
this.overlay.style.outlineStyle = activeContrastBorderColor ? 'dashed' : null;
this.overlay.style.outlineWidth = activeContrastBorderColor ? '2px' : null;
this.overlay.style.outlineColor = activeContrastBorderColor || '';
this.overlay.style.outlineOffset = activeContrastBorderColor ? '-2px' : '';
this.overlay.style.outlineStyle = activeContrastBorderColor ? 'dashed' : '';
this.overlay.style.outlineWidth = activeContrastBorderColor ? '2px' : '';
}
private registerListeners(): void {

View File

@@ -6,7 +6,7 @@
import 'vs/css!./media/editorgroupview';
import { EditorGroup, IEditorOpenOptions, EditorCloseEvent, ISerializedEditorGroup, isSerializedEditorGroup } from 'vs/workbench/common/editor/editorGroup';
import { EditorInput, EditorOptions, GroupIdentifier, ConfirmResult, SideBySideEditorInput, CloseDirection, IEditorCloseEvent, EditorGroupActiveEditorDirtyContext, IEditor } from 'vs/workbench/common/editor';
import { EditorInput, EditorOptions, GroupIdentifier, ConfirmResult, SideBySideEditorInput, CloseDirection, IEditorCloseEvent, EditorGroupActiveEditorDirtyContext, IEditor, EditorGroupEditorsCountContext } from 'vs/workbench/common/editor';
import { Event, Emitter, Relay } from 'vs/base/common/event';
import { IInstantiationService, ServicesAccessor } from 'vs/platform/instantiation/common/instantiation';
import { addClass, addClasses, Dimension, trackFocus, toggleClass, removeClass, addDisposableListener, EventType, EventHelper, findParentWithClass, clearNode, isAncestor } from 'vs/base/browser/dom';
@@ -20,11 +20,11 @@ import { Themable, EDITOR_GROUP_HEADER_TABS_BORDER, EDITOR_GROUP_HEADER_TABS_BAC
import { IMoveEditorOptions, ICopyEditorOptions, ICloseEditorsFilter, IGroupChangeEvent, GroupChangeKind, EditorsOrder, GroupsOrder, ICloseEditorOptions } from 'vs/workbench/services/editor/common/editorGroupsService';
import { TabsTitleControl } from 'vs/workbench/browser/parts/editor/tabsTitleControl';
import { EditorControl } from 'vs/workbench/browser/parts/editor/editorControl';
import { IProgressService } from 'vs/platform/progress/common/progress';
import { ProgressService } from 'vs/workbench/services/progress/browser/progressService';
import { IEditorProgressService } from 'vs/platform/progress/common/progress';
import { EditorProgressService } from 'vs/workbench/services/progress/browser/editorProgressService';
import { localize } from 'vs/nls';
import { isPromiseCanceledError } from 'vs/base/common/errors';
import { dispose, IDisposable } from 'vs/base/common/lifecycle';
import { dispose, MutableDisposable } from 'vs/base/common/lifecycle';
import { Severity, INotificationService, INotificationActions } from 'vs/platform/notification/common/notification';
import { toErrorMessage } from 'vs/base/common/errorMessage';
import { ITelemetryService } from 'vs/platform/telemetry/common/telemetry';
@@ -40,7 +40,7 @@ import { CLOSE_EDITOR_GROUP_COMMAND_ID } from 'vs/workbench/browser/parts/editor
import { NoTabsTitleControl } from 'vs/workbench/browser/parts/editor/noTabsTitleControl';
import { IMenuService, MenuId, IMenu } from 'vs/platform/actions/common/actions';
import { StandardMouseEvent } from 'vs/base/browser/mouseEvent';
import { fillInContextMenuActions } from 'vs/platform/actions/browser/menuEntryActionViewItem';
import { createAndFillInContextMenuActions } from 'vs/platform/actions/browser/menuEntryActionViewItem';
import { IContextMenuService } from 'vs/platform/contextview/browser/contextView';
// {{SQL CARBON EDIT}}
import { ICommandService } from 'vs/platform/commands/common/commands';
@@ -48,7 +48,7 @@ import { GlobalNewUntitledFileAction } from 'vs/workbench/contrib/files/browser/
// {{SQL CARBON EDIT}} - End
import { isErrorWithActions, IErrorWithActions } from 'vs/base/common/errorsWithActions';
import { IVisibleEditor } from 'vs/workbench/services/editor/common/editorService';
import { withNullAsUndefined } from 'vs/base/common/types';
import { withNullAsUndefined, withUndefinedAsNull } from 'vs/base/common/types';
import { hash } from 'vs/base/common/hash';
import { guessMimeTypes } from 'vs/base/common/mime';
import { extname } from 'vs/base/common/resources';
@@ -75,25 +75,25 @@ export class EditorGroupView extends Themable implements IEditorGroupView {
//#region events
private readonly _onDidFocus: Emitter<void> = this._register(new Emitter<void>());
get onDidFocus(): Event<void> { return this._onDidFocus.event; }
readonly onDidFocus: Event<void> = this._onDidFocus.event;
private readonly _onWillDispose: Emitter<void> = this._register(new Emitter<void>());
get onWillDispose(): Event<void> { return this._onWillDispose.event; }
readonly onWillDispose: Event<void> = this._onWillDispose.event;
private readonly _onDidGroupChange: Emitter<IGroupChangeEvent> = this._register(new Emitter<IGroupChangeEvent>());
get onDidGroupChange(): Event<IGroupChangeEvent> { return this._onDidGroupChange.event; }
readonly onDidGroupChange: Event<IGroupChangeEvent> = this._onDidGroupChange.event;
private readonly _onWillOpenEditor: Emitter<IEditorOpeningEvent> = this._register(new Emitter<IEditorOpeningEvent>());
get onWillOpenEditor(): Event<IEditorOpeningEvent> { return this._onWillOpenEditor.event; }
readonly onWillOpenEditor: Event<IEditorOpeningEvent> = this._onWillOpenEditor.event;
private readonly _onDidOpenEditorFail: Emitter<EditorInput> = this._register(new Emitter<EditorInput>());
get onDidOpenEditorFail(): Event<EditorInput> { return this._onDidOpenEditorFail.event; }
readonly onDidOpenEditorFail: Event<EditorInput> = this._onDidOpenEditorFail.event;
private readonly _onWillCloseEditor: Emitter<IEditorCloseEvent> = this._register(new Emitter<IEditorCloseEvent>());
get onWillCloseEditor(): Event<IEditorCloseEvent> { return this._onWillCloseEditor.event; }
readonly onWillCloseEditor: Event<IEditorCloseEvent> = this._onWillCloseEditor.event;
private readonly _onDidCloseEditor: Emitter<IEditorCloseEvent> = this._register(new Emitter<IEditorCloseEvent>());
get onDidCloseEditor(): Event<IEditorCloseEvent> { return this._onDidCloseEditor.event; }
readonly onDidCloseEditor: Event<IEditorCloseEvent> = this._onDidCloseEditor.event;
//#endregion
@@ -184,7 +184,7 @@ export class EditorGroupView extends Themable implements IEditorGroupView {
const scopedContextKeyService = this._register(this.contextKeyService.createScoped(this.element));
this.scopedInstantiationService = this.instantiationService.createChild(new ServiceCollection(
[IContextKeyService, scopedContextKeyService],
[IProgressService, new ProgressService(this.progressBar)]
[IEditorProgressService, new EditorProgressService(this.progressBar)]
));
// Context keys
@@ -218,29 +218,35 @@ export class EditorGroupView extends Themable implements IEditorGroupView {
this.updateStyles();
}
private handleGroupContextKeys(contextKeyServcie: IContextKeyService): void {
const groupActiveEditorDirtyContextKey = EditorGroupActiveEditorDirtyContext.bindTo(contextKeyServcie);
private handleGroupContextKeys(contextKeyService: IContextKeyService): void {
const groupActiveEditorDirtyContextKey = EditorGroupActiveEditorDirtyContext.bindTo(contextKeyService);
const groupEditorsCountContext = EditorGroupEditorsCountContext.bindTo(contextKeyService);
let activeEditorListener: IDisposable;
let activeEditorListener = new MutableDisposable();
const observeActiveEditor = () => {
dispose(activeEditorListener);
activeEditorListener.clear();
const activeEditor = this._group.activeEditor;
if (activeEditor) {
groupActiveEditorDirtyContextKey.set(activeEditor.isDirty());
activeEditorListener = activeEditor.onDidChangeDirty(() => groupActiveEditorDirtyContextKey.set(activeEditor.isDirty()));
activeEditorListener.value = activeEditor.onDidChangeDirty(() => groupActiveEditorDirtyContextKey.set(activeEditor.isDirty()));
} else {
groupActiveEditorDirtyContextKey.set(false);
}
};
// Track the active editor and update context key that reflects
// the dirty state of this editor
// Update group contexts based on group changes
this._register(this.onDidGroupChange(e => {
// Track the active editor and update context key that reflects
// the dirty state of this editor
if (e.kind === GroupChangeKind.EDITOR_ACTIVE) {
observeActiveEditor();
}
// Group editors count context
groupEditorsCountContext.set(this.count);
}));
observeActiveEditor();
@@ -276,16 +282,26 @@ export class EditorGroupView extends Themable implements IEditorGroupView {
// Toolbar
const groupId = this._group.id;
const containerToolbar = new ActionBar(toolbarContainer, {
const containerToolbar = this._register(new ActionBar(toolbarContainer, {
ariaLabel: localize('araLabelGroupActions', "Editor group actions"), actionRunner: this._register(new class extends ActionRunner {
run(action: IAction) {
return action.run(groupId);
}
})
});
}));
// Toolbar actions
const removeGroupAction = this._register(new Action(CLOSE_EDITOR_GROUP_COMMAND_ID, localize('closeGroupAction', "Close"), 'close-editor-group', true, () => { this.accessor.removeGroup(this); return Promise.resolve(true); }));
const removeGroupAction = this._register(new Action(
CLOSE_EDITOR_GROUP_COMMAND_ID,
localize('closeGroupAction', "Close"),
'close-editor-group',
true,
() => {
this.accessor.removeGroup(this);
return Promise.resolve(true);
}));
const keybinding = this.keybindingService.lookupKeybinding(removeGroupAction.id);
containerToolbar.push(removeGroupAction, { icon: true, label: false, keybinding: keybinding ? keybinding.getLabel() : undefined });
}
@@ -311,13 +327,16 @@ export class EditorGroupView extends Themable implements IEditorGroupView {
// Fill in contributed actions
const actions: IAction[] = [];
fillInContextMenuActions(menu, undefined, actions, this.contextMenuService);
const actionsDisposable = createAndFillInContextMenuActions(menu, undefined, actions, this.contextMenuService);
// Show it
this.contextMenuService.showContextMenu({
getAnchor: () => anchor,
getActions: () => actions,
onHide: () => this.focus()
onHide: () => {
this.focus();
dispose(actionsDisposable);
}
});
}
@@ -408,7 +427,7 @@ export class EditorGroupView extends Themable implements IEditorGroupView {
private async restoreEditors(from: IEditorGroupView | ISerializedEditorGroup): Promise<void> {
if (this._group.count === 0) {
return Promise.resolve(); // nothing to show
return; // nothing to show
}
// Determine editor options
@@ -421,7 +440,7 @@ export class EditorGroupView extends Themable implements IEditorGroupView {
const activeEditor = this._group.activeEditor;
if (!activeEditor) {
return Promise.resolve();
return;
}
options.pinned = this._group.isPinned(activeEditor); // preserve pinned state
@@ -528,7 +547,7 @@ export class EditorGroupView extends Themable implements IEditorGroupView {
const resource = editor.getResource();
const path = resource ? resource.scheme === Schemas.file ? resource.fsPath : resource.path : undefined;
if (resource && path) {
descriptor['resource'] = { mimeType: guessMimeTypes(path).join(', '), scheme: resource.scheme, ext: extname(resource), path: hash(path) };
descriptor['resource'] = { mimeType: guessMimeTypes(resource).join(', '), scheme: resource.scheme, ext: extname(resource), path: hash(path) };
/* __GDPR__FRAGMENT__
"EditorTelemetryDescriptor" : {
@@ -716,7 +735,7 @@ export class EditorGroupView extends Themable implements IEditorGroupView {
return this.editors;
}
getEditor(index: number): EditorInput | null {
getEditor(index: number): EditorInput | undefined {
return this._group.getEditor(index);
}
@@ -776,10 +795,10 @@ export class EditorGroupView extends Themable implements IEditorGroupView {
}
// Proceed with opening
return this.doOpenEditor(editor, options);
return this.doOpenEditor(editor, options).then(withUndefinedAsNull);
}
private doOpenEditor(editor: EditorInput, options?: EditorOptions): Promise<IEditor | null> {
private doOpenEditor(editor: EditorInput, options?: EditorOptions): Promise<IEditor | undefined> {
// Determine options
const openEditorOptions: IEditorOpenOptions = {
@@ -820,33 +839,37 @@ export class EditorGroupView extends Themable implements IEditorGroupView {
return this.doShowEditor(editor, !!openEditorOptions.active, options);
}
private async doShowEditor(editor: EditorInput, active: boolean, options?: EditorOptions): Promise<IEditor | null> {
private async doShowEditor(editor: EditorInput, active: boolean, options?: EditorOptions): Promise<IEditor | undefined> {
// Show in editor control if the active editor changed
let openEditor: IEditor | null = null;
let openEditorPromise: Promise<IEditor | undefined>;
if (active) {
try {
const result = await this.editorControl.openEditor(editor, options);
openEditorPromise = (async () => {
try {
const result = await this.editorControl.openEditor(editor, options);
// Editor change event
if (result.editorChanged) {
this._onDidGroupChange.fire({ kind: GroupChangeKind.EDITOR_ACTIVE, editor });
// Editor change event
if (result.editorChanged) {
this._onDidGroupChange.fire({ kind: GroupChangeKind.EDITOR_ACTIVE, editor });
}
return result.control;
} catch (error) {
// Handle errors but do not bubble them up
this.doHandleOpenEditorError(error, editor, options);
return undefined; // error: return undefined as result to signal this
}
openEditor = result.control;
} catch (error) {
// Handle errors but do not bubble them up
this.doHandleOpenEditorError(error, editor, options);
}
})();
} else {
openEditor = null; // inactive: return NULL as result to signal this
openEditorPromise = Promise.resolve(undefined); // inactive: return undefined as result to signal this
}
// Show in title control after editor control because some actions depend on it
this.titleAreaControl.openEditor(editor);
return openEditor;
return openEditorPromise;
}
private doHandleOpenEditorError(error: Error, editor: EditorInput, options?: EditorOptions): void {
@@ -892,7 +915,7 @@ export class EditorGroupView extends Themable implements IEditorGroupView {
// Use the first editor as active editor
const { editor, options } = editors.shift()!;
let firstEditor = await this.openEditor(editor, options);
let firstOpenedEditor = await this.openEditor(editor, options);
// Open the other ones inactive
const startingIndex = this.getIndexOfEditor(editor) + 1;
@@ -903,12 +926,12 @@ export class EditorGroupView extends Themable implements IEditorGroupView {
adjustedEditorOptions.index = startingIndex + index;
const openedEditor = await this.openEditor(editor, adjustedEditorOptions);
if (!firstEditor) {
firstEditor = openedEditor; // only take if the first editor opening failed
if (!firstOpenedEditor) {
firstOpenedEditor = openedEditor; // only take if the first editor opening failed
}
}));
return firstEditor;
return firstOpenedEditor;
}
//#endregion
@@ -1108,7 +1131,7 @@ export class EditorGroupView extends Themable implements IEditorGroupView {
private async handleDirty(editors: EditorInput[]): Promise<boolean /* veto */> {
if (!editors.length) {
return Promise.resolve(false); // no veto
return false; // no veto
}
const editor = editors.shift()!;
@@ -1141,7 +1164,7 @@ export class EditorGroupView extends Themable implements IEditorGroupView {
this.accessor.groups.some(groupView => groupView !== this && groupView.group.contains(editor, true /* support side by side */)) || // editor is opened in other group
editor instanceof SideBySideEditorInput && this.isOpened(editor.master) // side by side editor master is still opened
) {
return Promise.resolve(false);
return false;
}
// Switch to editor that we want to handle and confirm to save/revert
@@ -1266,7 +1289,7 @@ export class EditorGroupView extends Themable implements IEditorGroupView {
// If the group is empty and the request is to close all editors, we still close
// the editor group is the related setting to close empty groups is enabled for
// a convinient way of removing empty editor groups for the user.
// a convenient way of removing empty editor groups for the user.
if (this.accessor.partOptions.closeEmptyGroups) {
this.accessor.removeGroup(this);
}

View File

@@ -19,7 +19,7 @@ import { distinct, coalesce } from 'vs/base/common/arrays';
import { IEditorGroupsAccessor, IEditorGroupView, getEditorPartOptions, impactsEditorPartOptions, IEditorPartOptionsChangeEvent, IEditorPartCreationOptions } from 'vs/workbench/browser/parts/editor/editor';
import { EditorGroupView } from 'vs/workbench/browser/parts/editor/editorGroupView';
import { IConfigurationService, IConfigurationChangeEvent } from 'vs/platform/configuration/common/configuration';
import { IDisposable, dispose, toDisposable } from 'vs/base/common/lifecycle';
import { IDisposable, dispose, toDisposable, DisposableStore } from 'vs/base/common/lifecycle';
import { assign } from 'vs/base/common/objects';
import { IStorageService, StorageScope } from 'vs/platform/storage/common/storage';
import { ISerializedEditorGroup, isSerializedEditorGroup } from 'vs/workbench/common/editor/editorGroup';
@@ -31,6 +31,7 @@ import { IView, orthogonal, LayoutPriority } from 'vs/base/browser/ui/grid/gridv
import { onUnexpectedError } from 'vs/base/common/errors';
import { Parts, IWorkbenchLayoutService } from 'vs/workbench/services/layout/browser/layoutService';
import { registerSingleton } from 'vs/platform/instantiation/common/extensions';
import { MementoObject } from 'vs/workbench/common/memento';
interface IEditorPartUIState {
serializedGrid: ISerializedGrid;
@@ -90,36 +91,36 @@ export class EditorPart extends Part implements IEditorGroupsService, IEditorGro
//#region Events
private readonly _onDidLayout: Emitter<Dimension> = this._register(new Emitter<Dimension>());
get onDidLayout(): Event<Dimension> { return this._onDidLayout.event; }
readonly onDidLayout: Event<Dimension> = this._onDidLayout.event;
private readonly _onDidActiveGroupChange: Emitter<IEditorGroupView> = this._register(new Emitter<IEditorGroupView>());
get onDidActiveGroupChange(): Event<IEditorGroupView> { return this._onDidActiveGroupChange.event; }
readonly onDidActiveGroupChange: Event<IEditorGroupView> = this._onDidActiveGroupChange.event;
private readonly _onDidActivateGroup: Emitter<IEditorGroupView> = this._register(new Emitter<IEditorGroupView>());
get onDidActivateGroup(): Event<IEditorGroupView> { return this._onDidActivateGroup.event; }
readonly onDidActivateGroup: Event<IEditorGroupView> = this._onDidActivateGroup.event;
private readonly _onDidAddGroup: Emitter<IEditorGroupView> = this._register(new Emitter<IEditorGroupView>());
get onDidAddGroup(): Event<IEditorGroupView> { return this._onDidAddGroup.event; }
readonly onDidAddGroup: Event<IEditorGroupView> = this._onDidAddGroup.event;
private readonly _onDidRemoveGroup: Emitter<IEditorGroupView> = this._register(new Emitter<IEditorGroupView>());
get onDidRemoveGroup(): Event<IEditorGroupView> { return this._onDidRemoveGroup.event; }
readonly onDidRemoveGroup: Event<IEditorGroupView> = this._onDidRemoveGroup.event;
private readonly _onDidMoveGroup: Emitter<IEditorGroupView> = this._register(new Emitter<IEditorGroupView>());
get onDidMoveGroup(): Event<IEditorGroupView> { return this._onDidMoveGroup.event; }
readonly onDidMoveGroup: Event<IEditorGroupView> = this._onDidMoveGroup.event;
private onDidSetGridWidget = this._register(new Emitter<{ width: number; height: number; } | undefined>());
private _onDidSizeConstraintsChange = this._register(new Relay<{ width: number; height: number; } | undefined>());
get onDidSizeConstraintsChange(): Event<{ width: number; height: number; } | undefined> { return Event.any(this.onDidSetGridWidget.event, this._onDidSizeConstraintsChange.event); }
private readonly _onDidPreferredSizeChange: Emitter<void> = this._register(new Emitter<void>());
get onDidPreferredSizeChange(): Event<void> { return this._onDidPreferredSizeChange.event; }
readonly onDidPreferredSizeChange: Event<void> = this._onDidPreferredSizeChange.event;
//#endregion
private _preferredSize: Dimension | undefined;
private workspaceMemento: object;
private globalMemento: object;
private readonly workspaceMemento: MementoObject;
private readonly globalMemento: MementoObject;
private _partOptions: IEditorPartOptions;
@@ -161,7 +162,7 @@ export class EditorPart extends Part implements IEditorGroupsService, IEditorGro
private enforcedPartOptions: IEditorPartOptions[] = [];
private readonly _onDidEditorPartOptionsChange: Emitter<IEditorPartOptionsChangeEvent> = this._register(new Emitter<IEditorPartOptionsChangeEvent>());
get onDidEditorPartOptionsChange(): Event<IEditorPartOptionsChangeEvent> { return this._onDidEditorPartOptionsChange.event; }
readonly onDidEditorPartOptionsChange: Event<IEditorPartOptionsChangeEvent> = this._onDidEditorPartOptionsChange.event;
private registerListeners(): void {
this._register(this.configurationService.onDidChangeConfiguration(e => this.onConfigurationUpdated(e)));
@@ -325,13 +326,13 @@ export class EditorPart extends Part implements IEditorGroupsService, IEditorGro
return groupView;
}
getSize(group: IEditorGroupView | GroupIdentifier): number {
getSize(group: IEditorGroupView | GroupIdentifier): { width: number, height: number } {
const groupView = this.assertGroupView(group);
return this.gridWidget.getViewSize(groupView);
}
setSize(group: IEditorGroupView | GroupIdentifier, size: number): void {
setSize(group: IEditorGroupView | GroupIdentifier, size: { width: number, height: number }): void {
const groupView = this.assertGroupView(group);
this.gridWidget.resizeView(groupView, size);
@@ -520,13 +521,13 @@ export class EditorPart extends Part implements IEditorGroupsService, IEditorGro
this.groupViews.set(groupView.id, groupView);
// Track focus
let groupDisposables: IDisposable[] = [];
groupDisposables.push(groupView.onDidFocus(() => {
let groupDisposables = new DisposableStore();
groupDisposables.add(groupView.onDidFocus(() => {
this.doSetGroupActive(groupView);
}));
// Track editor change
groupDisposables.push(groupView.onDidGroupChange(e => {
groupDisposables.add(groupView.onDidGroupChange(e => {
if (e.kind === GroupChangeKind.EDITOR_ACTIVE) {
this.updateContainer();
}
@@ -534,7 +535,7 @@ export class EditorPart extends Part implements IEditorGroupsService, IEditorGro
// Track dispose
Event.once(groupView.onWillDispose)(() => {
groupDisposables = dispose(groupDisposables);
dispose(groupDisposables);
this.groupViews.delete(groupView.id);
this.doUpdateMostRecentActive(groupView);
});

View File

@@ -59,7 +59,7 @@ export class EditorPickerEntry extends QuickOpenEntryGroup {
}
getDescription() {
return withNullAsUndefined(this.editor.getDescription());
return this.editor.getDescription();
}
run(mode: Mode, context: IEntryRunContext): boolean {

File diff suppressed because it is too large Load Diff

View File

@@ -24,7 +24,7 @@ import { IFileService } from 'vs/platform/files/common/files';
export class FloatingClickWidget extends Widget implements IOverlayWidget {
private readonly _onClick: Emitter<void> = this._register(new Emitter<void>());
get onClick(): Event<void> { return this._onClick.event; }
readonly onClick: Event<void> = this._onClick.event;
private _domNode: HTMLElement;

View File

@@ -0,0 +1,4 @@
<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
<path fill-rule="evenodd" clip-rule="evenodd" d="M8.62132 8.08578L7.91421 7.37868L6.5 8.79289L5.08579 7.37868L4.37868 8.08578L5.79289 9.5L4.37868 10.9142L5.08579 11.6213L6.5 10.2071L7.91421 11.6213L8.62132 10.9142L7.20711 9.5L8.62132 8.08578Z" fill="#C5C5C5"/>
<path fill-rule="evenodd" clip-rule="evenodd" d="M5 3L6 2H13L14 3V10L13 11H11V13L10 14H3L2 13V6L3 5H5V3ZM6 5H10L11 6V10H13V3H6V5ZM10 6H3V13H10V6Z" fill="#C5C5C5"/>
</svg>

After

Width:  |  Height:  |  Size: 528 B

View File

@@ -0,0 +1,4 @@
<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
<path fill-rule="evenodd" clip-rule="evenodd" d="M8.62132 8.08578L7.91421 7.37868L6.5 8.79289L5.08579 7.37868L4.37868 8.08578L5.79289 9.5L4.37868 10.9142L5.08579 11.6213L6.5 10.2071L7.91421 11.6213L8.62132 10.9142L7.20711 9.5L8.62132 8.08578Z" fill="#424242"/>
<path fill-rule="evenodd" clip-rule="evenodd" d="M5 3L6 2H13L14 3V10L13 11H11V13L10 14H3L2 13V6L3 5H5V3ZM6 5H10L11 6V10H13V3H6V5ZM10 6H3V13H10V6Z" fill="#424242"/>
</svg>

After

Width:  |  Height:  |  Size: 528 B

View File

@@ -1 +0,0 @@
<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M9.784 8L13 11.217 11.215 13 8.001 9.786 4.785 13 3 11.216l3.214-3.215L3 4.785 4.784 3 8 6.216 11.216 3 13 4.785 9.784 8.001z" fill="#424242"/></svg>

Before

Width:  |  Height:  |  Size: 253 B

View File

@@ -1 +0,0 @@
<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M9.784 8L13 11.217 11.215 13 8.001 9.786 4.785 13 3 11.216l3.214-3.215L3 4.785 4.784 3 8 6.216 11.216 3 13 4.785 9.784 8.001z" fill="#C5C5C5"/></svg>

Before

Width:  |  Height:  |  Size: 253 B

View File

@@ -1 +0,0 @@
<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M9.784 8L13 11.217 11.215 13 8.001 9.786 4.785 13 3 11.216l3.214-3.215L3 4.785 4.784 3 8 6.216 11.216 3 13 4.785 9.784 8.001z" fill="#C5C5C5"/></svg>

Before

Width:  |  Height:  |  Size: 253 B

View File

@@ -1 +0,0 @@
<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M9.784 8L13 11.217 11.215 13 8.001 9.786 4.785 13 3 11.216l3.214-3.215L3 4.785 4.784 3 8 6.216 11.216 3 13 4.785 9.784 8.001z" fill="#424242"/></svg>

Before

Width:  |  Height:  |  Size: 253 B

View File

@@ -0,0 +1,3 @@
<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
<path fill-rule="evenodd" clip-rule="evenodd" d="M8.00001 8.70711L11.6465 12.3536L12.3536 11.6464L8.70711 8L12.3536 4.35355L11.6465 3.64645L8.00001 7.29289L4.35356 3.64645L3.64645 4.35355L7.2929 8L3.64645 11.6464L4.35356 12.3536L8.00001 8.70711Z" fill="#C5C5C5"/>
</svg>

After

Width:  |  Height:  |  Size: 367 B

View File

@@ -0,0 +1,3 @@
<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
<path fill-rule="evenodd" clip-rule="evenodd" d="M8.00001 8.70711L11.6465 12.3536L12.3536 11.6464L8.70711 8L12.3536 4.35355L11.6465 3.64645L8.00001 7.29289L4.35356 3.64645L3.64645 4.35355L7.2929 8L3.64645 11.6464L4.35356 12.3536L8.00001 8.70711Z" fill="#C5C5C5"/>
</svg>

After

Width:  |  Height:  |  Size: 367 B

View File

@@ -0,0 +1,3 @@
<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M8 4C8.36719 4 8.72135 4.04818 9.0625 4.14453C9.40365 4.23828 9.72135 4.3724 10.0156 4.54688C10.3125 4.72135 10.582 4.93099 10.8242 5.17578C11.069 5.41797 11.2786 5.6875 11.4531 5.98438C11.6276 6.27865 11.7617 6.59635 11.8555 6.9375C11.9518 7.27865 12 7.63281 12 8C12 8.36719 11.9518 8.72135 11.8555 9.0625C11.7617 9.40365 11.6276 9.72266 11.4531 10.0195C11.2786 10.3138 11.069 10.5833 10.8242 10.8281C10.582 11.0703 10.3125 11.2786 10.0156 11.4531C9.72135 11.6276 9.40365 11.763 9.0625 11.8594C8.72135 11.9531 8.36719 12 8 12C7.63281 12 7.27865 11.9531 6.9375 11.8594C6.59635 11.763 6.27734 11.6276 5.98047 11.4531C5.6862 11.2786 5.41667 11.0703 5.17188 10.8281C4.92969 10.5833 4.72135 10.3138 4.54688 10.0195C4.3724 9.72266 4.23698 9.40365 4.14063 9.0625C4.04688 8.72135 4 8.36719 4 8C4 7.63281 4.04688 7.27865 4.14063 6.9375C4.23698 6.59635 4.3724 6.27865 4.54688 5.98438C4.72135 5.6875 4.92969 5.41797 5.17188 5.17578C5.41667 4.93099 5.6862 4.72135 5.98047 4.54688C6.27734 4.3724 6.59635 4.23828 6.9375 4.14453C7.27865 4.04818 7.63281 4 8 4Z" fill="#C5C5C5"/>
</svg>

After

Width:  |  Height:  |  Size: 1.1 KiB

View File

@@ -0,0 +1,3 @@
<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M8 4C8.36719 4 8.72135 4.04818 9.0625 4.14453C9.40365 4.23828 9.72135 4.3724 10.0156 4.54688C10.3125 4.72135 10.582 4.93099 10.8242 5.17578C11.069 5.41797 11.2786 5.6875 11.4531 5.98438C11.6276 6.27865 11.7617 6.59635 11.8555 6.9375C11.9518 7.27865 12 7.63281 12 8C12 8.36719 11.9518 8.72135 11.8555 9.0625C11.7617 9.40365 11.6276 9.72266 11.4531 10.0195C11.2786 10.3138 11.069 10.5833 10.8242 10.8281C10.582 11.0703 10.3125 11.2786 10.0156 11.4531C9.72135 11.6276 9.40365 11.763 9.0625 11.8594C8.72135 11.9531 8.36719 12 8 12C7.63281 12 7.27865 11.9531 6.9375 11.8594C6.59635 11.763 6.27734 11.6276 5.98047 11.4531C5.6862 11.2786 5.41667 11.0703 5.17188 10.8281C4.92969 10.5833 4.72135 10.3138 4.54688 10.0195C4.3724 9.72266 4.23698 9.40365 4.14063 9.0625C4.04688 8.72135 4 8.36719 4 8C4 7.63281 4.04688 7.27865 4.14063 6.9375C4.23698 6.59635 4.3724 6.27865 4.54688 5.98438C4.72135 5.6875 4.92969 5.41797 5.17188 5.17578C5.41667 4.93099 5.6862 4.72135 5.98047 4.54688C6.27734 4.3724 6.59635 4.23828 6.9375 4.14453C7.27865 4.04818 7.63281 4 8 4Z" fill="#C5C5C5"/>
</svg>

After

Width:  |  Height:  |  Size: 1.1 KiB

View File

@@ -0,0 +1,3 @@
<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M8 4C8.36719 4 8.72135 4.04818 9.0625 4.14453C9.40365 4.23828 9.72135 4.3724 10.0156 4.54688C10.3125 4.72135 10.582 4.93099 10.8242 5.17578C11.069 5.41797 11.2786 5.6875 11.4531 5.98438C11.6276 6.27865 11.7617 6.59635 11.8555 6.9375C11.9518 7.27865 12 7.63281 12 8C12 8.36719 11.9518 8.72135 11.8555 9.0625C11.7617 9.40365 11.6276 9.72266 11.4531 10.0195C11.2786 10.3138 11.069 10.5833 10.8242 10.8281C10.582 11.0703 10.3125 11.2786 10.0156 11.4531C9.72135 11.6276 9.40365 11.763 9.0625 11.8594C8.72135 11.9531 8.36719 12 8 12C7.63281 12 7.27865 11.9531 6.9375 11.8594C6.59635 11.763 6.27734 11.6276 5.98047 11.4531C5.6862 11.2786 5.41667 11.0703 5.17188 10.8281C4.92969 10.5833 4.72135 10.3138 4.54688 10.0195C4.3724 9.72266 4.23698 9.40365 4.14063 9.0625C4.04688 8.72135 4 8.36719 4 8C4 7.63281 4.04688 7.27865 4.14063 6.9375C4.23698 6.59635 4.3724 6.27865 4.54688 5.98438C4.72135 5.6875 4.92969 5.41797 5.17188 5.17578C5.41667 4.93099 5.6862 4.72135 5.98047 4.54688C6.27734 4.3724 6.59635 4.23828 6.9375 4.14453C7.27865 4.04818 7.63281 4 8 4Z" fill="#424242"/>
</svg>

After

Width:  |  Height:  |  Size: 1.1 KiB

View File

@@ -0,0 +1,3 @@
<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M8 4C8.36719 4 8.72135 4.04818 9.0625 4.14453C9.40365 4.23828 9.72135 4.3724 10.0156 4.54688C10.3125 4.72135 10.582 4.93099 10.8242 5.17578C11.069 5.41797 11.2786 5.6875 11.4531 5.98438C11.6276 6.27865 11.7617 6.59635 11.8555 6.9375C11.9518 7.27865 12 7.63281 12 8C12 8.36719 11.9518 8.72135 11.8555 9.0625C11.7617 9.40365 11.6276 9.72266 11.4531 10.0195C11.2786 10.3138 11.069 10.5833 10.8242 10.8281C10.582 11.0703 10.3125 11.2786 10.0156 11.4531C9.72135 11.6276 9.40365 11.763 9.0625 11.8594C8.72135 11.9531 8.36719 12 8 12C7.63281 12 7.27865 11.9531 6.9375 11.8594C6.59635 11.763 6.27734 11.6276 5.98047 11.4531C5.6862 11.2786 5.41667 11.0703 5.17188 10.8281C4.92969 10.5833 4.72135 10.3138 4.54688 10.0195C4.3724 9.72266 4.23698 9.40365 4.14063 9.0625C4.04688 8.72135 4 8.36719 4 8C4 7.63281 4.04688 7.27865 4.14063 6.9375C4.23698 6.59635 4.3724 6.27865 4.54688 5.98438C4.72135 5.6875 4.92969 5.41797 5.17188 5.17578C5.41667 4.93099 5.6862 4.72135 5.98047 4.54688C6.27734 4.3724 6.59635 4.23828 6.9375 4.14453C7.27865 4.04818 7.63281 4 8 4Z" fill="#424242"/>
</svg>

After

Width:  |  Height:  |  Size: 1.1 KiB

View File

@@ -0,0 +1,3 @@
<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
<path fill-rule="evenodd" clip-rule="evenodd" d="M8.00001 8.70711L11.6465 12.3536L12.3536 11.6465L8.70711 8.00001L12.3536 4.35356L11.6465 3.64645L8.00001 7.2929L4.35356 3.64645L3.64645 4.35356L7.2929 8.00001L3.64645 11.6465L4.35356 12.3536L8.00001 8.70711Z" fill="white"/>
</svg>

After

Width:  |  Height:  |  Size: 376 B

View File

@@ -1 +0,0 @@
<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M9.428 8L12 10.573 10.572 12 8 9.428 5.428 12 4 10.573 6.572 8 4 5.428 5.427 4 8 6.572 10.573 4 12 5.428 9.428 8z" fill="#E8E8E8"/></svg>

Before

Width:  |  Height:  |  Size: 241 B

View File

@@ -0,0 +1,3 @@
<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
<path fill-rule="evenodd" clip-rule="evenodd" d="M8.00001 8.70711L11.6465 12.3536L12.3536 11.6465L8.70711 8.00001L12.3536 4.35356L11.6465 3.64645L8.00001 7.2929L4.35356 3.64645L3.64645 4.35356L7.2929 8.00001L3.64645 11.6465L4.35356 12.3536L8.00001 8.70711Z" fill="#424242"/>
</svg>

After

Width:  |  Height:  |  Size: 378 B

View File

@@ -0,0 +1,3 @@
<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
<path fill-rule="evenodd" clip-rule="evenodd" d="M8.00001 8.70711L11.6465 12.3536L12.3536 11.6465L8.70711 8.00001L12.3536 4.35356L11.6465 3.64645L8.00001 7.2929L4.35356 3.64645L3.64645 4.35356L7.2929 8.00001L3.64645 11.6465L4.35356 12.3536L8.00001 8.70711Z" fill="#424242"/>
</svg>

After

Width:  |  Height:  |  Size: 378 B

View File

@@ -1 +0,0 @@
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="3 3 16 16" enable-background="new 3 3 16 16"><polygon fill="#C5C5C5" points="12.597,11.042 15.4,13.845 13.844,15.4 11.042,12.598 8.239,15.4 6.683,13.845 9.485,11.042 6.683,8.239 8.238,6.683 11.042,9.486 13.845,6.683 15.4,8.239"/></svg>

Before

Width:  |  Height:  |  Size: 307 B

View File

@@ -1 +0,0 @@
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="3 3 16 16" enable-background="new 3 3 16 16"><polygon fill="#424242" points="12.597,11.042 15.4,13.845 13.844,15.4 11.042,12.598 8.239,15.4 6.683,13.845 9.485,11.042 6.683,8.239 8.238,6.683 11.042,9.486 13.845,6.683 15.4,8.239"/></svg>

Before

Width:  |  Height:  |  Size: 307 B

View File

@@ -1 +0,0 @@
<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M9.428 8L12 10.573 10.572 12 8 9.428 5.428 12 4 10.573 6.572 8 4 5.428 5.427 4 8 6.572 10.573 4 12 5.428 9.428 8z" fill="#424242"/></svg>

Before

Width:  |  Height:  |  Size: 241 B

View File

@@ -1 +0,0 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" enable-background="new 0 0 16 16" height="16" width="16"><path fill="#1E1E1E" d="M16 12h-2v2h-2v2H0V5h2V3h2V1h12v11z"/><g fill="#C5C5C5"><path d="M3 5h9v8h1V4H3zM5 2v1h9v8h1V2zM1 6v9h10V6H1zm8 7H7.5L6 11.5 4.5 13H3l2.3-2.3L3 8.5h1.5L6 10l1.5-1.5H9l-2.3 2.3L9 13z"/></g></svg>

Before

Width:  |  Height:  |  Size: 335 B

View File

@@ -1 +0,0 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" enable-background="new 0 0 16 16" height="16" width="16"><path fill="#F6F6F6" d="M16 12h-2v2h-2v2H0V5h2V3h2V1h12v11z"/><g fill="#424242"><path d="M3 5h9v8h1V4H3zM5 2v1h9v8h1V2zM1 6v9h10V6H1zm8 7H7.5L6 11.5 4.5 13H3l2.3-2.3L3 8.5h1.5L6 10l1.5-1.5H9l-2.3 2.3L9 13z"/></g></svg>

Before

Width:  |  Height:  |  Size: 335 B

View File

@@ -90,12 +90,12 @@
}
.vs .monaco-workbench .part.editor > .content .editor-group-container > .editor-group-container-toolbar .close-editor-group {
background-image: url('close-big.svg');
background-image: url('close-light.svg');
}
.vs-dark .monaco-workbench .part.editor > .content .editor-group-container > .editor-group-container-toolbar .close-editor-group,
.hc-black .monaco-workbench .part.editor > .content .editor-group-container > .editor-group-container-toolbar .close-editor-group {
background-image: url('close-big-inverse.svg');
background-image: url('close-dark.svg');
}
/* Editor */

View File

@@ -3,25 +3,6 @@
* Licensed under the Source EULA. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
.monaco-workbench .editor-statusbar-item > a:not(:first-child) {
margin-left: 5px;
}
.monaco-workbench .editor-statusbar-item > .editor-status-mode,
.monaco-workbench .editor-statusbar-item > .editor-status-encoding,
.monaco-workbench .editor-statusbar-item > .editor-status-eol,
.monaco-workbench .editor-statusbar-item > .editor-status-selection,
.monaco-workbench .editor-statusbar-item > .editor-status-indentation,
.monaco-workbench .editor-statusbar-item > .editor-status-metadata,
.monaco-workbench .editor-statusbar-item > .editor-status-tabfocusmode,
.monaco-workbench .editor-statusbar-item > .editor-status-screenreadermode {
padding: 0 5px 0 5px;
}
.monaco-workbench .editor-statusbar-item > .editor-status-metadata {
cursor: default !important;
}
.monaco-workbench .screen-reader-detected-explanation {
width: 420px;
top: 30px;
@@ -70,10 +51,13 @@
}
.vs .monaco-workbench .screen-reader-detected-explanation .cancel {
background: url('close-statusview.svg') center center no-repeat;
background: url('close-light.svg') center center no-repeat;
}
.vs-dark .monaco-workbench .screen-reader-detected-explanation .cancel {
background: url('close-dark.svg') center center no-repeat;
}
.vs-dark .monaco-workbench .screen-reader-detected-explanation .cancel,
.hc-black .monaco-workbench .screen-reader-detected-explanation .cancel {
background: url('close-statusview-inverse.svg') center center no-repeat;
background: url('close-hc.svg') center center no-repeat;
}

View File

@@ -0,0 +1,3 @@
<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
<path fill-rule="evenodd" clip-rule="evenodd" d="M3.14646 9.76777L8.14644 14.7678L8.85355 14.7678L13.8535 9.76777L13.1464 9.06066L9 13.2071L9 1L8 0.999999L8 13.2071L3.85356 9.06066L3.14646 9.76777Z" fill="#C5C5C5"/>
</svg>

After

Width:  |  Height:  |  Size: 319 B

View File

@@ -1 +0,0 @@
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="-1 -3 16 16" enable-background="new -1 -3 16 16"><path fill="#C5C5C5" d="M1 4h7l-3-3h3l4 4-4 4h-3l3-3h-7v-2z"/></svg>

Before

Width:  |  Height:  |  Size: 189 B

View File

@@ -0,0 +1,3 @@
<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
<path fill-rule="evenodd" clip-rule="evenodd" d="M3.14646 9.76777L8.14644 14.7678L8.85355 14.7678L13.8535 9.76777L13.1464 9.06066L9 13.2071L9 1L8 0.999999L8 13.2071L3.85356 9.06066L3.14646 9.76777Z" fill="#424242"/>
</svg>

After

Width:  |  Height:  |  Size: 319 B

View File

@@ -1 +0,0 @@
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="-1 -3 16 16" enable-background="new -1 -3 16 16"><path fill="#656565" d="M1 4h7l-3-3h3l4 4-4 4h-3l3-3h-7v-2z"/></svg>

Before

Width:  |  Height:  |  Size: 189 B

View File

@@ -0,0 +1,3 @@
<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
<path fill-rule="evenodd" clip-rule="evenodd" d="M6.5 1H8H9H10H11H12V2H11V13H12V14H11H10H9H8H7V13H8V8H6.5C4.567 8 3 6.433 3 4.5C3 2.567 4.567 1 6.5 1ZM9 13H10V2H9V7V8V13ZM6.5 2H8V7H6.5C5.11929 7 4 5.88071 4 4.5C4 3.11929 5.11929 2 6.5 2Z" fill="#C5C5C5"/>
</svg>

After

Width:  |  Height:  |  Size: 359 B

View File

@@ -0,0 +1,5 @@
<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
<g opacity="0.5">
<path fill-rule="evenodd" clip-rule="evenodd" d="M6.5 1H8H9H10H11H12V2H11V13H12V14H11H10H9H8H7V13H8V8H6.5C4.567 8 3 6.433 3 4.5C3 2.567 4.567 1 6.5 1ZM9 13H10V2H9V7V8V13ZM6.5 2H8V7H6.5C5.11929 7 4 5.88071 4 4.5C4 3.11929 5.11929 2 6.5 2Z" fill="#C5C5C5"/>
</g>
</svg>

After

Width:  |  Height:  |  Size: 382 B

View File

@@ -1 +0,0 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16"><defs><style>.icon-canvas-transparent,.icon-vs-out{fill:#252526;opacity:0.5;}.icon-canvas-transparent{opacity:0;}.icon-vs-bg{fill:#c5c5c5;opacity:0.5;}</style></defs><title>Paragraph_16x</title><g id="canvas"><path class="icon-canvas-transparent" d="M16,0V16H0V0Z"/></g><g id="outline" style="display: none;"><path class="icon-vs-out" d="M13,1V4H12V16H6V9.973A4.5,4.5,0,0,1,6.5,1Z"/></g><g id="iconBg"><path class="icon-vs-bg" d="M12,2V3H11V15H10V3H8V15H7V8.95A3.588,3.588,0,0,1,6.5,9a3.5,3.5,0,0,1,0-7Z"/></g></svg>

Before

Width:  |  Height:  |  Size: 576 B

View File

@@ -0,0 +1,5 @@
<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
<g opacity="0.5">
<path fill-rule="evenodd" clip-rule="evenodd" d="M6.5 1H8H9H10H11H12V2H11V13H12V14H11H10H9H8H7V13H8V8H6.5C4.567 8 3 6.433 3 4.5C3 2.567 4.567 1 6.5 1ZM9 13H10V2H9V7V8V13ZM6.5 2H8V7H6.5C5.11929 7 4 5.88071 4 4.5C4 3.11929 5.11929 2 6.5 2Z" fill="#424242"/>
</g>
</svg>

After

Width:  |  Height:  |  Size: 382 B

View File

@@ -1 +0,0 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16"><defs><style>.icon-canvas-transparent,.icon-vs-out{fill:#f6f6f6;opacity:0.5;}.icon-canvas-transparent{opacity:0;}.icon-vs-bg{fill:#424242;opacity:0.5;}</style></defs><title>Paragraph_16x</title><g id="canvas"><path class="icon-canvas-transparent" d="M16,0V16H0V0Z"/></g><g id="outline" style="display: none;"><path class="icon-vs-out" d="M13,1V4H12V16H6V9.973A4.5,4.5,0,0,1,6.5,1Z"/></g><g id="iconBg"><path class="icon-vs-bg" d="M12,2V3H11V15H10V3H8V15H7V8.95A3.588,3.588,0,0,1,6.5,9a3.5,3.5,0,0,1,0-7Z"/></g></svg>

Before

Width:  |  Height:  |  Size: 576 B

View File

@@ -1 +0,0 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16"><defs><style>.icon-canvas-transparent,.icon-vs-out{fill:#252526;}.icon-canvas-transparent{opacity:0;}.icon-vs-bg{fill:#c5c5c5;}</style></defs><title>Paragraph_16x</title><g id="canvas"><path class="icon-canvas-transparent" d="M16,0V16H0V0Z"/></g><g id="outline" style="display: none;"><path class="icon-vs-out" d="M13,1V4H12V16H6V9.973A4.5,4.5,0,0,1,6.5,1Z"/></g><g id="iconBg"><path class="icon-vs-bg" d="M12,2V3H11V15H10V3H8V15H7V8.95A3.588,3.588,0,0,1,6.5,9a3.5,3.5,0,0,1,0-7Z"/></g></svg>

Before

Width:  |  Height:  |  Size: 552 B

View File

@@ -0,0 +1,3 @@
<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
<path fill-rule="evenodd" clip-rule="evenodd" d="M6.5 1H8H9H10H11H12V2H11V13H12V14H11H10H9H8H7V13H8V8H6.5C4.567 8 3 6.433 3 4.5C3 2.567 4.567 1 6.5 1ZM9 13H10V2H9V7V8V13ZM6.5 2H8V7H6.5C5.11929 7 4 5.88071 4 4.5C4 3.11929 5.11929 2 6.5 2Z" fill="#424242"/>
</svg>

After

Width:  |  Height:  |  Size: 359 B

View File

@@ -1 +0,0 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16"><defs><style>.icon-canvas-transparent,.icon-vs-out{fill:#f6f6f6;}.icon-canvas-transparent{opacity:0;}.icon-vs-bg{fill:#424242;}</style></defs><title>Paragraph_16x</title><g id="canvas"><path class="icon-canvas-transparent" d="M16,0V16H0V0Z"/></g><g id="outline" style="display: none;"><path class="icon-vs-out" d="M13,1V4H12V16H6V9.973A4.5,4.5,0,0,1,6.5,1Z"/></g><g id="iconBg"><path class="icon-vs-bg" d="M12,2V3H11V15H10V3H8V15H7V8.95A3.588,3.588,0,0,1,6.5,9a3.5,3.5,0,0,1,0-7Z"/></g></svg>

Before

Width:  |  Height:  |  Size: 552 B

View File

@@ -0,0 +1,3 @@
<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
<path fill-rule="evenodd" clip-rule="evenodd" d="M13.8535 6.2929L8.85356 1.29291H8.14645L3.14645 6.2929L3.85356 7.00001L8 2.85357V15.0607H9V2.85357L13.1464 7.00001L13.8535 6.2929Z" fill="#C5C5C5"/>
</svg>

After

Width:  |  Height:  |  Size: 301 B

View File

@@ -1 +0,0 @@
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="-1 -3 16 16" enable-background="new -1 -3 16 16"><polygon fill="#C5C5C5" points="13,4 6,4 9,1 6,1 2,5 6,9 9,9 6,6 13,6"/></svg>

Before

Width:  |  Height:  |  Size: 199 B

View File

@@ -0,0 +1,3 @@
<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
<path fill-rule="evenodd" clip-rule="evenodd" d="M13.8535 6.2929L8.85356 1.29291H8.14645L3.14645 6.2929L3.85356 7.00001L8 2.85357V15.0607H9V2.85357L13.1464 7.00001L13.8535 6.2929Z" fill="#424242"/>
</svg>

After

Width:  |  Height:  |  Size: 301 B

View File

@@ -1 +0,0 @@
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="-1 -3 16 16" enable-background="new -1 -3 16 16"><polygon fill="#656565" points="13,4 6,4 9,1 6,1 2,5 6,9 9,9 6,6 13,6"/></svg>

Before

Width:  |  Height:  |  Size: 199 B

View File

@@ -14,19 +14,23 @@
.monaco-resource-viewer.image {
padding: 0;
background-position: 0 0, 8px 8px;
background-size: 16px 16px;
display: flex;
box-sizing: border-box;
}
.vs .monaco-resource-viewer.image {
.monaco-resource-viewer.image img {
padding: 0;
background-position: 0 0, 8px 8px;
background-size: 16px 16px;
}
.vs .monaco-resource-viewer.image img {
background-image:
linear-gradient(45deg, rgb(230, 230, 230) 25%, transparent 25%, transparent 75%, rgb(230, 230, 230) 75%, rgb(230, 230, 230)),
linear-gradient(45deg, rgb(230, 230, 230) 25%, transparent 25%, transparent 75%, rgb(230, 230, 230) 75%, rgb(230, 230, 230));
}
.vs-dark .monaco-resource-viewer.image {
.vs-dark .monaco-resource-viewer.image img {
background-image:
linear-gradient(45deg, rgb(20, 20, 20) 25%, transparent 25%, transparent 75%, rgb(20, 20, 20) 75%, rgb(20, 20, 20)),
linear-gradient(45deg, rgb(20, 20, 20) 25%, transparent 25%, transparent 75%, rgb(20, 20, 20) 75%, rgb(20, 20, 20));

View File

@@ -0,0 +1,3 @@
<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
<path fill-rule="evenodd" clip-rule="evenodd" d="M15 2L14 1L3 0.999999L2 2L2 13L3 14L14 14L15 13L15 2ZM9 2L14 2L14 13L9 13L9 2ZM8 2L3 2L3 13L8 13L8 2Z" fill="#C5C5C5"/>
</svg>

After

Width:  |  Height:  |  Size: 272 B

View File

@@ -0,0 +1,3 @@
<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
<path fill-rule="evenodd" clip-rule="evenodd" d="M15 2L14 1L3 0.999999L2 2L2 13L3 14L14 14L15 13L15 2ZM9 2L14 2L14 13L9 13L9 2ZM8 2L3 2L3 13L8 13L8 2Z" fill="white"/>
</svg>

After

Width:  |  Height:  |  Size: 270 B

View File

@@ -1 +0,0 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16"><defs><style>.icon-canvas-transparent,.icon-vs-out{fill:#252526;}.icon-canvas-transparent{opacity:0;}.icon-vs-bg{fill:#c5c5c5;}</style></defs><title>SplitScreenVertical_16x</title><g id="canvas"><path class="icon-canvas-transparent" d="M16,0V16H0V0Z"/></g><g id="outline" style="display: none;"><path class="icon-vs-out" d="M16,1V15H0V1Z" style="display: none;"/></g><g id="iconBg"><path class="icon-vs-bg" d="M1,2V14H15V2ZM7,13H2V5H7Zm7,0H9V5h5Z"/></g></svg>

Before

Width:  |  Height:  |  Size: 519 B

View File

@@ -0,0 +1,7 @@
<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
<mask id="path-1-inside-1" fill="white">
<path fill-rule="evenodd" clip-rule="evenodd" d="M15 2L14 1L3 0.999999L2 2L2 13L3 14L14 14L15 13L15 2ZM9 2L14 2L14 13L9 13L9 2ZM8 2L3 2L3 13L8 13L8 2Z"/>
</mask>
<path fill-rule="evenodd" clip-rule="evenodd" d="M15 2L14 1L3 0.999999L2 2L2 13L3 14L14 14L15 13L15 2ZM9 2L14 2L14 13L9 13L9 2ZM8 2L3 2L3 13L8 13L8 2Z" fill="#C5C5C5"/>
<path d="M14 1L14.7071 0.292893L14.4142 -2.56055e-08L14 -4.37114e-08L14 1ZM15 2L16 2L16 1.58579L15.7071 1.29289L15 2ZM3 0.999999L3 -5.24537e-07L2.58579 -5.42642e-07L2.29289 0.292893L3 0.999999ZM2 2L1.29289 1.29289L1 1.58579L1 2L2 2ZM2 13L0.999999 13L0.999999 13.4142L1.29289 13.7071L2 13ZM3 14L2.29289 14.7071L2.58579 15L3 15L3 14ZM14 14L14 15L14.4142 15L14.7071 14.7071L14 14ZM15 13L15.7071 13.7071L16 13.4142L16 13L15 13ZM14 2L15 2L15 1L14 1L14 2ZM9 2L9 1L8 1L8 2L9 2ZM14 13L14 14L15 14L15 13L14 13ZM9 13L8 13L8 14L9 14L9 13ZM8 2L9 2L9 1L8 1L8 2ZM3 2L3 0.999999L2 0.999999L2 2L3 2ZM3 13L2 13L2 14L3 14L3 13ZM8 13L8 14L9 14L9 13L8 13ZM13.2929 1.70711L14.2929 2.70711L15.7071 1.29289L14.7071 0.292893L13.2929 1.70711ZM3 2L14 2L14 -4.37114e-08L3 -5.24537e-07L3 2ZM2.70711 2.70711L3.70711 1.70711L2.29289 0.292893L1.29289 1.29289L2.70711 2.70711ZM3 13L3 2L1 2L0.999999 13L3 13ZM3.70711 13.2929L2.70711 12.2929L1.29289 13.7071L2.29289 14.7071L3.70711 13.2929ZM14 13L3 13L3 15L14 15L14 13ZM14.2929 12.2929L13.2929 13.2929L14.7071 14.7071L15.7071 13.7071L14.2929 12.2929ZM14 2L14 13L16 13L16 2L14 2ZM14 1L9 1L9 3L14 3L14 1ZM15 13L15 2L13 2L13 13L15 13ZM9 14L14 14L14 12L9 12L9 14ZM8 2L8 13L10 13L10 2L8 2ZM8 1L3 0.999999L3 3L8 3L8 1ZM2 2L2 13L4 13L4 2L2 2ZM3 14L8 14L8 12L3 12L3 14ZM9 13L9 2L7 2L7 13L9 13Z" fill="#424242" mask="url(#path-1-inside-1)"/>
</svg>

After

Width:  |  Height:  |  Size: 1.8 KiB

View File

@@ -1 +0,0 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16"><defs><style>.icon-canvas-transparent,.icon-vs-out{fill:#f6f6f6;}.icon-canvas-transparent{opacity:0;}.icon-vs-bg{fill:#424242;}</style></defs><title>SplitScreenVertical_16x</title><g id="canvas"><path class="icon-canvas-transparent" d="M16,0V16H0V0Z"/></g><g id="outline" style="display: none;"><path class="icon-vs-out" d="M16,1V15H0V1Z" style="display: none;"/></g><g id="iconBg"><path class="icon-vs-bg" d="M1,2V14H15V2ZM7,13H2V5H7Zm7,0H9V5h5Z"/></g></svg>

Before

Width:  |  Height:  |  Size: 519 B

View File

@@ -0,0 +1,3 @@
<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
<path fill-rule="evenodd" clip-rule="evenodd" d="M3 1L2 2V13L3 14H14L15 13V2L14 1H3ZM3 7V2H14V7H3ZM3 8V13H14V8H3Z" fill="#C5C5C5"/>
</svg>

After

Width:  |  Height:  |  Size: 235 B

View File

@@ -0,0 +1,3 @@
<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
<path fill-rule="evenodd" clip-rule="evenodd" d="M3 1L2 2V13L3 14H14L15 13V2L14 1H3ZM3 7V2H14V7H3ZM3 8V13H14V8H3Z" fill="white"/>
</svg>

After

Width:  |  Height:  |  Size: 233 B

View File

@@ -1 +0,0 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16"><defs><style>.icon-canvas-transparent,.icon-vs-out{fill:#252526;}.icon-canvas-transparent{opacity:0;}.icon-vs-bg{fill:#c5c5c5;}</style></defs><title>SplitScreenHorizontal_16x</title><g id="canvas"><path class="icon-canvas-transparent" d="M16,0V16H0V0Z"/></g><g id="outline" style="display: none;"><path class="icon-vs-out" d="M16,1V15H0V1Z" style="display: none;"/></g><g id="iconBg"><path class="icon-vs-bg" d="M1,2V14H15V2ZM14,13H2V10H14Zm0-5H2V5H14Z"/></g></svg>

Before

Width:  |  Height:  |  Size: 525 B

View File

@@ -0,0 +1,7 @@
<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
<mask id="path-1-inside-1" fill="white">
<path fill-rule="evenodd" clip-rule="evenodd" d="M3 1L2 2V13L3 14H14L15 13V2L14 1H3ZM3 7V2H14V7H3ZM3 8V13H14V8H3Z"/>
</mask>
<path fill-rule="evenodd" clip-rule="evenodd" d="M3 1L2 2V13L3 14H14L15 13V2L14 1H3ZM3 7V2H14V7H3ZM3 8V13H14V8H3Z" fill="#C5C5C5"/>
<path d="M2 2L1.29289 1.29289L1 1.58579V2H2ZM3 1V0H2.58579L2.29289 0.292893L3 1ZM2 13H1V13.4142L1.29289 13.7071L2 13ZM3 14L2.29289 14.7071L2.58579 15H3V14ZM14 14V15H14.4142L14.7071 14.7071L14 14ZM15 13L15.7071 13.7071L16 13.4142V13H15ZM15 2H16V1.58579L15.7071 1.29289L15 2ZM14 1L14.7071 0.292893L14.4142 0H14V1ZM3 2V1H2V2H3ZM3 7H2V8H3V7ZM14 2H15V1H14V2ZM14 7V8H15V7H14ZM3 8V7H2V8H3ZM3 13H2V14H3V13ZM14 13V14H15V13H14ZM14 8H15V7H14V8ZM2.70711 2.70711L3.70711 1.70711L2.29289 0.292893L1.29289 1.29289L2.70711 2.70711ZM3 13V2H1V13H3ZM3.70711 13.2929L2.70711 12.2929L1.29289 13.7071L2.29289 14.7071L3.70711 13.2929ZM14 13H3V15H14V13ZM14.2929 12.2929L13.2929 13.2929L14.7071 14.7071L15.7071 13.7071L14.2929 12.2929ZM14 2V13H16V2H14ZM13.2929 1.70711L14.2929 2.70711L15.7071 1.29289L14.7071 0.292893L13.2929 1.70711ZM3 2H14V0H3V2ZM2 2V7H4V2H2ZM14 1H3V3H14V1ZM15 7V2H13V7H15ZM3 8H14V6H3V8ZM2 8V13H4V8H2ZM3 14H14V12H3V14ZM15 13V8H13V13H15ZM14 7H3V9H14V7Z" fill="#424242" mask="url(#path-1-inside-1)"/>
</svg>

After

Width:  |  Height:  |  Size: 1.4 KiB

View File

@@ -1 +0,0 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16"><defs><style>.icon-canvas-transparent,.icon-vs-out{fill:#f6f6f6;}.icon-canvas-transparent{opacity:0;}.icon-vs-bg{fill:#424242;}</style></defs><title>SplitScreenHorizontal_16x</title><g id="canvas"><path class="icon-canvas-transparent" d="M16,0V16H0V0Z"/></g><g id="outline" style="display: none;"><path class="icon-vs-out" d="M16,1V15H0V1Z" style="display: none;"/></g><g id="iconBg"><path class="icon-vs-bg" d="M1,2V14H15V2ZM14,13H2V10H14Zm0-5H2V5H14Z"/></g></svg>

Before

Width:  |  Height:  |  Size: 525 B

View File

@@ -217,21 +217,24 @@
}
.vs .monaco-workbench .part.editor > .content .editor-group-container > .title .tabs-container > .tab.dirty .close-editor-action {
background: url('close-dirty.svg') center center no-repeat;
background: url('close-dirty-light.svg') center center no-repeat;
}
.vs-dark .monaco-workbench .part.editor > .content .editor-group-container > .title .tabs-container > .tab.dirty .close-editor-action,
.hc-black .monaco-workbench .part.editor > .content .editor-group-container > .title .tabs-container > .tab.dirty .close-editor-action {
background: url('close-dirty-inverse.svg') center center no-repeat;
background: url('close-dirty-dark.svg') center center no-repeat;
}
.vs .monaco-workbench .part.editor > .content .editor-group-container > .title .tabs-container > .tab.dirty .close-editor-action:hover {
background: url('close.svg') center center no-repeat;
background: url('close-light.svg') center center no-repeat;
}
.vs-dark .monaco-workbench .part.editor > .content .editor-group-container > .title .tabs-container > .tab.dirty .close-editor-action:hover {
background: url('close-dark.svg') center center no-repeat;
}
.vs-dark .monaco-workbench .part.editor > .content .editor-group-container > .title .tabs-container > .tab.dirty .close-editor-action:hover,
.hc-black .monaco-workbench .part.editor > .content .editor-group-container > .title .tabs-container > .tab.dirty .close-editor-action:hover {
background: url('close-inverse.svg') center center no-repeat;
background: url('close-hc.svg') center center no-repeat;
}
/* No Tab Close Button */
@@ -252,12 +255,12 @@
}
.vs .monaco-workbench .part.editor > .content .editor-group-container > .title .tabs-container > .tab.close-button-off.dirty:not(.dirty-border-top) {
background-image: url('close-dirty.svg');
background-image: url('close-dirty-light.svg');
}
.vs-dark .monaco-workbench .part.editor > .content .editor-group-container > .title .tabs-container > .tab.close-button-off.dirty:not(.dirty-border-top),
.hc-black .monaco-workbench .part.editor > .content .editor-group-container > .title .tabs-container > .tab.close-button-off.dirty {
background-image: url('close-dirty-inverse.svg');
background-image: url('close-dirty-dark.svg');
}
/* Editor Actions */

View File

@@ -51,18 +51,21 @@
/* Drag Cursor */
.monaco-workbench .part.editor > .content .editor-group-container > .title {
cursor: -webkit-grab;
cursor: grab;
}
/* Actions */
.monaco-workbench .part.editor > .content .editor-group-container > .title .close-editor-action {
background: url('close.svg') center center no-repeat;
background: url('close-light.svg') center center no-repeat;
}
.vs-dark .monaco-workbench .part.editor > .content .editor-group-container > .title .close-editor-action {
background: url('close-dark.svg') center center no-repeat;
}
.vs-dark .monaco-workbench .part.editor > .content .editor-group-container > .title .close-editor-action,
.hc-black .monaco-workbench .part.editor > .content .editor-group-container > .title .close-editor-action {
background: url('close-inverse.svg') center center no-repeat;
background: url('close-hc.svg') center center no-repeat;
}
/* Drag and Drop Feedback */

Some files were not shown because too many files have changed in this diff Show More