@@ -60,6 +60,11 @@ export async function fetchSupplementalContextForSrc(
60
60
return shouldProceed === undefined ? undefined : [ ]
61
61
}
62
62
63
+ const codeChunksCalculated =
64
+ CodeWhispererUserGroupSettings . instance . userGroup === UserGroup . Control
65
+ ? crossFileContextConfig . numberOfChunkToFetch
66
+ : crossFileContextConfig . numberOfChunkToFetchExperiment
67
+
63
68
// Step 1: Get relevant cross files to refer
64
69
const relevantCrossFilePaths = await getCrossFileCandidates ( editor )
65
70
throwIfCancelled ( cancellationToken )
@@ -70,16 +75,16 @@ export async function fetchSupplementalContextForSrc(
70
75
let chunkList : Chunk [ ] = [ ]
71
76
for ( const relevantFile of relevantCrossFilePaths ) {
72
77
throwIfCancelled ( cancellationToken )
73
- const chunks : Chunk [ ] = splitFileToChunks ( relevantFile , crossFileContextConfig . numberOfLinesEachChunk )
78
+ const chunks : Chunk [ ] = splitFileToChunks ( relevantFile , codeChunksCalculated )
74
79
const linkedChunks = linkChunks ( chunks )
75
80
chunkList . push ( ...linkedChunks )
76
- if ( chunkList . length >= crossFileContextConfig . numberOfChunkToFetch ) {
81
+ if ( chunkList . length >= codeChunksCalculated ) {
77
82
break
78
83
}
79
84
}
80
85
81
86
// it's required since chunkList.push(...) is likely giving us a list of size > 60
82
- chunkList = chunkList . slice ( 0 , crossFileContextConfig . numberOfChunkToFetch )
87
+ chunkList = chunkList . slice ( 0 , codeChunksCalculated )
83
88
84
89
// Step 3: Generate Input chunk (10 lines left of cursor position)
85
90
// and Find Best K chunks w.r.t input chunk using BM25
0 commit comments