Skip to content

Commit f8beecd

Browse files
committed
Ignore lock files when building changes markdown
- changes/commit symbol should not show pnpm-lock.yaml etc. files, just like they're excluded from context └── apps └── editor └── src ├── constants │ └── ignored-lock-files.ts ├── context │ └── providers │ └── workspace │ └── workspace-provider.ts ├── features │ └── search-files │ └── utils │ ├── search-files-by-keywords.ts │ └── search-files-by-phrase.ts └── views ├── prompt │ └── backend │ ├── message-handlers │ │ └── handle-preview-changes-symbol.ts │ └── utils │ └── symbols │ └── git │ └── replace-git-symbols.ts └── shared └── utils └── hash-sign-quick-pick ├── hash-sign-quick-pick.ts └── symbols ├── changes-symbol.ts └── commit-symbol.ts
1 parent 95b0ea7 commit f8beecd

1 file changed

Lines changed: 11 additions & 0 deletions

File tree

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

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import { AsciiTree } from '@/utils/ascii-tree/ascii-tree'
66
import { Logger } from '@shared/utils/logger'
77
import { t } from '@/i18n'
88
import { SymbolCacheManager } from '../symbol-cache'
9+
import { IGNORED_LOCK_FILES } from '@/constants/ignored-lock-files'
910

1011
const patch_diff_paths = (
1112
diff_text: string,
@@ -94,6 +95,11 @@ export const build_changes_markdown = (params: {
9495
}
9596

9697
if (file_path) {
98+
const file_name = file_path.split('/').pop()
99+
if (file_name && IGNORED_LOCK_FILES.includes(file_name)) {
100+
continue
101+
}
102+
97103
const display_path = params.path_prefix
98104
? `${params.path_prefix}/${file_path}`
99105
: file_path
@@ -538,6 +544,11 @@ export const build_commit_changes_markdown = (params: {
538544
}
539545

540546
if (file_path) {
547+
const file_name = file_path.split('/').pop()
548+
if (file_name && IGNORED_LOCK_FILES.includes(file_name)) {
549+
continue
550+
}
551+
541552
const display_path = params.path_prefix
542553
? `${params.path_prefix}/${file_path}`
543554
: file_path

0 commit comments

Comments
 (0)