zed-industries / zed

Code at the speed of thought – Zed is a high-performance, multiplayer code editor from the creators of Atom and Tree-sitter.
https://zed.dev
Other
50.45k stars 3.12k forks source link

zed disregards `file_scan_exclusions` at startup and deep-scans directories that were excluded #21040

Open eric-seppanen opened 6 hours ago

eric-seppanen commented 6 hours ago

Check for existing issues

Describe the bug / provide steps to reproduce it

I have been developing a fuse filesystem, and during development testing, I often mount to a path mnt right in my development tree. I added mnt to my file_scan_exclusions setting (and verified it disappears from the left pane as a result).

However, when I (re)start Zed (manually or because of an update), I can see in my fuse filesystem logs that Zed is deep-scanning the entire tree inside my fuse filesystem. Because this is a virtual filesystem that is arbitrarily large, this manifests as a blank editor window with an empty left pane and little functionality (e.g. I can't browse my project's files).

If I close the malfunctioning Zed window, the filesystem scanning continues: there is a zed-editor process in the background that keeps running until I unmount the fuse filesystem.

I can see (from my fuse filesystem logs) that it is traversing every directory and repeatedly trying to access .git and .gitignore in every possible path.

If I start the fuse filesystem after Zed is running, everything works normally.

I'm not sure how to share steps to reproduce this because running a fuse filesystem in the development tree is a bit exotic. My guess is that even without fuse, something like strace would be able to confirm that Zed is ignoring file_scan_exclusions and scanning excluded paths during some phase of startup? I'm open to ideas for gathering data that would help.

Environment

Zed: v0.162.5 (Zed) OS: Linux Wayland ubuntu 24.04 Memory: 31.1 GiB Architecture: x86_64 GPU: Intel(R) Graphics (RPL-P) || Intel open-source Mesa driver || Mesa 24.0.9-0ubuntu0.2

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

Screenshot from 2024-11-21 18-45-20

If applicable, attach your Zed.log file to this issue.

Unfortunately, when this scan/hang occurs nothing is printed to Zed.log.