fix(lib/vscode): update storageService getStorage methods
This change refactors a lot of the get methods in the storageService. I think it simplies a lot. It removes a bunch of methods.
This commit is contained in:
parent
325f21f73d
commit
d1ad3fad5e
@ -153,35 +153,8 @@ export class NativeStorageService extends AbstractStorageService {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
<<<<<<< HEAD
|
|
||||||
get(key: string, scope: StorageScope, fallbackValue: string): string;
|
|
||||||
get(key: string, scope: StorageScope): string | undefined;
|
|
||||||
get(key: string, scope: StorageScope, fallbackValue?: string): string | undefined {
|
|
||||||
return this.getStorage(scope).get(key, fallbackValue);
|
|
||||||
}
|
|
||||||
|
|
||||||
getBoolean(key: string, scope: StorageScope, fallbackValue: boolean): boolean;
|
|
||||||
getBoolean(key: string, scope: StorageScope): boolean | undefined;
|
|
||||||
getBoolean(key: string, scope: StorageScope, fallbackValue?: boolean): boolean | undefined {
|
|
||||||
return this.getStorage(scope).getBoolean(key, fallbackValue);
|
|
||||||
}
|
|
||||||
|
|
||||||
getNumber(key: string, scope: StorageScope, fallbackValue: number): number;
|
|
||||||
getNumber(key: string, scope: StorageScope): number | undefined;
|
|
||||||
getNumber(key: string, scope: StorageScope, fallbackValue?: number): number | undefined {
|
|
||||||
return this.getStorage(scope).getNumber(key, fallbackValue);
|
|
||||||
}
|
|
||||||
|
|
||||||
protected doStore(key: string, value: string | boolean | number | undefined | null, scope: StorageScope): Promise<void> {
|
|
||||||
return this.getStorage(scope).set(key, value);
|
|
||||||
}
|
|
||||||
|
|
||||||
protected doRemove(key: string, scope: StorageScope): void {
|
|
||||||
this.getStorage(scope).delete(key);
|
|
||||||
=======
|
|
||||||
protected getStorage(scope: StorageScope): IStorage | undefined {
|
protected getStorage(scope: StorageScope): IStorage | undefined {
|
||||||
return scope === StorageScope.GLOBAL ? this.globalStorage : this.workspaceStorage;
|
return scope === StorageScope.GLOBAL ? this.globalStorage : this.workspaceStorage;
|
||||||
>>>>>>> e8cd17a97d8c58fffcbac05394b3ee2b3c72d384
|
|
||||||
}
|
}
|
||||||
|
|
||||||
protected getLogDetails(scope: StorageScope): string | undefined {
|
protected getLogDetails(scope: StorageScope): string | undefined {
|
||||||
|
Reference in New Issue
Block a user