@@ -354,7 +354,7 @@ export class CallStackDataSource implements IDataSource {
354
354
355
355
public getChildren ( tree : ITree , element : any ) : TPromise < any > {
356
356
if ( element instanceof Thread ) {
357
- return TPromise . as ( this . getThreadChildren ( element ) ) ;
357
+ return this . getThreadChildren ( element ) ;
358
358
}
359
359
if ( element instanceof Model ) {
360
360
return TPromise . as ( element . getProcesses ( ) ) ;
@@ -364,25 +364,25 @@ export class CallStackDataSource implements IDataSource {
364
364
return TPromise . as ( process . getAllThreads ( ) ) ;
365
365
}
366
366
367
- private getThreadChildren ( thread : Thread ) : any [ ] {
367
+ private getThreadChildren ( thread : Thread ) : TPromise < any > {
368
368
const callStack : any [ ] = thread . getCallStack ( ) ;
369
- if ( ! callStack ) {
370
- return [ ] ;
369
+ if ( ! callStack || ! callStack . length ) {
370
+ return thread . fetchCallStack ( false ) . then ( ( ) => thread . getCallStack ( ) ) ;
371
371
}
372
372
if ( callStack . length === 1 ) {
373
373
// To reduce flashing of the call stack view simply append the stale call stack
374
374
// once we have the correct data the tree will refresh and we will no longer display it.
375
- return callStack . concat ( thread . getStaleCallStack ( ) . slice ( 1 ) ) ;
375
+ return TPromise . as ( callStack . concat ( thread . getStaleCallStack ( ) . slice ( 1 ) ) ) ;
376
376
}
377
377
378
378
if ( thread . stoppedDetails && thread . stoppedDetails . framesErrorMessage ) {
379
- return callStack . concat ( [ thread . stoppedDetails . framesErrorMessage ] ) ;
379
+ return TPromise . as ( callStack . concat ( [ thread . stoppedDetails . framesErrorMessage ] ) ) ;
380
380
}
381
381
if ( thread . stoppedDetails && thread . stoppedDetails . totalFrames > callStack . length && callStack . length > 1 ) {
382
- return callStack . concat ( [ new ThreadAndProcessIds ( thread . process . getId ( ) , thread . threadId ) ] ) ;
382
+ return TPromise . as ( callStack . concat ( [ new ThreadAndProcessIds ( thread . process . getId ( ) , thread . threadId ) ] ) ) ;
383
383
}
384
384
385
- return callStack ;
385
+ return TPromise . as ( callStack ) ;
386
386
}
387
387
388
388
public getParent ( tree : ITree , element : any ) : TPromise < any > {
0 commit comments