@@ -6,7 +6,7 @@ import { TimeInterval, TimePoint } from './model/time';
6
6
import { Scope } from './model/scope' ;
7
7
import { Variable } from './model/variable' ;
8
8
import { StatusBarItem } from './ui/status' ;
9
- import { BoundReference , Reference , Sample } from './model/sample' ;
9
+ import { Reference , UnboundReference , Sample } from './model/sample' ;
10
10
11
11
export enum CXXRTLSimulationStatus {
12
12
Paused = 'paused' ,
@@ -28,12 +28,16 @@ export class CXXRTLDebugger {
28
28
// Session properties.
29
29
30
30
private _sessionStatus : CXXRTLSessionStatus = CXXRTLSessionStatus . Absent ;
31
- public get sessionStatus ( ) { return this . _sessionStatus ; }
31
+ public get sessionStatus ( ) {
32
+ return this . _sessionStatus ;
33
+ }
32
34
private _onDidChangeSessionStatus : vscode . EventEmitter < CXXRTLSessionStatus > = new vscode . EventEmitter < CXXRTLSessionStatus > ( ) ;
33
35
readonly onDidChangeSessionStatus : vscode . Event < CXXRTLSessionStatus > = this . _onDidChangeSessionStatus . event ;
34
36
35
37
private _currentTime : TimePoint = new TimePoint ( 0n , 0n ) ;
36
- public get currentTime ( ) { return this . _currentTime ; }
38
+ public get currentTime ( ) {
39
+ return this . _currentTime ;
40
+ }
37
41
private _onDidChangeCurrentTime : vscode . EventEmitter < TimePoint > = new vscode . EventEmitter < TimePoint > ( ) ;
38
42
readonly onDidChangeCurrentTime : vscode . Event < TimePoint > = this . _onDidChangeCurrentTime . event ;
39
43
@@ -42,12 +46,16 @@ export class CXXRTLDebugger {
42
46
private simulationStatusUpdateTimeout : NodeJS . Timeout | null = null ;
43
47
44
48
private _simulationStatus : CXXRTLSimulationStatus = CXXRTLSimulationStatus . Finished ;
45
- public get simulationStatus ( ) { return this . _simulationStatus ; }
49
+ public get simulationStatus ( ) {
50
+ return this . _simulationStatus ;
51
+ }
46
52
private _onDidChangeSimulationStatus : vscode . EventEmitter < CXXRTLSimulationStatus > = new vscode . EventEmitter < CXXRTLSimulationStatus > ( ) ;
47
53
readonly onDidChangeSimulationStatus : vscode . Event < CXXRTLSimulationStatus > = this . _onDidChangeSimulationStatus . event ;
48
54
49
55
private _latestTime : TimePoint = new TimePoint ( 0n , 0n ) ;
50
- public get latestTime ( ) { return this . _latestTime ; }
56
+ public get latestTime ( ) {
57
+ return this . _latestTime ;
58
+ }
51
59
private _onDidChangeLatestTime : vscode . EventEmitter < TimePoint > = new vscode . EventEmitter < TimePoint > ( ) ;
52
60
readonly onDidChangeLatestTime : vscode . Event < TimePoint > = this . _onDidChangeLatestTime . event ;
53
61
@@ -63,7 +71,7 @@ export class CXXRTLDebugger {
63
71
64
72
public async startSession ( ) : Promise < void > {
65
73
if ( 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.' ) ;
67
75
return ;
68
76
}
69
77
@@ -81,39 +89,39 @@ export class CXXRTLDebugger {
81
89
this . setSessionStatus ( CXXRTLSessionStatus . Starting ) ;
82
90
83
91
const processId = await this . terminal . processId ;
84
- console . log ( " [RTL Debugger] Launched process %d" , processId ) ;
92
+ console . log ( ' [RTL Debugger] Launched process %d' , processId ) ;
85
93
86
94
setTimeout ( ( ) => {
87
95
const 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.' ) ;
89
97
90
98
( async ( ) => {
91
99
this . connection = new Connection ( new NodeStreamLink ( socket ) ) ;
92
100
this . setSessionStatus ( CXXRTLSessionStatus . Running ) ;
93
101
this . updateSimulationStatus ( ) ;
94
- console . log ( " [RTL Debugger] Initialized" ) ;
102
+ console . log ( ' [RTL Debugger] Initialized' ) ;
95
103
} ) ( ) . catch ( ( ) => {
96
104
this . stopSession ( ) ;
97
105
} ) ;
98
106
} ) ;
99
107
socket . on ( 'error' , ( err : any ) => {
100
108
if ( 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.' ) ;
102
110
} else {
103
111
vscode . window . showErrorMessage ( `The connection to the CXXRTL server has failed: ${ err . code } .` ) ;
104
112
}
105
113
this . stopSession ( ) ;
106
114
} ) ;
107
115
socket . on ( 'close' , ( hadError ) => {
108
116
if ( ! hadError ) {
109
- vscode . window . showInformationMessage ( " Disconnected from the CXXRTL server." ) ;
117
+ vscode . window . showInformationMessage ( ' Disconnected from the CXXRTL server.' ) ;
110
118
}
111
119
this . stopSession ( ) ;
112
120
} ) ;
113
121
} , 500 ) ; // FIXME
114
122
} 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 ) ;
117
125
if ( selection === OpenSettings ) {
118
126
vscode . commands . executeCommand ( 'workbench.action.openSettings' , 'rtlDebugger.command' ) ;
119
127
}
@@ -254,7 +262,7 @@ export class CXXRTLDebugger {
254
262
for ( const [ cxxrtlName , cxxrtlDesc ] of Object . entries ( cxxrtlResponse . scopes ) ) {
255
263
const nestedScopes : Scope [ ] = [ ] ;
256
264
const nestedVariables : Thenable < Variable [ ] > = {
257
- // NormallyPromises are evaluated eagerly; this Thenable does it lazily.
265
+ // Normally Promises are evaluated eagerly; this Thenable does it lazily.
258
266
then : ( onfulfilled , onrejected ) => {
259
267
return this . getVariablesForScope ( cxxrtlName ) . then ( onfulfilled , onrejected ) ;
260
268
}
@@ -292,7 +300,7 @@ export class CXXRTLDebugger {
292
300
}
293
301
}
294
302
295
- public bindReference ( name : string , reference : Reference ) : BoundReference {
303
+ public bindReference ( name : string , reference : UnboundReference ) : Reference {
296
304
const epoch = this . advanceReferenceEpoch ( name ) ;
297
305
// Note that we do not wait for the command to complete. Although it is possible for
298
306
// the command to fail, this would only happen if one of the designations is invalid,
@@ -303,13 +311,13 @@ export class CXXRTLDebugger {
303
311
reference : name ,
304
312
items : reference . cxxrtlItemDesignations ( )
305
313
} ) . catch ( ( error ) => {
306
- console . error ( ` [CXXRTL] invalid designation while binding reference` ,
314
+ console . error ( ' [CXXRTL] invalid designation while binding reference' ,
307
315
`${ name } #${ epoch } ` , error ) ;
308
316
} ) ;
309
- return new BoundReference ( name , epoch , reference ) ;
317
+ return new Reference ( name , epoch , reference ) ;
310
318
}
311
319
312
- public async queryInterval ( interval : TimeInterval , reference : BoundReference ) : Promise < Sample [ ] > {
320
+ public async queryInterval ( interval : TimeInterval , reference : Reference ) : Promise < Sample [ ] > {
313
321
this . verifyReferenceEpoch ( reference . name , reference . epoch ) ;
314
322
const cxxrtlResponse = await this . connection ! . queryInterval ( {
315
323
type : 'command' ,
0 commit comments