import * as vscode from 'vscode' ; let extensionContext ; let webview ; function setExtensionContext ( context ) { extensionContext = context ; } function getExtensionContext ( ) { return extensionContext ; } function setPanelWebview ( webviewClass ) { webview = webviewClass ; } function getPanelWebview ( ) { return webview ; } function outputLog ( ... arr ) { console . log ( '日志' , ... arr ) ; webview . postMessage ( 'console-log' , arr ) ; } function isProduction ( ) { return process . env . NODE_ENV === 'production' ; } function showMessage ( message , type = 'error' ) { const actions = { info : ( ) => { vscode . window . showInformationMessage ( message ) ; } , alert : ( ) => { vscode . window . showWarningMessage ( message ) ; } , error : ( ) => { vscode . window . showErrorMessage ( message ) ; } , } ; actions [ type ] ( ) ; } export { isProduction , outputLog , getPanelWebview , setPanelWebview , showMessage , setExtensionContext , getExtensionContext , } ;