@@ -6,7 +6,7 @@ import { TimeInterval, TimePoint } from './model/time';
66import { Scope } from './model/scope' ;
77import { Variable } from './model/variable' ;
88import { StatusBarItem } from './ui/status' ;
9- import { BoundReference , Reference , Sample } from './model/sample' ;
9+ import { Reference , UnboundReference , Sample } from './model/sample' ;
1010
1111export enum CXXRTLSimulationStatus {
1212Paused = 'paused' ,
@@ -28,12 +28,16 @@ export class CXXRTLDebugger {
2828// Session properties.
2929
3030private _sessionStatus :CXXRTLSessionStatus = CXXRTLSessionStatus . Absent ;
31- public get sessionStatus ( ) { return this . _sessionStatus ; }
31+ public get sessionStatus ( ) {
32+ return this . _sessionStatus ;
33+ }
3234private _onDidChangeSessionStatus :vscode . EventEmitter < CXXRTLSessionStatus > = new vscode . EventEmitter < CXXRTLSessionStatus > ( ) ;
3335readonly onDidChangeSessionStatus :vscode . Event < CXXRTLSessionStatus > = this . _onDidChangeSessionStatus . event ;
3436
3537private _currentTime :TimePoint = new TimePoint ( 0n , 0n ) ;
36- public get currentTime ( ) { return this . _currentTime ; }
38+ public get currentTime ( ) {
39+ return this . _currentTime ;
40+ }
3741private _onDidChangeCurrentTime :vscode . EventEmitter < TimePoint > = new vscode . EventEmitter < TimePoint > ( ) ;
3842readonly onDidChangeCurrentTime :vscode . Event < TimePoint > = this . _onDidChangeCurrentTime . event ;
3943
@@ -42,12 +46,16 @@ export class CXXRTLDebugger {
4246private simulationStatusUpdateTimeout :NodeJS . Timeout | null = null ;
4347
4448private _simulationStatus :CXXRTLSimulationStatus = CXXRTLSimulationStatus . Finished ;
45- public get simulationStatus ( ) { return this . _simulationStatus ; }
49+ public get simulationStatus ( ) {
50+ return this . _simulationStatus ;
51+ }
4652private _onDidChangeSimulationStatus :vscode . EventEmitter < CXXRTLSimulationStatus > = new vscode . EventEmitter < CXXRTLSimulationStatus > ( ) ;
4753readonly onDidChangeSimulationStatus :vscode . Event < CXXRTLSimulationStatus > = this . _onDidChangeSimulationStatus . event ;
4854
4955private _latestTime :TimePoint = new TimePoint ( 0n , 0n ) ;
50- public get latestTime ( ) { return this . _latestTime ; }
56+ public get latestTime ( ) {
57+ return this . _latestTime ;
58+ }
5159private _onDidChangeLatestTime :vscode . EventEmitter < TimePoint > = new vscode . EventEmitter < TimePoint > ( ) ;
5260readonly onDidChangeLatestTime :vscode . Event < TimePoint > = this . _onDidChangeLatestTime . event ;
5361
@@ -63,7 +71,7 @@ export class CXXRTLDebugger {
6371
6472public async startSession ( ) :Promise < void > {
6573if ( this . terminal !== null ) {
66- vscode . window . showErrorMessage ( " A debug session is already in the process of being started." ) ;
74+ vscode . window . showErrorMessage ( ' A debug session is already in the process of being started.' ) ;
6775return ;
6876}
6977
@@ -81,39 +89,39 @@ export class CXXRTLDebugger {
8189this . setSessionStatus ( CXXRTLSessionStatus . Starting ) ;
8290
8391const processId = await this . terminal . processId ;
84- console . log ( " [RTL Debugger] Launched process %d" , processId ) ;
92+ console . log ( ' [RTL Debugger] Launched process %d' , processId ) ;
8593
8694setTimeout ( ( ) => {
8795const socket = net . createConnection ( { port :configuration . port , host :'::1' } , ( ) => {
88- vscode . window . showInformationMessage ( " Connected to the CXXRTL server." ) ;
96+ vscode . window . showInformationMessage ( ' Connected to the CXXRTL server.' ) ;
8997
9098( async ( ) => {
9199this . connection = new Connection ( new NodeStreamLink ( socket ) ) ;
92100this . setSessionStatus ( CXXRTLSessionStatus . Running ) ;
93101this . updateSimulationStatus ( ) ;
94- console . log ( " [RTL Debugger] Initialized" ) ;
102+ console . log ( ' [RTL Debugger] Initialized' ) ;
95103} ) ( ) . catch ( ( ) => {
96104this . stopSession ( ) ;
97105} ) ;
98106} ) ;
99107socket . on ( 'error' , ( err :any ) => {
100108if ( err . code === 'ECONNREFUSED' ) {
101- vscode . window . showErrorMessage ( " The connection to the CXXRTL server was refused." ) ;
109+ vscode . window . showErrorMessage ( ' The connection to the CXXRTL server was refused.' ) ;
102110} else {
103111vscode . window . showErrorMessage ( `The connection to the CXXRTL server has failed:${ err . code } .` ) ;
104112}
105113this . stopSession ( ) ;
106114} ) ;
107115socket . on ( 'close' , ( hadError ) => {
108116if ( ! hadError ) {
109- vscode . window . showInformationMessage ( " Disconnected from the CXXRTL server." ) ;
117+ vscode . window . showInformationMessage ( ' Disconnected from the CXXRTL server.' ) ;
110118}
111119this . stopSession ( ) ;
112120} ) ;
113121} , 500 ) ; // FIXME
114122} else {
115- const OpenSettings = " Open Settings" ;
116- const selection = await vscode . window . showErrorMessage ( " Configure the launch command to start a debug session." , OpenSettings ) ;
123+ const OpenSettings = ' Open Settings' ;
124+ const selection = await vscode . window . showErrorMessage ( ' Configure the launch command to start a debug session.' , OpenSettings ) ;
117125if ( selection === OpenSettings ) {
118126vscode . commands . executeCommand ( 'workbench.action.openSettings' , 'rtlDebugger.command' ) ;
119127}
@@ -254,7 +262,7 @@ export class CXXRTLDebugger {
254262for ( const [ cxxrtlName , cxxrtlDesc ] of Object . entries ( cxxrtlResponse . scopes ) ) {
255263const nestedScopes :Scope [ ] = [ ] ;
256264const nestedVariables :Thenable < Variable [ ] > = {
257- //NormallyPromises are evaluated eagerly; this Thenable does it lazily.
265+ //Normally Promises are evaluated eagerly; this Thenable does it lazily.
258266then :( onfulfilled , onrejected ) => {
259267return this . getVariablesForScope ( cxxrtlName ) . then ( onfulfilled , onrejected ) ;
260268}
@@ -292,7 +300,7 @@ export class CXXRTLDebugger {
292300}
293301}
294302
295- public bindReference ( name :string , reference :Reference ) :BoundReference {
303+ public bindReference ( name :string , reference :UnboundReference ) :Reference {
296304const epoch = this . advanceReferenceEpoch ( name ) ;
297305// Note that we do not wait for the command to complete. Although it is possible for
298306// the command to fail, this would only happen if one of the designations is invalid,
@@ -303,13 +311,13 @@ export class CXXRTLDebugger {
303311reference :name ,
304312items :reference . cxxrtlItemDesignations ( )
305313} ) . catch ( ( error ) => {
306- console . error ( ` [CXXRTL] invalid designation while binding reference` ,
314+ console . error ( ' [CXXRTL] invalid designation while binding reference' ,
307315`${ name } #${ epoch } ` , error ) ;
308316} ) ;
309- return new BoundReference ( name , epoch , reference ) ;
317+ return new Reference ( name , epoch , reference ) ;
310318}
311319
312- public async queryInterval ( interval :TimeInterval , reference :BoundReference ) :Promise < Sample [ ] > {
320+ public async queryInterval ( interval :TimeInterval , reference :Reference ) :Promise < Sample [ ] > {
313321this . verifyReferenceEpoch ( reference . name , reference . epoch ) ;
314322const cxxrtlResponse = await this . connection ! . queryInterval ( {
315323type :'command' ,