提交 e8f7ac78 编写于 作者: B Benjamin Pasero

💄

上级 156de5ea
...@@ -40,7 +40,6 @@ export class StatusbarPart extends Part implements IStatusbarService { ...@@ -40,7 +40,6 @@ export class StatusbarPart extends Part implements IStatusbarService {
private static PRIORITY_PROP = 'priority'; private static PRIORITY_PROP = 'priority';
private static ALIGNMENT_PROP = 'alignment'; private static ALIGNMENT_PROP = 'alignment';
private toDispose: IDisposable[];
private statusItemsContainer: Builder; private statusItemsContainer: Builder;
private statusMsgDispose: IDisposable; private statusMsgDispose: IDisposable;
...@@ -52,7 +51,11 @@ export class StatusbarPart extends Part implements IStatusbarService { ...@@ -52,7 +51,11 @@ export class StatusbarPart extends Part implements IStatusbarService {
) { ) {
super(id, { hasTitle: false }, themeService); super(id, { hasTitle: false }, themeService);
this.toDispose = []; this.registerListeners();
}
private registerListeners(): void {
this.toUnbind.push(this.contextService.onDidChangeWorkspaceRoots(() => this.updateStyles()));
} }
public addEntry(entry: IStatusbarEntry, alignment: StatusbarAlignment, priority: number = 0): IDisposable { public addEntry(entry: IStatusbarEntry, alignment: StatusbarAlignment, priority: number = 0): IDisposable {
...@@ -120,7 +123,7 @@ export class StatusbarPart extends Part implements IStatusbarService { ...@@ -120,7 +123,7 @@ export class StatusbarPart extends Part implements IStatusbarService {
const descriptors = rightDescriptors.concat(leftDescriptors); // right first because they float const descriptors = rightDescriptors.concat(leftDescriptors); // right first because they float
this.toDispose.push(...descriptors.map(descriptor => { this.toUnbind.push(...descriptors.map(descriptor => {
const item = this.instantiationService.createInstance(descriptor.syncDescriptor); const item = this.instantiationService.createInstance(descriptor.syncDescriptor);
const el = this.doCreateStatusItem(descriptor.alignment, descriptor.priority); const el = this.doCreateStatusItem(descriptor.alignment, descriptor.priority);
...@@ -200,12 +203,6 @@ export class StatusbarPart extends Part implements IStatusbarService { ...@@ -200,12 +203,6 @@ export class StatusbarPart extends Part implements IStatusbarService {
return dispose; return dispose;
} }
public dispose(): void {
this.toDispose = dispose(this.toDispose);
super.dispose();
}
} }
let manageExtensionAction: ManageExtensionAction; let manageExtensionAction: ManageExtensionAction;
......
...@@ -4,7 +4,6 @@ ...@@ -4,7 +4,6 @@
*--------------------------------------------------------------------------------------------*/ *--------------------------------------------------------------------------------------------*/
import 'vs/css!vs/workbench/parts/debug/browser/media/debugActionsWidget'; import 'vs/css!vs/workbench/parts/debug/browser/media/debugActionsWidget';
import * as lifecycle from 'vs/base/common/lifecycle';
import * as errors from 'vs/base/common/errors'; import * as errors from 'vs/base/common/errors';
import * as strings from 'vs/base/common/strings'; import * as strings from 'vs/base/common/strings';
import * as browser from 'vs/base/browser/browser'; import * as browser from 'vs/base/browser/browser';
...@@ -45,7 +44,6 @@ export class DebugActionsWidget extends Themable implements IWorkbenchContributi ...@@ -45,7 +44,6 @@ export class DebugActionsWidget extends Themable implements IWorkbenchContributi
private $el: builder.Builder; private $el: builder.Builder;
private dragArea: builder.Builder; private dragArea: builder.Builder;
private toDispose: lifecycle.IDisposable[];
private actionBar: ActionBar; private actionBar: ActionBar;
private allActions: AbstractDebugAction[]; private allActions: AbstractDebugAction[];
private activeActions: AbstractDebugAction[]; private activeActions: AbstractDebugAction[];
...@@ -72,7 +70,6 @@ export class DebugActionsWidget extends Themable implements IWorkbenchContributi ...@@ -72,7 +70,6 @@ export class DebugActionsWidget extends Themable implements IWorkbenchContributi
const actionBarContainter = $().div().addClass('.action-bar-container'); const actionBarContainter = $().div().addClass('.action-bar-container');
this.$el.append(actionBarContainter); this.$el.append(actionBarContainter);
this.toDispose = [];
this.activeActions = []; this.activeActions = [];
this.actionBar = new ActionBar(actionBarContainter, { this.actionBar = new ActionBar(actionBarContainter, {
orientation: ActionsOrientation.HORIZONTAL, orientation: ActionsOrientation.HORIZONTAL,
...@@ -87,7 +84,7 @@ export class DebugActionsWidget extends Themable implements IWorkbenchContributi ...@@ -87,7 +84,7 @@ export class DebugActionsWidget extends Themable implements IWorkbenchContributi
this.updateStyles(); this.updateStyles();
this.toDispose.push(this.actionBar); this.toUnbind.push(this.actionBar);
this.registerListeners(); this.registerListeners();
this.hide(); this.hide();
...@@ -95,9 +92,9 @@ export class DebugActionsWidget extends Themable implements IWorkbenchContributi ...@@ -95,9 +92,9 @@ export class DebugActionsWidget extends Themable implements IWorkbenchContributi
} }
private registerListeners(): void { private registerListeners(): void {
this.toDispose.push(this.debugService.onDidChangeState(state => this.update(state))); this.toUnbind.push(this.debugService.onDidChangeState(state => this.update(state)));
this.toDispose.push(this.configurationService.onDidUpdateConfiguration(() => this.update(this.debugService.state))); this.toUnbind.push(this.configurationService.onDidUpdateConfiguration(() => this.update(this.debugService.state)));
this.toDispose.push(this.actionBar.actionRunner.addListener(EventType.RUN, (e: any) => { this.toUnbind.push(this.actionBar.actionRunner.addListener(EventType.RUN, (e: any) => {
// check for error // check for error
if (e.error && !errors.isPromiseCanceledError(e.error)) { if (e.error && !errors.isPromiseCanceledError(e.error)) {
this.messageService.show(severity.Error, e.error); this.messageService.show(severity.Error, e.error);
...@@ -108,7 +105,7 @@ export class DebugActionsWidget extends Themable implements IWorkbenchContributi ...@@ -108,7 +105,7 @@ export class DebugActionsWidget extends Themable implements IWorkbenchContributi
this.telemetryService.publicLog('workbenchActionExecuted', { id: e.action.id, from: 'debugActionsWidget' }); this.telemetryService.publicLog('workbenchActionExecuted', { id: e.action.id, from: 'debugActionsWidget' });
} }
})); }));
$(window).on(dom.EventType.RESIZE, () => this.setXCoordinate(), this.toDispose); $(window).on(dom.EventType.RESIZE, () => this.setXCoordinate(), this.toUnbind);
this.dragArea.on(dom.EventType.MOUSE_UP, (event: MouseEvent) => { this.dragArea.on(dom.EventType.MOUSE_UP, (event: MouseEvent) => {
const mouseClickEvent = new StandardMouseEvent(event); const mouseClickEvent = new StandardMouseEvent(event);
...@@ -137,8 +134,8 @@ export class DebugActionsWidget extends Themable implements IWorkbenchContributi ...@@ -137,8 +134,8 @@ export class DebugActionsWidget extends Themable implements IWorkbenchContributi
}); });
}); });
this.toDispose.push(this.partService.onTitleBarVisibilityChange(() => this.positionDebugWidget())); this.toUnbind.push(this.partService.onTitleBarVisibilityChange(() => this.positionDebugWidget()));
this.toDispose.push(browser.onDidChangeZoomLevel(() => this.positionDebugWidget())); this.toUnbind.push(browser.onDidChangeZoomLevel(() => this.positionDebugWidget()));
} }
private storePosition(): void { private storePosition(): void {
...@@ -235,7 +232,7 @@ export class DebugActionsWidget extends Themable implements IWorkbenchContributi ...@@ -235,7 +232,7 @@ export class DebugActionsWidget extends Themable implements IWorkbenchContributi
this.allActions.push(this.instantiationService.createInstance(ReverseContinueAction, ReverseContinueAction.ID, ReverseContinueAction.LABEL)); this.allActions.push(this.instantiationService.createInstance(ReverseContinueAction, ReverseContinueAction.ID, ReverseContinueAction.LABEL));
this.allActions.push(this.instantiationService.createInstance(FocusProcessAction, FocusProcessAction.ID, FocusProcessAction.LABEL)); this.allActions.push(this.instantiationService.createInstance(FocusProcessAction, FocusProcessAction.ID, FocusProcessAction.LABEL));
this.allActions.forEach(a => { this.allActions.forEach(a => {
this.toDispose.push(a); this.toUnbind.push(a);
}); });
} }
...@@ -271,7 +268,7 @@ export class DebugActionsWidget extends Themable implements IWorkbenchContributi ...@@ -271,7 +268,7 @@ export class DebugActionsWidget extends Themable implements IWorkbenchContributi
} }
public dispose(): void { public dispose(): void {
this.toDispose = lifecycle.dispose(this.toDispose); super.dispose();
if (this.$el) { if (this.$el) {
this.$el.destroy(); this.$el.destroy();
......
...@@ -9,7 +9,6 @@ import uri from 'vs/base/common/uri'; ...@@ -9,7 +9,6 @@ import uri from 'vs/base/common/uri';
import { wireCancellationToken } from 'vs/base/common/async'; import { wireCancellationToken } from 'vs/base/common/async';
import { TPromise } from 'vs/base/common/winjs.base'; import { TPromise } from 'vs/base/common/winjs.base';
import * as errors from 'vs/base/common/errors'; import * as errors from 'vs/base/common/errors';
import * as lifecycle from 'vs/base/common/lifecycle';
import { IAction } from 'vs/base/common/actions'; import { IAction } from 'vs/base/common/actions';
import { Dimension, Builder } from 'vs/base/browser/builder'; import { Dimension, Builder } from 'vs/base/browser/builder';
import * as dom from 'vs/base/browser/dom'; import * as dom from 'vs/base/browser/dom';
...@@ -73,7 +72,6 @@ export class Repl extends Panel implements IPrivateReplService { ...@@ -73,7 +72,6 @@ export class Repl extends Panel implements IPrivateReplService {
private static REPL_INPUT_INITIAL_HEIGHT = 19; private static REPL_INPUT_INITIAL_HEIGHT = 19;
private static REPL_INPUT_MAX_HEIGHT = 170; private static REPL_INPUT_MAX_HEIGHT = 170;
private toDispose: lifecycle.IDisposable[];
private tree: ITree; private tree: ITree;
private renderer: ReplExpressionsRenderer; private renderer: ReplExpressionsRenderer;
private characterWidthSurveyor: HTMLElement; private characterWidthSurveyor: HTMLElement;
...@@ -99,15 +97,14 @@ export class Repl extends Panel implements IPrivateReplService { ...@@ -99,15 +97,14 @@ export class Repl extends Panel implements IPrivateReplService {
super(debug.REPL_ID, telemetryService, themeService); super(debug.REPL_ID, telemetryService, themeService);
this.replInputHeight = Repl.REPL_INPUT_INITIAL_HEIGHT; this.replInputHeight = Repl.REPL_INPUT_INITIAL_HEIGHT;
this.toDispose = [];
this.registerListeners(); this.registerListeners();
} }
private registerListeners(): void { private registerListeners(): void {
this.toDispose.push(this.debugService.getModel().onDidChangeReplElements(() => { this.toUnbind.push(this.debugService.getModel().onDidChangeReplElements(() => {
this.refreshReplElements(this.debugService.getModel().getReplElements().length === 0); this.refreshReplElements(this.debugService.getModel().getReplElements().length === 0);
})); }));
this.toDispose.push(this.panelService.onDidPanelOpen(panel => this.refreshReplElements(true))); this.toUnbind.push(this.panelService.onDidPanelOpen(panel => this.refreshReplElements(true)));
} }
private refreshReplElements(noDelay: boolean): void { private refreshReplElements(noDelay: boolean): void {
...@@ -154,8 +151,8 @@ export class Repl extends Panel implements IPrivateReplService { ...@@ -154,8 +151,8 @@ export class Repl extends Panel implements IPrivateReplService {
controller controller
}, replTreeOptions); }, replTreeOptions);
this.toDispose.push(attachListStyler(this.tree, this.themeService)); this.toUnbind.push(attachListStyler(this.tree, this.themeService));
this.toDispose.push(this.listService.register(this.tree)); this.toUnbind.push(this.listService.register(this.tree));
if (!Repl.HISTORY) { if (!Repl.HISTORY) {
Repl.HISTORY = new ReplHistory(JSON.parse(this.storageService.get(HISTORY_STORAGE_KEY, StorageScope.WORKSPACE, '[]'))); Repl.HISTORY = new ReplHistory(JSON.parse(this.storageService.get(HISTORY_STORAGE_KEY, StorageScope.WORKSPACE, '[]')));
...@@ -168,7 +165,7 @@ export class Repl extends Panel implements IPrivateReplService { ...@@ -168,7 +165,7 @@ export class Repl extends Panel implements IPrivateReplService {
this.replInputContainer = dom.append(container, $('.repl-input-wrapper')); this.replInputContainer = dom.append(container, $('.repl-input-wrapper'));
const scopedContextKeyService = this.contextKeyService.createScoped(this.replInputContainer); const scopedContextKeyService = this.contextKeyService.createScoped(this.replInputContainer);
this.toDispose.push(scopedContextKeyService); this.toUnbind.push(scopedContextKeyService);
debug.CONTEXT_IN_DEBUG_REPL.bindTo(scopedContextKeyService).set(true); debug.CONTEXT_IN_DEBUG_REPL.bindTo(scopedContextKeyService).set(true);
const onFirstReplLine = debug.CONTEXT_ON_FIRST_DEBUG_REPL_LINE.bindTo(scopedContextKeyService); const onFirstReplLine = debug.CONTEXT_ON_FIRST_DEBUG_REPL_LINE.bindTo(scopedContextKeyService);
onFirstReplLine.set(true); onFirstReplLine.set(true);
...@@ -197,20 +194,20 @@ export class Repl extends Panel implements IPrivateReplService { ...@@ -197,20 +194,20 @@ export class Repl extends Panel implements IPrivateReplService {
} }
}); });
this.toDispose.push(this.replInput.onDidScrollChange(e => { this.toUnbind.push(this.replInput.onDidScrollChange(e => {
if (!e.scrollHeightChanged) { if (!e.scrollHeightChanged) {
return; return;
} }
this.replInputHeight = Math.max(Repl.REPL_INPUT_INITIAL_HEIGHT, Math.min(Repl.REPL_INPUT_MAX_HEIGHT, e.scrollHeight, this.dimension.height)); this.replInputHeight = Math.max(Repl.REPL_INPUT_INITIAL_HEIGHT, Math.min(Repl.REPL_INPUT_MAX_HEIGHT, e.scrollHeight, this.dimension.height));
this.layout(this.dimension); this.layout(this.dimension);
})); }));
this.toDispose.push(this.replInput.onDidChangeCursorPosition(e => { this.toUnbind.push(this.replInput.onDidChangeCursorPosition(e => {
onFirstReplLine.set(e.position.lineNumber === 1); onFirstReplLine.set(e.position.lineNumber === 1);
onLastReplLine.set(e.position.lineNumber === this.replInput.getModel().getLineCount()); onLastReplLine.set(e.position.lineNumber === this.replInput.getModel().getLineCount());
})); }));
this.toDispose.push(dom.addStandardDisposableListener(this.replInputContainer, dom.EventType.FOCUS, () => dom.addClass(this.replInputContainer, 'synthetic-focus'))); this.toUnbind.push(dom.addStandardDisposableListener(this.replInputContainer, dom.EventType.FOCUS, () => dom.addClass(this.replInputContainer, 'synthetic-focus')));
this.toDispose.push(dom.addStandardDisposableListener(this.replInputContainer, dom.EventType.BLUR, () => dom.removeClass(this.replInputContainer, 'synthetic-focus'))); this.toUnbind.push(dom.addStandardDisposableListener(this.replInputContainer, dom.EventType.BLUR, () => dom.removeClass(this.replInputContainer, 'synthetic-focus')));
} }
public navigateHistory(previous: boolean): void { public navigateHistory(previous: boolean): void {
...@@ -270,7 +267,7 @@ export class Repl extends Panel implements IPrivateReplService { ...@@ -270,7 +267,7 @@ export class Repl extends Panel implements IPrivateReplService {
]; ];
this.actions.forEach(a => { this.actions.forEach(a => {
this.toDispose.push(a); this.toUnbind.push(a);
}); });
} }
...@@ -311,7 +308,6 @@ export class Repl extends Panel implements IPrivateReplService { ...@@ -311,7 +308,6 @@ export class Repl extends Panel implements IPrivateReplService {
public dispose(): void { public dispose(): void {
this.replInput.dispose(); this.replInput.dispose();
this.toDispose = lifecycle.dispose(this.toDispose);
super.dispose(); super.dispose();
} }
} }
......
...@@ -48,11 +48,8 @@ export class StatusBarColorProvider extends Themable implements IWorkbenchContri ...@@ -48,11 +48,8 @@ export class StatusBarColorProvider extends Themable implements IWorkbenchContri
} }
private registerListeners(): void { private registerListeners(): void {
this.toUnbind.push(this.debugService.onDidChangeState(state => this.onDidChangeState(state))); this.toUnbind.push(this.debugService.onDidChangeState(state => this.updateStyles()));
} this.toUnbind.push(this.contextService.onDidChangeWorkspaceRoots(state => this.updateStyles()));
private onDidChangeState(state: State): void {
this.updateStyles();
} }
protected updateStyles(): void { protected updateStyles(): void {
......
...@@ -58,6 +58,12 @@ export class FeedbackStatusbarItem extends Themable implements IStatusbarItem { ...@@ -58,6 +58,12 @@ export class FeedbackStatusbarItem extends Themable implements IStatusbarItem {
@IThemeService themeService: IThemeService @IThemeService themeService: IThemeService
) { ) {
super(themeService); super(themeService);
this.registerListeners();
}
private registerListeners(): void {
this.toUnbind.push(this.contextService.onDidChangeWorkspaceRoots(() => this.updateStyles()));
} }
protected updateStyles(): void { protected updateStyles(): void {
......
...@@ -10,7 +10,6 @@ import URI from 'vs/base/common/uri'; ...@@ -10,7 +10,6 @@ import URI from 'vs/base/common/uri';
import { TPromise } from 'vs/base/common/winjs.base'; import { TPromise } from 'vs/base/common/winjs.base';
import { Delayer } from 'vs/base/common/async'; import { Delayer } from 'vs/base/common/async';
import dom = require('vs/base/browser/dom'); import dom = require('vs/base/browser/dom');
import lifecycle = require('vs/base/common/lifecycle');
import builder = require('vs/base/browser/builder'); import builder = require('vs/base/browser/builder');
import { IAction, Action } from 'vs/base/common/actions'; import { IAction, Action } from 'vs/base/common/actions';
import { IActionItem } from 'vs/base/browser/ui/actionbar/actionbar'; import { IActionItem } from 'vs/base/browser/ui/actionbar/actionbar';
...@@ -44,7 +43,6 @@ export class MarkersPanel extends Panel { ...@@ -44,7 +43,6 @@ export class MarkersPanel extends Panel {
public markersModel: MarkersModel; public markersModel: MarkersModel;
private toDispose: lifecycle.IDisposable[];
private delayedRefresh: Delayer<void>; private delayedRefresh: Delayer<void>;
private lastSelectedRelativeTop: number = 0; private lastSelectedRelativeTop: number = 0;
...@@ -78,7 +76,6 @@ export class MarkersPanel extends Panel { ...@@ -78,7 +76,6 @@ export class MarkersPanel extends Panel {
@IThemeService themeService: IThemeService @IThemeService themeService: IThemeService
) { ) {
super(Constants.MARKERS_PANEL_ID, telemetryService, themeService); super(Constants.MARKERS_PANEL_ID, telemetryService, themeService);
this.toDispose = [];
this.delayedRefresh = new Delayer<void>(500); this.delayedRefresh = new Delayer<void>(500);
this.autoExpanded = new Set<string>(); this.autoExpanded = new Set<string>();
this.markerFocusContextKey = Constants.MarkerFocusContextKey.bindTo(contextKeyService); this.markerFocusContextKey = Constants.MarkerFocusContextKey.bindTo(contextKeyService);
...@@ -89,7 +86,7 @@ export class MarkersPanel extends Panel { ...@@ -89,7 +86,7 @@ export class MarkersPanel extends Panel {
this.markersModel = new MarkersModel(); this.markersModel = new MarkersModel();
this.rangeHighlightDecorations = this.instantiationService.createInstance(RangeHighlightDecorations); this.rangeHighlightDecorations = this.instantiationService.createInstance(RangeHighlightDecorations);
this.toDispose.push(this.rangeHighlightDecorations); this.toUnbind.push(this.rangeHighlightDecorations);
dom.addClass(parent.getHTMLElement(), 'markers-panel'); dom.addClass(parent.getHTMLElement(), 'markers-panel');
...@@ -233,7 +230,7 @@ export class MarkersPanel extends Panel { ...@@ -233,7 +230,7 @@ export class MarkersPanel extends Panel {
this.markerFocusContextKey.set(false); this.markerFocusContextKey.set(false);
}); });
this.toDispose.push(this.listService.register(this.tree)); this.toUnbind.push(this.listService.register(this.tree));
} }
private createActions(): void { private createActions(): void {
...@@ -244,15 +241,15 @@ export class MarkersPanel extends Panel { ...@@ -244,15 +241,15 @@ export class MarkersPanel extends Panel {
this.collapseAllAction this.collapseAllAction
]; ];
this.actions.forEach(a => { this.actions.forEach(a => {
this.toDispose.push(a); this.toUnbind.push(a);
}); });
} }
private createListeners(): void { private createListeners(): void {
this.toDispose.push(this.configurationService.onDidUpdateConfiguration(e => this.onConfigurationsUpdated(this.configurationService.getConfiguration<IProblemsConfiguration>()))); this.toUnbind.push(this.configurationService.onDidUpdateConfiguration(e => this.onConfigurationsUpdated(this.configurationService.getConfiguration<IProblemsConfiguration>())));
this.toDispose.push(this.markerService.onMarkerChanged(this.onMarkerChanged, this)); this.toUnbind.push(this.markerService.onMarkerChanged(this.onMarkerChanged, this));
this.toDispose.push(this.editorGroupService.onEditorsChanged(this.onEditorsChanged, this)); this.toUnbind.push(this.editorGroupService.onEditorsChanged(this.onEditorsChanged, this));
this.toDispose.push(this.tree.addListener('selection', () => this.onSelected())); this.toUnbind.push(this.tree.addListener('selection', () => this.onSelected()));
} }
private onMarkerChanged(changedResources: URI[]) { private onMarkerChanged(changedResources: URI[]) {
...@@ -409,10 +406,10 @@ export class MarkersPanel extends Panel { ...@@ -409,10 +406,10 @@ export class MarkersPanel extends Panel {
} }
public dispose(): void { public dispose(): void {
super.dispose();
this.delayedRefresh.cancel(); this.delayedRefresh.cancel();
this.toDispose = lifecycle.dispose(this.toDispose);
this.tree.dispose(); this.tree.dispose();
this.markersModel.dispose(); this.markersModel.dispose();
super.dispose();
} }
} }
\ No newline at end of file
...@@ -5,7 +5,6 @@ ...@@ -5,7 +5,6 @@
import 'vs/css!./media/output'; import 'vs/css!./media/output';
import nls = require('vs/nls'); import nls = require('vs/nls');
import { IDisposable, dispose } from 'vs/base/common/lifecycle';
import { TPromise } from 'vs/base/common/winjs.base'; import { TPromise } from 'vs/base/common/winjs.base';
import { Action, IAction } from 'vs/base/common/actions'; import { Action, IAction } from 'vs/base/common/actions';
import { Builder } from 'vs/base/browser/builder'; import { Builder } from 'vs/base/browser/builder';
...@@ -27,7 +26,6 @@ import { IModeService } from 'vs/editor/common/services/modeService'; ...@@ -27,7 +26,6 @@ import { IModeService } from 'vs/editor/common/services/modeService';
import { ITextFileService } from 'vs/workbench/services/textfile/common/textfiles'; import { ITextFileService } from 'vs/workbench/services/textfile/common/textfiles';
export class OutputPanel extends TextResourceEditor { export class OutputPanel extends TextResourceEditor {
private toDispose: IDisposable[];
private actions: IAction[]; private actions: IAction[];
private scopedInstantiationService: IInstantiationService; private scopedInstantiationService: IInstantiationService;
...@@ -46,7 +44,6 @@ export class OutputPanel extends TextResourceEditor { ...@@ -46,7 +44,6 @@ export class OutputPanel extends TextResourceEditor {
super(telemetryService, instantiationService, storageService, configurationService, themeService, editorGroupService, modeService, textFileService); super(telemetryService, instantiationService, storageService, configurationService, themeService, editorGroupService, modeService, textFileService);
this.scopedInstantiationService = instantiationService; this.scopedInstantiationService = instantiationService;
this.toDispose = [];
} }
public getId(): string { public getId(): string {
...@@ -62,7 +59,7 @@ export class OutputPanel extends TextResourceEditor { ...@@ -62,7 +59,7 @@ export class OutputPanel extends TextResourceEditor {
]; ];
this.actions.forEach(a => { this.actions.forEach(a => {
this.toDispose.push(a); this.toUnbind.push(a);
}); });
} }
...@@ -111,7 +108,7 @@ export class OutputPanel extends TextResourceEditor { ...@@ -111,7 +108,7 @@ export class OutputPanel extends TextResourceEditor {
// First create the scoped instantation service and only then construct the editor using the scoped service // First create the scoped instantation service and only then construct the editor using the scoped service
const scopedContextKeyService = this.contextKeyService.createScoped(parent.getHTMLElement()); const scopedContextKeyService = this.contextKeyService.createScoped(parent.getHTMLElement());
this.toDispose.push(scopedContextKeyService); this.toUnbind.push(scopedContextKeyService);
this.scopedInstantiationService = this.instantiationService.createChild(new ServiceCollection([IContextKeyService, scopedContextKeyService])); this.scopedInstantiationService = this.instantiationService.createChild(new ServiceCollection([IContextKeyService, scopedContextKeyService]));
super.createEditor(parent); super.createEditor(parent);
...@@ -122,10 +119,4 @@ export class OutputPanel extends TextResourceEditor { ...@@ -122,10 +119,4 @@ export class OutputPanel extends TextResourceEditor {
public get instantiationService(): IInstantiationService { public get instantiationService(): IInstantiationService {
return this.scopedInstantiationService; return this.scopedInstantiationService;
} }
public dispose(): void {
this.toDispose = dispose(this.toDispose);
super.dispose();
}
} }
...@@ -69,7 +69,6 @@ export class SearchViewlet extends Viewlet { ...@@ -69,7 +69,6 @@ export class SearchViewlet extends Viewlet {
private static SHOW_REPLACE_STORAGE_KEY = 'vs.search.show.replace'; private static SHOW_REPLACE_STORAGE_KEY = 'vs.search.show.replace';
private isDisposed: boolean; private isDisposed: boolean;
private toDispose: lifecycle.IDisposable[];
private loading: boolean; private loading: boolean;
private queryBuilder: QueryBuilder; private queryBuilder: QueryBuilder;
...@@ -126,7 +125,6 @@ export class SearchViewlet extends Viewlet { ...@@ -126,7 +125,6 @@ export class SearchViewlet extends Viewlet {
) { ) {
super(Constants.VIEWLET_ID, telemetryService, themeService); super(Constants.VIEWLET_ID, telemetryService, themeService);
this.toDispose = [];
this.viewletVisible = Constants.SearchViewletVisibleKey.bindTo(contextKeyService); this.viewletVisible = Constants.SearchViewletVisibleKey.bindTo(contextKeyService);
this.inputBoxFocused = Constants.InputBoxFocusedKey.bindTo(this.contextKeyService); this.inputBoxFocused = Constants.InputBoxFocusedKey.bindTo(this.contextKeyService);
this.inputPatternIncludesFocused = Constants.PatternIncludesFocusedKey.bindTo(this.contextKeyService); this.inputPatternIncludesFocused = Constants.PatternIncludesFocusedKey.bindTo(this.contextKeyService);
...@@ -483,7 +481,7 @@ export class SearchViewlet extends Viewlet { ...@@ -483,7 +481,7 @@ export class SearchViewlet extends Viewlet {
keyboardSupport: false keyboardSupport: false
}); });
this.toDispose.push(attachListStyler(this.tree, this.themeService)); this.toUnbind.push(attachListStyler(this.tree, this.themeService));
this.tree.setInput(this.viewModel.searchResult); this.tree.setInput(this.viewModel.searchResult);
this.toUnbind.push(renderer); this.toUnbind.push(renderer);
...@@ -1427,8 +1425,6 @@ export class SearchViewlet extends Viewlet { ...@@ -1427,8 +1425,6 @@ export class SearchViewlet extends Viewlet {
public dispose(): void { public dispose(): void {
this.isDisposed = true; this.isDisposed = true;
this.toDispose = lifecycle.dispose(this.toDispose);
if (this.tree) { if (this.tree) {
this.tree.dispose(); this.tree.dispose();
} }
......
...@@ -283,6 +283,12 @@ class BuildStatusBarItem extends Themable implements IStatusbarItem { ...@@ -283,6 +283,12 @@ class BuildStatusBarItem extends Themable implements IStatusbarItem {
this.activeCount = 0; this.activeCount = 0;
this.icons = []; this.icons = [];
this.registerListeners();
}
private registerListeners(): void {
this.toUnbind.push(this.contextService.onDidChangeWorkspaceRoots(() => this.updateStyles()));
} }
protected updateStyles(): void { protected updateStyles(): void {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册