Skip to content

Commit 7319853

Browse files
committed
refactor: convert getExampleFileList to use object parameters
1 parent 06ec8c8 commit 7319853

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

backend/src/find-files/request-files-prompt.ts

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -457,7 +457,11 @@ function topLevelDirectories(fileContext: ProjectFileContext) {
457457
.map((node) => node.name)
458458
}
459459

460-
function getExampleFileList(fileContext: ProjectFileContext, count: number) {
460+
function getExampleFileList(params: {
461+
fileContext: ProjectFileContext
462+
count: number
463+
}) {
464+
const { fileContext, count } = params
461465
const { fileTree } = fileContext
462466

463467
const filePaths = getAllFilePaths(fileTree)
@@ -485,7 +489,7 @@ function generateNonObviousRequestFilesPrompt(
485489
fileContext: ProjectFileContext,
486490
count: number,
487491
): string {
488-
const exampleFiles = getExampleFileList(fileContext, NUMBER_OF_EXAMPLE_FILES)
492+
const exampleFiles = getExampleFileList({ fileContext, count: NUMBER_OF_EXAMPLE_FILES })
489493
return `
490494
Your task is to find the second-order relevant files for the following user request (in quotes).
491495
@@ -540,7 +544,7 @@ function generateKeyRequestFilesPrompt(
540544
fileContext: ProjectFileContext,
541545
count: number,
542546
): string {
543-
const exampleFiles = getExampleFileList(fileContext, NUMBER_OF_EXAMPLE_FILES)
547+
const exampleFiles = getExampleFileList({ fileContext, count: NUMBER_OF_EXAMPLE_FILES })
544548

545549
return `
546550
Your task is to find the most relevant files for the following user request (in quotes).

0 commit comments

Comments
 (0)