zed icon indicating copy to clipboard operation
zed copied to clipboard

`file_scan_exclusions` glob syntax to select root folder (or file) but not subfolders (or files deeper in the tree) with the same name

Open danielweck opened this issue 1 year ago • 1 comments

Check for existing issues

  • [X] Completed

Describe the bug / provide steps to reproduce it

The following config results in excluding all folders named "foldername" in the codebase tree, effectively equivalent to "**/foldername" (I only want to exclude the matching folder at the root of the tree):

"file_scan_exclusions": [
    "foldername"
]

I tried "./foldername" and "foldername" and "~/foldername", but these do not match anything at all.

Through trial and error using variants of the Glob syntax documented elsewhere, I found this workaround: "[f]oldername" ... which feels a bit "dirty" to me :)

If I understand correctly, this behaviour matches the heuristics implemented in PathMatcher, more specifically the cascade into self.glob:

https://github.com/zed-industries/zed/blob/a0582d02b9f393ba94551d61ce6e5ffacf77760a/crates/util/src/paths.rs#L217C6-L242

Is there a "cleaner" way to reference root folders / files?

Environment

Zed: v0.119.21 (Zed) OS: macOS 14.3.0 Memory: 8 GiB Architecture: aarch64

If applicable, add mockups / screenshots to help explain present your vision of the feature

No response

If applicable, attach your ~/Library/Logs/Zed/Zed.log file to this issue.

If you only need the most recent lines, you can run the zed: open log command palette action to see the last 1000.

No response

danielweck avatar Jan 30 '24 11:01 danielweck

Related issue: https://github.com/zed-industries/zed/issues/7195 (folder-specific / project-specific config)

danielweck avatar Feb 01 '24 09:02 danielweck

maybe you could try like this "foldername/**"

tianyax avatar Mar 04 '24 04:03 tianyax