Skip to content

Commit

Permalink
💄
Browse files Browse the repository at this point in the history
  • Loading branch information
bpasero committed Jul 9, 2019
1 parent c0989df commit 2ea7d60
Show file tree
Hide file tree
Showing 7 changed files with 37 additions and 37 deletions.
8 changes: 4 additions & 4 deletions src/vs/workbench/browser/parts/editor/editorControl.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ export class EditorControl extends Disposable {
private _activeControl: BaseEditor | null;
private controls: BaseEditor[] = [];

private readonly activeControlDisposeables = this._register(new DisposableStore());
private readonly activeControlDisposables = this._register(new DisposableStore());
private dimension: Dimension;
private editorOperation: LongRunningOperation;

Expand Down Expand Up @@ -139,12 +139,12 @@ export class EditorControl extends Disposable {
this._activeControl = control;

// Clear out previous active control listeners
this.activeControlDisposeables.clear();
this.activeControlDisposables.clear();

// Listen to control changes
if (control) {
this.activeControlDisposeables.add(control.onDidSizeConstraintsChange(e => this._onDidSizeConstraintsChange.fire(e)));
this.activeControlDisposeables.add(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
Expand Down
9 changes: 5 additions & 4 deletions src/vs/workbench/browser/parts/editor/editorStatus.ts
Original file line number Diff line number Diff line change
Expand Up @@ -900,7 +900,7 @@ export class ChangeModeAction extends Action {

return {
label: lang,
iconClasses: getIconClasses(this.modelService, this.modeService, this.getResource(lang)),
iconClasses: getIconClasses(this.modelService, this.modeService, this.getFakeResource(lang)),
description
};
});
Expand Down Expand Up @@ -999,7 +999,7 @@ export class ChangeModeAction extends Action {
return {
id,
label: lang,
iconClasses: getIconClasses(this.modelService, this.modeService, this.getResource(lang)),
iconClasses: getIconClasses(this.modelService, this.modeService, this.getFakeResource(lang)),
description: (id === currentAssociation) ? nls.localize('currentAssociation', "Current Association") : undefined
};
});
Expand Down Expand Up @@ -1031,9 +1031,9 @@ export class ChangeModeAction extends Action {
}, 50 /* quick open is sensitive to being opened so soon after another */);
}

private getResource(lang: string): URI | undefined {
// construct a fake resource to be able to show nice icons if any
private getFakeResource(lang: string): URI | undefined {
let fakeResource: URI | undefined;

const extensions = this.modeService.getExtensions(lang);
if (extensions && extensions.length) {
fakeResource = URI.file(extensions[0]);
Expand All @@ -1043,6 +1043,7 @@ export class ChangeModeAction extends Action {
fakeResource = URI.file(filenames[0]);
}
}

return fakeResource;
}
}
Expand Down
10 changes: 5 additions & 5 deletions src/vs/workbench/browser/parts/editor/tabsTitleControl.ts
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ export class TabsTitleControl extends TitleControl {

private tabResourceLabels: ResourceLabels;
private tabLabels: IEditorInputLabel[] = [];
private tabDisposeables: IDisposable[] = [];
private tabDisposables: IDisposable[] = [];

private dimension: Dimension;
private readonly layoutScheduled = this._register(new MutableDisposable());
Expand Down Expand Up @@ -301,7 +301,7 @@ export class TabsTitleControl extends TitleControl {
(this.tabsContainer.lastChild as HTMLElement).remove();

// Remove associated tab label and widget
this.tabDisposeables.pop()!.dispose();
this.tabDisposables.pop()!.dispose();
}

// A removal of a label requires to recompute all labels
Expand All @@ -315,7 +315,7 @@ export class TabsTitleControl extends TitleControl {
else {
clearNode(this.tabsContainer);

this.tabDisposeables = dispose(this.tabDisposeables);
this.tabDisposables = dispose(this.tabDisposables);
this.tabResourceLabels.clear();
this.tabLabels = [];

Expand Down Expand Up @@ -454,7 +454,7 @@ export class TabsTitleControl extends TitleControl {
// Eventing
const eventsDisposable = this.registerTabListeners(tabContainer, index);

this.tabDisposeables.push(combinedDisposable(eventsDisposable, tabActionBar, tabActionRunner, editorLabel));
this.tabDisposables.push(combinedDisposable(eventsDisposable, tabActionBar, tabActionRunner, editorLabel));

return tabContainer;
}
Expand Down Expand Up @@ -1149,7 +1149,7 @@ export class TabsTitleControl extends TitleControl {
dispose(): void {
super.dispose();

this.tabDisposeables = dispose(this.tabDisposeables);
this.tabDisposables = dispose(this.tabDisposables);
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ export class NotificationsToasts extends Themable {
// Make Visible
addClass(this.notificationsToastsContainer, 'visible');

const itemDisposeables = new DisposableStore();
const itemDisposables = new DisposableStore();

// Container
const notificationToastContainer = document.createElement('div');
Expand All @@ -158,12 +158,12 @@ export class NotificationsToasts extends Themable {
ariaLabel: localize('notificationsToast', "Notification Toast"),
verticalScrollMode: ScrollbarVisibility.Hidden
});
itemDisposeables.add(notificationList);
itemDisposables.add(notificationList);

const toast: INotificationToast = { item, list: notificationList, container: notificationToastContainer, toast: notificationToast, toDispose: itemDisposeables };
const toast: INotificationToast = { item, list: notificationList, container: notificationToastContainer, toast: notificationToast, toDispose: itemDisposables };
this.mapNotificationToToast.set(item, toast);

itemDisposeables.add(toDisposable(() => {
itemDisposables.add(toDisposable(() => {
if (this.isVisible(toast)) {
this.notificationsToastsContainer.removeChild(toast.container);
}
Expand All @@ -184,12 +184,12 @@ export class NotificationsToasts extends Themable {
this.layoutContainer(maxDimensions.height);

// Update when item height changes due to expansion
itemDisposeables.add(item.onDidExpansionChange(() => {
itemDisposables.add(item.onDidExpansionChange(() => {
notificationList.updateNotificationsList(0, 1, [item]);
}));

// Update when item height potentially changes due to label changes
itemDisposeables.add(item.onDidLabelChange(e => {
itemDisposables.add(item.onDidLabelChange(e => {
if (!item.expanded) {
return; // dynamic height only applies to expanded notifications
}
Expand All @@ -205,7 +205,7 @@ export class NotificationsToasts extends Themable {
});

// Automatically purge non-sticky notifications
this.purgeNotification(item, notificationToastContainer, notificationList, itemDisposeables);
this.purgeNotification(item, notificationToastContainer, notificationList, itemDisposables);

// Theming
this.updateStyles();
Expand All @@ -215,7 +215,7 @@ export class NotificationsToasts extends Themable {

// Animate in
addClass(notificationToast, 'notification-fade-in');
itemDisposeables.add(addDisposableListener(notificationToast, 'transitionend', () => {
itemDisposables.add(addDisposableListener(notificationToast, 'transitionend', () => {
removeClass(notificationToast, 'notification-fade-in');
addClass(notificationToast, 'notification-fade-in-done');
}));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -288,7 +288,7 @@ export class NotificationTemplateRenderer extends Disposable {

private static readonly SEVERITIES: Array<'info' | 'warning' | 'error'> = ['info', 'warning', 'error'];

private readonly inputDisposeables = this._register(new DisposableStore());
private readonly inputDisposables = this._register(new DisposableStore());

constructor(
private template: INotificationTemplateData,
Expand All @@ -308,7 +308,7 @@ export class NotificationTemplateRenderer extends Disposable {
}

setInput(notification: INotificationViewItem): void {
this.inputDisposeables.clear();
this.inputDisposables.clear();

this.render(notification);
}
Expand All @@ -317,7 +317,7 @@ export class NotificationTemplateRenderer extends Disposable {

// Container
toggleClass(this.template.container, 'expanded', notification.expanded);
this.inputDisposeables.add(addDisposableListener(this.template.container, EventType.MOUSE_UP, e => {
this.inputDisposables.add(addDisposableListener(this.template.container, EventType.MOUSE_UP, e => {
if (e.button === 1 /* Middle Button */) {
EventHelper.stop(e);

Expand All @@ -344,7 +344,7 @@ export class NotificationTemplateRenderer extends Disposable {
this.renderProgress(notification);

// Label Change Events
this.inputDisposeables.add(notification.onDidLabelChange(event => {
this.inputDisposables.add(notification.onDidLabelChange(event => {
switch (event.kind) {
case NotificationViewItemLabelKind.SEVERITY:
this.renderSeverity(notification);
Expand All @@ -370,7 +370,7 @@ export class NotificationTemplateRenderer extends Disposable {
clearNode(this.template.message);
this.template.message.appendChild(NotificationMessageRenderer.render(notification.message, {
callback: link => this.openerService.open(URI.parse(link)),
toDispose: this.inputDisposeables
toDispose: this.inputDisposables
}));

const messageOverflows = notification.canCollapse && !notification.expanded && this.template.message.scrollWidth > this.template.message.clientWidth;
Expand All @@ -395,7 +395,7 @@ export class NotificationTemplateRenderer extends Disposable {
if (isNonEmptyArray(notification.actions.secondary)) {
const configureNotificationAction = this.instantiationService.createInstance(ConfigureNotificationAction, ConfigureNotificationAction.ID, ConfigureNotificationAction.LABEL, notification.actions.secondary);
actions.push(configureNotificationAction);
this.inputDisposeables.add(configureNotificationAction);
this.inputDisposables.add(configureNotificationAction);
}

// Expand / Collapse
Expand Down Expand Up @@ -441,7 +441,7 @@ export class NotificationTemplateRenderer extends Disposable {
const action = notification.actions.primary![index];
button.label = action.label;

this.inputDisposeables.add(button.onDidClick(e => {
this.inputDisposables.add(button.onDidClick(e => {
EventHelper.stop(e, true);

// Run action
Expand All @@ -453,10 +453,10 @@ export class NotificationTemplateRenderer extends Disposable {
}
}));

this.inputDisposeables.add(attachButtonStyler(button, this.themeService));
this.inputDisposables.add(attachButtonStyler(button, this.themeService));
});

this.inputDisposeables.add(buttonGroup);
this.inputDisposables.add(buttonGroup);
}
}

Expand Down
1 change: 0 additions & 1 deletion src/vs/workbench/electron-browser/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,6 @@ class CodeRendererMain extends Disposable {
fileService.registerProvider(Schemas.vscodeRemote, remoteFileSystemProvider);
}


const payload = await this.resolveWorkspaceInitializationPayload();

const services = await Promise.all([
Expand Down
12 changes: 6 additions & 6 deletions src/vs/workbench/services/editor/browser/editorService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -118,29 +118,29 @@ export class EditorService extends Disposable implements EditorServiceImpl {
}

private registerGroupListeners(group: IEditorGroupView): void {
const groupDisposeables = new DisposableStore();
const groupDisposables = new DisposableStore();

groupDisposeables.add(group.onDidGroupChange(e => {
groupDisposables.add(group.onDidGroupChange(e => {
if (e.kind === GroupChangeKind.EDITOR_ACTIVE) {
this.handleActiveEditorChange(group);
this._onDidVisibleEditorsChange.fire();
}
}));

groupDisposeables.add(group.onDidCloseEditor(event => {
groupDisposables.add(group.onDidCloseEditor(event => {
this._onDidCloseEditor.fire(event);
}));

groupDisposeables.add(group.onWillOpenEditor(event => {
groupDisposables.add(group.onWillOpenEditor(event => {
this.onGroupWillOpenEditor(group, event);
}));

groupDisposeables.add(group.onDidOpenEditorFail(editor => {
groupDisposables.add(group.onDidOpenEditorFail(editor => {
this._onDidOpenEditorFail.fire({ editor, groupId: group.id });
}));

Event.once(group.onWillDispose)(() => {
dispose(groupDisposeables);
dispose(groupDisposables);
});
}

Expand Down

0 comments on commit 2ea7d60

Please sign in to comment.