file_finder: Respect .gitignore and file_scan_inclusions with ** in glob (#40654)

Closes #39037 

Previously, the code split the `**/.env` glob in `file_scan_inclusions`
into two sources for the `PathMatcher`: `["**", "**/.env"]`. This
approach works for directories, but including `**` will match all
directories and their files. To address this, I now select the
appropriate `PathMatcher` using only `**/.env` when specifically
targeting a file to determine whether to include it in the file finder.

Release Notes:

- Fixed: respect `.gitignore` and `file_scan_inclusions` settings with
`**` in glob for file finder

---------

Signed-off-by: Benjamin <5719034+bnjjj@users.noreply.github.com>
Co-authored-by: Julia Ryan <juliaryan3.14@gmail.com>
This commit is contained in:
Coenen Benjamin
2025-11-04 12:11:17 +00:00
committed by GitHub
co-authored by Julia Ryan
parent cc6208b17f
commit a827f25d00
5 changed files with 183 additions and 11 deletions
+1
View File
@@ -760,6 +760,7 @@ async fn test_file_scan_inclusions(cx: &mut TestAppContext) {
"prettier": {
"package.json": "{}",
},
"package.json": "//package.json"
},
"src": {
".DS_Store": "",