Reduce usage of TPromise in extHost.protocol

This commit is contained in:
Alex Dima
2018-09-04 16:02:09 +02:00
parent 9be61bb1d0
commit 591e83f8a4
12 changed files with 91 additions and 94 deletions

View File

@@ -4,7 +4,6 @@
*--------------------------------------------------------------------------------------------*/
'use strict';
import { TPromise } from 'vs/base/common/winjs.base';
import { MainContext, MainThreadStorageShape, IMainContext } from './extHost.protocol';
export class ExtHostStorage {
@@ -15,11 +14,11 @@ export class ExtHostStorage {
this._proxy = mainContext.getProxy(MainContext.MainThreadStorage);
}
getValue<T>(shared: boolean, key: string, defaultValue?: T): TPromise<T> {
getValue<T>(shared: boolean, key: string, defaultValue?: T): Thenable<T> {
return this._proxy.$getValue<T>(shared, key).then(value => value || defaultValue);
}
setValue(shared: boolean, key: string, value: any): TPromise<void> {
setValue(shared: boolean, key: string, value: any): Thenable<void> {
return this._proxy.$setValue(shared, key, value);
}
}