Skip to content

Commit 39004bd

Browse files
committed
Standardize file headers to use Markdown headings instead of list items
- should use "### File:", not "- File:"
1 parent 1c45ba3 commit 39004bd

7 files changed

Lines changed: 15 additions & 15 deletions

File tree

‎apps/editor/src/context/providers/workspace/modules/token-calculator.ts‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -437,9 +437,9 @@ export class TokenCalculator implements vscode.Disposable {
437437
}
438438

439439
if (is_binary) {
440-
return `- File: \`${display_path}\`\n\nBinary file\n\n`
440+
return `### File: \`${display_path}\`\n\nBinary file\n\n`
441441
} else {
442-
return `- File: \`${display_path}\`\n\n\`\`\`\n${text}\n\`\`\`\n\n`
442+
return `### File: \`${display_path}\`\n\n\`\`\`\n${text}\n\`\`\`\n\n`
443443
}
444444
}
445445

‎apps/editor/src/features/search-files/search-modes/perform-intelligent-search-mode.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -234,7 +234,7 @@ export const perform_intelligent_search_mode = async (params: {
234234
const content_to_use = shrink_result
235235
? file.shrunk_content
236236
: file.content
237-
md_files += `- File: \`${file.display_path}\`\n\n\`\`\`\n${content_to_use}\n\`\`\`\n\n`
237+
md_files += `### File: \`${file.display_path}\`\n\n\`\`\`\n${content_to_use}\n\`\`\`\n\n`
238238
}
239239

240240
const config = vscode.workspace.getConfiguration('codeWebChat')

‎apps/editor/src/utils/files-collector.ts‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -93,10 +93,10 @@ export namespace FilesCollector {
9393
}
9494

9595
if (is_binary) {
96-
collected_text += `- File: \`${display_path}\`\n\nBinary file\n\n`
96+
collected_text += `### File: \`${display_path}\`\n\nBinary file\n\n`
9797
} else {
9898
const backticks = content.includes('```') ? '````' : '```'
99-
collected_text += `- File: \`${display_path}\`\n\n${backticks}\n${content}\n${backticks}\n\n`
99+
collected_text += `### File: \`${display_path}\`\n\n${backticks}\n${content}\n${backticks}\n\n`
100100
}
101101
} catch (error) {
102102
console.error(`Error reading file ${file_path}:`, error)

‎apps/editor/src/utils/prompt-builder.ts‎

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,10 @@ export namespace PromptBuilder {
88
}): string => {
99
const display_path = normalize_path(params.filepath)
1010
if (params.is_binary || params.content === undefined) {
11-
return `- File: \`${display_path}\`\n\nBinary file\n\n`
11+
return `### File: \`${display_path}\`\n\nBinary file\n\n`
1212
}
1313
const backticks = params.content.includes('```') ? '````' : '```'
14-
return `- File: \`${display_path}\`\n\n${backticks}\n${params.content}\n${backticks}\n\n`
14+
return `### File: \`${display_path}\`\n\n${backticks}\n${params.content}\n${backticks}\n\n`
1515
}
1616

1717
export const build_diff_file_context = (params: {
@@ -25,14 +25,14 @@ export namespace PromptBuilder {
2525
const display_path = normalize_path(params.filepath)
2626

2727
if (params.status == 'created') {
28-
result += `- New file: \`${display_path}\`\n\n`
28+
result += `### New file: \`${display_path}\`\n\n`
2929
} else if (params.status == 'deleted') {
30-
result += `- Deleted file: \`${display_path}\`\n\n`
30+
result += `### Deleted file: \`${display_path}\`\n\n`
3131
} else if (params.status == 'renamed' && params.old_filepath) {
3232
const old_display_path = normalize_path(params.old_filepath)
33-
result += `- Renamed file: \`${old_display_path}\` (old) \`${display_path}\` (new)\n\n`
33+
result += `### Renamed file: \`${old_display_path}\` (old) \`${display_path}\` (new)\n\n`
3434
} else {
35-
result += `- Updated file: \`${display_path}\`\n\n`
35+
result += `### Updated file: \`${display_path}\`\n\n`
3636
}
3737

3838
if (params.diff_content?.trimEnd()) {

‎apps/editor/src/views/prompt/backend/utils/symbols/git/replace-git-symbols.ts‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ const build_changes_markdown = (
8787
? `${path_prefix}/${file_path}`
8888
: file_path
8989

90-
changes_content += `- File: \`${display_path}\`\n\n`
90+
changes_content += `### File: \`${display_path}\`\n\n`
9191

9292
let file_content = ''
9393
try {
@@ -371,7 +371,7 @@ const build_commit_changes_markdown = (
371371
? `${path_prefix}/${file_path}`
372372
: file_path
373373

374-
changes_content += `- File: \`${display_path}\`\n\n`
374+
changes_content += `### File: \`${display_path}\`\n\n`
375375

376376
let file_content = ''
377377
if (!is_deleted) {

‎apps/editor/src/views/prompt/backend/utils/symbols/saved-context/replace-saved-context-symbol.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ export const replace_saved_context_symbol = async (params: {
7272
const relative_path = root ? path.relative(root, p) : p
7373

7474
const backticks = content.includes('```') ? '````' : '```'
75-
files_markdown += `- File: \`${relative_path.replace(
75+
files_markdown += `### File: \`${relative_path.replace(
7676
/\\/g,
7777
'/'
7878
)}\`\n\n${backticks}\n${content}\n${backticks}\n\n`

‎apps/editor/src/views/prompt/backend/utils/symbols/skill/replace-skill-symbol.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ export const replace_skill_symbol = async (params: {
8282
path.relative(skill.path, file_path)
8383
)
8484
const backticks = content.includes('```') ? '````' : '```'
85-
skill_content += `- File: \`${relative_path.replace(
85+
skill_content += `### File: \`${relative_path.replace(
8686
/\\/g,
8787
'/'
8888
)}\`\n\n${backticks}\n${content}\n${backticks}\n\n`

0 commit comments

Comments
 (0)