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

@@ -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)