blob: 35983c5cb375cf60b884e9aee3fc156eb03e10f8 [file] [log] [blame]
/*---------------------------------------------------------
* Copyright (C) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------*/
import vscode = require('vscode');
let globalState: vscode.Memento;
export function getFromGlobalState(key: string, defaultValue?: any) {
if (!globalState) {
return defaultValue;
}
return globalState.get(key, defaultValue);
}
export function updateGlobalState(key: string, value: any) {
if (!globalState) {
return;
}
return globalState.update(key, value);
}
export function setGlobalState(state: vscode.Memento) {
globalState = state;
}