import * as vscode from 'vscode' ; import { Plugin } from './plugin' ; const ENABLED = false ; export interface StatusBarItemConfig { enableStatusBarComboCounter ? : boolean ; } export class StatusBarItem implements Plugin { private config : StatusBarItemConfig = { } ; private statusBarItem : vscode . StatusBarItem ; public activate = ( ) => { if ( this . statusBarItem ) { return ; } this . statusBarItem = vscode . window . createStatusBarItem ( vscode . StatusBarAlignment . Left ) ; this . statusBarItem . show ( ) ; } ; dispose = ( ) => { if ( ! this . statusBarItem ) { return ; } this . statusBarItem . dispose ( ) ; this . statusBarItem = null ; } ; public onPowermodeStart = ( combo ) => { } ; public onPowermodeStop = ( combo ) => { } ; public onComboStart = ( combo ) => { this . updateStatusBar ( combo ) ; } ; public onComboStop = ( combo ) => { this . updateStatusBar ( combo ) ; } ; public onDidChangeTextDocument = ( combo , powermode , event ) => { this . updateStatusBar ( combo , powermode ) ; } ; public onDidChangeConfiguration = ( config ) => { this . config . enableStatusBarComboCounter = config . get < boolean > ( 'enableStatusBarComboCounter' , true ) ; if ( this . config . enableStatusBarComboCounter ) { this . activate ( ) ; } else { this . dispose ( ) ; } } ; private updateStatusBar = ( combo , powermode ? ) => { if ( ! this . statusBarItem ) { return ; } const prefix = powermode ? 'POWER MODE!!! ' : '' ; this . statusBarItem . text = `${ prefix }Combo: ${ combo }` ; } ; }