Revert "Merge from vscode 81d7885dc2e9dc617e1522697a2966bc4025a45d (#5949)" (#5983)

This reverts commit d15a3fcc98.
This commit is contained in:
Karl Burtram
2019-06-11 12:35:58 -07:00
committed by GitHub
parent 95a50b7892
commit 5a7562a37b
926 changed files with 11394 additions and 19540 deletions

View File

@@ -4,7 +4,7 @@
*--------------------------------------------------------------------------------------------*/
import 'vs/css!./watermark';
import { Disposable } from 'vs/base/common/lifecycle';
import { IDisposable, dispose } from 'vs/base/common/lifecycle';
import { assign } from 'vs/base/common/objects';
import { isMacintosh, OS } from 'vs/base/common/platform';
import { IKeybindingService } from 'vs/platform/keybinding/common/keybinding';
@@ -120,8 +120,9 @@ const folderEntries = [
const WORKBENCH_TIPS_ENABLED_KEY = 'workbench.tips.enabled';
export class WatermarkContribution extends Disposable implements IWorkbenchContribution {
export class WatermarkContribution implements IWorkbenchContribution {
private toDispose: IDisposable[] = [];
private watermark: HTMLElement;
private enabled: boolean;
private workbenchState: WorkbenchState;
@@ -134,7 +135,6 @@ export class WatermarkContribution extends Disposable implements IWorkbenchContr
@IConfigurationService private readonly configurationService: IConfigurationService,
@IEditorGroupsService private readonly editorGroupsService: IEditorGroupsService
) {
super();
this.workbenchState = contextService.getWorkbenchState();
lifecycleService.onShutdown(this.dispose, this);
@@ -142,7 +142,7 @@ export class WatermarkContribution extends Disposable implements IWorkbenchContr
if (this.enabled) {
this.create();
}
this._register(this.configurationService.onDidChangeConfiguration(e => {
this.toDispose.push(this.configurationService.onDidChangeConfiguration(e => {
if (e.affectsConfiguration(WORKBENCH_TIPS_ENABLED_KEY)) {
const enabled = this.configurationService.getValue<boolean>(WORKBENCH_TIPS_ENABLED_KEY);
if (enabled !== this.enabled) {
@@ -155,7 +155,7 @@ export class WatermarkContribution extends Disposable implements IWorkbenchContr
}
}
}));
this._register(this.contextService.onDidChangeWorkbenchState(e => {
this.toDispose.push(this.contextService.onDidChangeWorkbenchState(e => {
const previousWorkbenchState = this.workbenchState;
this.workbenchState = this.contextService.getWorkbenchState();
@@ -189,8 +189,8 @@ export class WatermarkContribution extends Disposable implements IWorkbenchContr
};
update();
dom.prepend(container.firstElementChild as HTMLElement, this.watermark);
this._register(this.keybindingService.onDidUpdateKeybindings(update));
this._register(this.editorGroupsService.onDidLayout(dimension => this.handleEditorPartSize(container, dimension)));
this.toDispose.push(this.keybindingService.onDidUpdateKeybindings(update));
this.toDispose.push(this.editorGroupsService.onDidLayout(dimension => this.handleEditorPartSize(container, dimension)));
this.handleEditorPartSize(container, this.editorGroupsService.dimension);
}
@@ -215,6 +215,10 @@ export class WatermarkContribution extends Disposable implements IWorkbenchContr
this.destroy();
this.create();
}
public dispose(): void {
this.toDispose = dispose(this.toDispose);
}
}
Registry.as<IWorkbenchContributionsRegistry>(WorkbenchExtensions.Workbench)