Merge from vscode 81d7885dc2e9dc617e1522697a2966bc4025a45d (#5949)

* Merge from vscode 81d7885dc2e9dc617e1522697a2966bc4025a45d

* Fix vs unit tests and hygiene issue

* Fix strict null check issue
This commit is contained in:
Chris LaFreniere
2019-06-10 18:27:09 -07:00
committed by GitHub
parent ff38bc8143
commit d15a3fcc98
926 changed files with 19529 additions and 11383 deletions

View File

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