'use strict' ; import { CppToolsTestHook , Status , IntelliSenseStatus } from 'vscode-cpptools/out/testApi' ; import * as vscode from 'vscode' ; export class TestHook implements CppToolsTestHook { private intelliSenseStatusChangedEvent : vscode . EventEmitter < IntelliSenseStatus > = new vscode . EventEmitter < IntelliSenseStatus > ( ) ; private statusChangedEvent : vscode . EventEmitter < Status > = new vscode . EventEmitter < Status > ( ) ; public get StatusChanged ( ) : vscode . Event < Status > { return this . statusChangedEvent . event ; } public get IntelliSenseStatusChanged ( ) : vscode . Event < IntelliSenseStatus > { return this . intelliSenseStatusChangedEvent . event ; } public get valid ( ) : boolean { return ! ! this . intelliSenseStatusChangedEvent && ! ! this . statusChangedEvent ; } public updateStatus ( status ) { this . intelliSenseStatusChangedEvent . fire ( status ) ; this . statusChangedEvent . fire ( status . status ) ; } public dispose ( ) { this . intelliSenseStatusChangedEvent . dispose ( ) ; this . statusChangedEvent . dispose ( ) ; } } let testHook ; export function getTestHook ( ) { if ( ! testHook || ! testHook . valid ) { testHook = new TestHook ( ) ; } return testHook ; }