import * as vscode from 'vscode' ; import { replayPlay } from './replaySelect' ; export class replaytTimeLineTree implements vscode . TreeDataProvider < SourceTreeItem > { private _onDidChangeTreeData : vscode . EventEmitter < SourceTreeItem | undefined > = new vscode . EventEmitter < SourceTreeItem | undefined > ( ) ; readonly onDidChangeTreeData : vscode . Event < SourceTreeItem | undefined > = this . _onDidChangeTreeData . event ; constructor ( private workspaceRoot , private oreplayPlay ) { } refresh ( ) { this . _onDidChangeTreeData . fire ( undefined ) ; } getTreeItem ( element ) { return element ; } getChildren ( element ? ) { if ( element === undefined ) return this . oreplayPlay . timeLine ; else return element . timelines ; } getParent ? ( element ) { throw new Error ( "Method not implemented." ) ; } } export class SourceTreeItem extends vscode . TreeItem { public timelines : SourceTreeItem [ ] ; public timestamp : Date ; public line : string ; constructor ( public readonly label , public source , public datacompilacao , public readonly collapsibleState ) { super ( label , collapsibleState ) ; this . timelines = [ ] ; } get tooltip ( ) : string { if ( this . datacompilacao === null ) return `${ this . label }-${ this . timestamp }` ; else return `${ this . label }- Compiled at ${ this . datacompilacao }` ; } contextValue = 'timeline' ; }