From 7f58924aae18ea31cc4ffcbc813c23ca8d53446f Mon Sep 17 00:00:00 2001 From: Martin Aeschlimann Date: Mon, 22 Oct 2018 12:59:21 +0200 Subject: [PATCH] Revert "fix strict null errors" This reverts commit 9ea18e6a9186d2ab46bd26e5a01f97a1254fd52e. --- src/tsconfig.strictNullChecks.json | 1 - src/vs/platform/storage/common/storage.ts | 18 +++++++++--------- src/vs/platform/windows/common/windows.ts | 2 +- 3 files changed, 10 insertions(+), 11 deletions(-) diff --git a/src/tsconfig.strictNullChecks.json b/src/tsconfig.strictNullChecks.json index 1961c4ea5fc..33ac650937a 100644 --- a/src/tsconfig.strictNullChecks.json +++ b/src/tsconfig.strictNullChecks.json @@ -431,7 +431,6 @@ "./vs/platform/update/node/update.config.contribution.ts", "./vs/platform/url/common/url.ts", "./vs/platform/url/common/urlService.ts", - "./vs/platform/windows/common/windows.ts", "./vs/platform/workbench/common/contextkeys.ts", "./vs/platform/workspace/common/workspace.ts", "./vs/platform/workspace/test/common/testWorkspace.ts", diff --git a/src/vs/platform/storage/common/storage.ts b/src/vs/platform/storage/common/storage.ts index 913e2f0610a..fb6e3fd3a0c 100644 --- a/src/vs/platform/storage/common/storage.ts +++ b/src/vs/platform/storage/common/storage.ts @@ -30,7 +30,7 @@ export interface IStorageService { * The scope argument allows to define the scope of the storage * operation to either the current workspace only or all workspaces. */ - get(key: string, scope: StorageScope, fallbackValue?: R): R; + get(key: string, scope: StorageScope, fallbackValue?: string): string | undefined; /** * Retrieve an element stored with the given key from storage. Use @@ -40,7 +40,7 @@ export interface IStorageService { * The scope argument allows to define the scope of the storage * operation to either the current workspace only or all workspaces. */ - getBoolean(key: string, scope: StorageScope, fallbackValue?: R): R; + getBoolean(key: string, scope: StorageScope, fallbackValue?: boolean): boolean | undefined; /** * Retrieve an element stored with the given key from storage. Use @@ -50,7 +50,7 @@ export interface IStorageService { * The scope argument allows to define the scope of the storage * operation to either the current workspace only or all workspaces. */ - getInteger(key: string, scope: StorageScope, fallbackValue?: R): R; + getInteger(key: string, scope: StorageScope, fallbackValue?: number): number | undefined; /** * Store a string value under the given key to storage. The value will @@ -94,16 +94,16 @@ export const NullStorageService: IStorageService = { onDidChangeStorage: Event.None, onWillSaveState: Event.None, - get(key: string, scope: StorageScope, fallbackValue?: R): R { - return fallbackValue as R; + get(key: string, scope: StorageScope, fallbackValue?: string): string | undefined { + return fallbackValue; }, - getBoolean(key: string, scope: StorageScope, fallbackValue?: R): R { - return fallbackValue as R; + getBoolean(key: string, scope: StorageScope, fallbackValue?: boolean): boolean | undefined { + return fallbackValue; }, - getInteger(key: string, scope: StorageScope, fallbackValue?: R): R { - return fallbackValue as R; + getInteger(key: string, scope: StorageScope, fallbackValue?: number): number | undefined { + return fallbackValue; }, store(key: string, value: any, scope: StorageScope): Promise { diff --git a/src/vs/platform/windows/common/windows.ts b/src/vs/platform/windows/common/windows.ts index 7b0472e8d94..facb0567866 100644 --- a/src/vs/platform/windows/common/windows.ts +++ b/src/vs/platform/windows/common/windows.ts @@ -379,7 +379,7 @@ export class ActiveWindowManager implements IDisposable { .then(id => (typeof this._activeWindowId === 'undefined') && this.setActiveWindow(id)); } - private setActiveWindow(windowId: number | undefined) { + private setActiveWindow(windowId: number) { if (this.firstActiveWindowIdPromise) { this.firstActiveWindowIdPromise = null; }