@@ -533,51 +533,64 @@ export default class GithubPackage {
533533 } ) ,
534534 ) ,
535535 ) ;
536+ console . log ( 'got all the workdirs' ) ;
536537
537538 const fromPaneItem = async maybeItem => {
538539 const itemPath = pathForPaneItem ( maybeItem ) ;
539540
540541 if ( ! itemPath ) {
542+ console . log ( 'no item path, returning early' ) ;
541543 return { } ;
542544 }
543545
546+ console . log ( 'getting itemWorkdir from the workdirCache' ) ;
544547 const itemWorkdir = await this . workdirCache . find ( itemPath ) ;
545548
549+ console . log ( 'maybe adding to workdirs set' ) ;
546550 if ( itemWorkdir && ! this . project . contains ( itemPath ) ) {
547551 workdirs . add ( itemWorkdir ) ;
548552 }
549553
554+ console . log ( 'got an item in fromPaneItem! returning' , itemPath , itemWorkdir ) ;
550555 return { itemPath, itemWorkdir} ;
551556 } ;
552557
558+ console . log ( 'getting active item' ) ;
553559 const active = await fromPaneItem ( this . workspace . getCenter ( ) . getActivePaneItem ( ) ) ;
554560
561+ console . log ( 'setting contextPool' ) ;
555562 this . contextPool . set ( workdirs , savedState ) ;
556563
557564 if ( active . itemPath ) {
558565 // Prefer an active item
566+ console . log ( 'returning context from contextPool (active.itemPath is truthy)' ) ;
559567 return this . contextPool . getContext ( active . itemWorkdir || active . itemPath ) ;
560568 }
561569
562570 if ( this . project . getPaths ( ) . length === 1 ) {
571+ console . log ( 'inside getPaths().length === 1' ) ;
563572 // Single project
564573 const projectPath = this . project . getPaths ( ) [ 0 ] ;
565574 const activeWorkingDir = await this . workdirCache . find ( projectPath ) ;
575+ console . log ( 'returning context from contextPool (getPaths().length === 1)' ) ;
566576 return this . contextPool . getContext ( activeWorkingDir || projectPath ) ;
567577 }
568578
569579 if ( this . project . getPaths ( ) . length === 0 && ! this . activeContext . getRepository ( ) . isUndetermined ( ) ) {
570580 // No projects. Revert to the absent context unless we've guessed that more projects are on the way.
581+ console . log ( 'no paths and repo is undetermined; return absent' ) ;
571582 return WorkdirContext . absent ( { pipelineManager : this . pipelineManager } ) ;
572583 }
573584
574585 // Restore models from saved state. Will return a NullWorkdirContext if this path is not presently
575586 // resident in the pool.
576587 const savedWorkingDir = savedState . activeRepositoryPath ;
577588 if ( savedWorkingDir ) {
589+ console . log ( 'returning savedWorkingDir' ) ;
578590 return this . contextPool . getContext ( savedWorkingDir ) ;
579591 }
580592
593+ console . log ( 'returning this.activeContext' , this . activeContext ) ;
581594 return this . activeContext ;
582595 }
583596
0 commit comments