'use strict' ; import vscode = require ( 'vscode' ) ; const versionBarEntry = vscode . window . createStatusBarItem ( vscode . StatusBarAlignment . Right , Number . MIN_VALUE ) ; let _enable = false ; export function showHideStatus ( ) { if ( ! versionBarEntry || ! _enable ) { return ; } if ( ! vscode . window . activeTextEditor ) { versionBarEntry . hide ( ) ; return ; } let doc = vscode . window . activeTextEditor . document ; if ( vscode . languages . match ( 'javascript' , doc ) || vscode . languages . match ( 'javascriptreact' , doc ) || vscode . languages . match ( 'typescript' , doc ) || vscode . languages . match ( 'typescriptreact' , doc ) ) { versionBarEntry . show ( ) ; return ; } versionBarEntry . hide ( ) ; } export function disposeStatus ( ) { if ( versionBarEntry ) { versionBarEntry . dispose ( ) ; } } export function setInfo ( message , tooltip ) { versionBarEntry . text = message ; versionBarEntry . tooltip = tooltip ; let color = 'white' ; versionBarEntry . color = color ; if ( _enable ) { versionBarEntry . show ( ) ; } } export function enable ( value ) { _enable = value ; showHideStatus ( ) ; }