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
48.53k stars 2.9k forks source link

"Find in Folder" results duplicated when "Toggle include Ignored" selected, and searching is slow #14664

Open SeanGriffin-Wellsky opened 3 months ago

SeanGriffin-Wellsky commented 3 months ago

Check for existing issues

Describe the bug / provide steps to reproduce it

If I check the "Toggle include Ignored" and do a search, my CPU spikes to > 900% for > 30 sec and finally comes back with "28" results, but only 5 are unique. The rest are duplicated in strange ways. Here are some screenshots that show the issue in a relatively concise way:

Notice result duplicated 4 times, cursor on first result, line 2038, result is "21/28": image

Now cursor is on first result, line 2040, result is "23/28" ("22/28" was skipped entirely): image

With cursor on second result, line 2040, result is now "25/28": image

Environment

Zed: v0.143.7 (Zed) OS: macOS 14.5.0 Memory: 32 GiB Architecture: x86_64

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

No response

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

No response

SeanGriffin-Wellsky commented 2 months ago

I've looked into this issue more deeply trying to see if this ever worked and found some interesting things. First, I went back to version 0.140.5 and it still happens. BUT, the duplicate results only happens after the first time you do such a search. If I close Zed, open it fresh, and then do a project search within ignored files, I get the results back just once. However, if I execute the search again (not changing anything), I now get the results duplicated. The number of duplicates varies; I've seen it between 2 and 5 results for the same distinct result. This behavior is the same in all versions I tested.

Performance is still horrible in all cases.

SeanGriffin-Wellsky commented 2 months ago

I tried the latest 0.147.2 version to see if it's been fixed yet through some other recent changes to the folder search. It hasn't.