import vscode = require ( 'vscode' ) ; let globalState ; let workspaceState ; export function getFromGlobalState ( key , defaultValue ? ) { if ( ! globalState ) { return defaultValue ; } return globalState . get ( key , defaultValue ) ; } export function updateGlobalState ( key , value ) { if ( ! globalState ) { return ; } return globalState . update ( key , value ) ; } export function setGlobalState ( state ) { globalState = state ; } export function getFromWorkspaceState ( key , defaultValue ? ) { if ( ! workspaceState ) { return defaultValue ; } return workspaceState . get ( key , defaultValue ) ; } export function updateWorkspaceState ( key , value ) { if ( ! workspaceState ) { return ; } return workspaceState . update ( key , value ) ; } export function setWorkspaceState ( state ) { workspaceState = state ; }