@@ -59,6 +59,11 @@ export class PrefetchQueue {
5959 ! this . abortController . signal . aborted
6060 ) {
6161 const location = this . dequeueUnprocessed ( ) ;
62+ console . log ( "processing:" ) ;
63+ console . log (
64+ location ?. range . start . line + " to " + location ?. range . end . line ,
65+ ) ;
66+
6267 if ( ! location ) break ;
6368
6469 try {
@@ -70,12 +75,20 @@ export class PrefetchQueue {
7075 this . usingFullFileDiff ,
7176 ) ;
7277
73- if ( ! outcome ) continue ;
78+ if ( ! outcome ) {
79+ console . log ( "outcome is undefined" ) ;
80+ continue ;
81+ }
7482
7583 this . enqueueProcessed ( {
7684 location,
7785 outcome,
7886 } ) ;
87+
88+ console . log (
89+ "the length of processed queue after processing is:" ,
90+ this . processedQueue . length ,
91+ ) ;
7992 } catch ( error ) {
8093 if ( ! this . abortController . signal . aborted ) {
8194 // Handle error
@@ -115,6 +128,16 @@ export class PrefetchQueue {
115128 return this . processedQueue [ 0 ] ;
116129 }
117130
131+ peekThreeProcessed ( ) : void {
132+ const count = Math . min ( 3 , this . processedQueue . length ) ;
133+ const firstThree = this . processedQueue . slice ( 0 , count ) ;
134+ firstThree . forEach ( ( item , index ) => {
135+ console . log (
136+ `Item ${ index + 1 } : ${ item . location . range . start . line } to ${ item . location . range . end . line } ` ,
137+ ) ;
138+ } ) ;
139+ }
140+
118141 setPreetchLimit ( limit : number ) : void {
119142 this . prefetchLimit = limit ;
120143 }
0 commit comments