MCPcopy Create free account
hub / github.com/continuedev/continue / process

Method process

core/nextEdit/NextEditPrefetchQueue.ts:63–109  ·  view source on GitHub ↗
(ctx: any)

Source from the content-addressed store, hash-verified

61
62 // Process items from unprocessed queue
63 async process(ctx: any): Promise<void> {
64 while (
65 this.unprocessedQueue.length > 0 &&
66 this.processedQueue.length < this.prefetchLimit &&
67 !this.abortController.signal.aborted
68 ) {
69 const location = this.dequeueUnprocessed();
70 console.log("processing:");
71 console.log(
72 location?.range.start.line + " to " + location?.range.end.line,
73 );
74
75 if (!location) break;
76
77 try {
78 const outcome =
79 await NextEditProvider.getInstance().provideInlineCompletionItemsWithChain(
80 ctx,
81 location,
82 this.abortController.signal,
83 this.usingFullFileDiff,
84 );
85
86 if (!outcome) {
87 console.log("outcome is undefined");
88 continue;
89 }
90
91 this.enqueueProcessed({
92 location,
93 outcome,
94 });
95
96 console.log(
97 "the length of processed queue after processing is:",
98 this.processedQueue.length,
99 );
100 } catch (error) {
101 if (!this.abortController.signal.aborted) {
102 // Handle error
103 console.error("Error processing item:", error);
104 }
105 // If aborted, we just stop processing
106 break;
107 }
108 }
109 }
110
111 // Abort all operations
112 abort(): void {

Callers 2

Calls 6

dequeueUnprocessedMethod · 0.95
enqueueProcessedMethod · 0.95
errorMethod · 0.80
logMethod · 0.65
getInstanceMethod · 0.45

Tested by

no test coverage detected