refactor: include hidden dotfiles folders in file picker search (#6315)

Signed-off-by: Abhijay007 <Abhijay007j@gmail.com>
This commit is contained in:
Abhijay Jain
2026-01-13 01:26:30 +05:30
committed by GitHub
parent 5bc0b8c51b
commit 9376796cf0
2 changed files with 20 additions and 5 deletions
+18 -4
View File
@@ -160,8 +160,6 @@ const MentionPopover = forwardRef<
'.hg',
'node_modules',
'__pycache__',
'.vscode',
'.idea',
'target',
'dist',
'build',
@@ -174,6 +172,17 @@ const MentionPopover = forwardRef<
'.Trash',
];
const allowedHiddenDirs = [
'.github',
'.vscode',
'.idea',
'.config',
'.gitlab',
'.circleci',
'.azure',
'.jenkins',
];
// Don't skip as many directories at deeper levels to find more items
const skipDirsAtDepth =
depth > 2 ? ['.git', '.svn', '.hg', 'node_modules', '__pycache__'] : skipDirs;
@@ -194,8 +203,13 @@ const MentionPopover = forwardRef<
const fullPath = `${dirPath}/${item}`;
const itemRelativePath = relativePath ? `${relativePath}/${item}` : item;
// Skip hidden items and common ignore patterns
if (item.startsWith('.') || skipDirsAtDepth.includes(item)) {
// Skip items in the skip list
if (skipDirsAtDepth.includes(item)) {
continue;
}
// Skip hidden items except for allowed hidden directories
if (item.startsWith('.') && !allowedHiddenDirs.includes(item)) {
continue;
}