# Emit less update events for odd FS events \(\#39557\) · gitcafe/zed

[View on GitCafe](https://git.cafe/gitcafe/zed/commit/469ecfbe13e7341b65ee0fb10cadc048a5d5193b)

Repository: [gitcafe/zed](https://git.cafe/gitcafe/zed)

Visibility: public

Requested revision: 469ecfbe13e7341b65ee0fb10cadc048a5d5193b

Requested commit: 469ecfbe13e7341b65ee0fb10cadc048a5d5193b

Commit: 469ecfbe13e7341b65ee0fb10cadc048a5d5193b

Tree: a4160c77d69726f562bca67905d7755037a61506

Author: Kirill Bulatov

Committer: GitHub

## Message

```
Emit less update events for odd FS events (#39557)

When running flycheck, I've noticed that scrolling starts to lag:


https://github.com/user-attachments/assets/b0bef0a3-ccbd-479d-a385-273398086d38

When checking the trace, it is notable that project panel updates its
entire tree multiple times during flycheck:

<img width="2032" height="1136" alt="image"
src="https://github.com/user-attachments/assets/d1935e77-3b00-4be5-a12a-8a17a9d64202"
/>


[scrolling.trace.zip](https://github.com/user-attachments/files/22710852/scrolling.trace.zip)

Turns out, `target/debug` directory is loaded by Zed (presumably,
reported by langserver as there are sources generated by bindgen and
proto that need to be loaded), and `target/debug/build` directory
received multiple events of a `None` kind for Zed, which trigger the
rescans.

Rework the logic to omit the `None`-kind events in Zed, and to avoid
excessive repo updates if not needed.


Release Notes:

- Improved worktree FS event emits in gitignored directories

---------

Co-authored-by: Cole Miller <cole@zed.dev>
```

## Parents

- [46b6adadf908fd673d2f37d83c9247b44bc81465](https://git.cafe/gitcafe/zed/commit/46b6adadf908fd673d2f37d83c9247b44bc81465?format=markdown)

[Source at this commit](https://git.cafe/gitcafe/zed/tree/469ecfbe13e7341b65ee0fb10cadc048a5d5193b?format=markdown)
