ZIm/crates/collab/src
Thorsten Ball ddca6a3fb7
Debounce refresh of inlay hints on buffer edits (#8282)
I think this makes it less chaotic to edit text when the inlay hints are
on.

It's for cases where you're editing to the right side of an inlay hint.
Example:

```rust
for name in names.iter().map(|item| item.len()) {
    println!("{:?}", name);
}
```

We display a `usize` inlay hint right next to `name`.

But as soon as you remove that `.` in `names.iter` your cursor jumps
around because the inlay hint has been removed.

With this change we now have a 700ms debounce before we update the inlay
hints.

VS Code seems to have an even longer debounce, I think somewhere around
~1s.

Release Notes:

- Added debouncing to make it easier to edit text when inlay hints are
enabled and to save rendering of inlay hints when scrolling. Both
debounce durations can be configured with `{"inlay_hints":
{"edit_debounce_ms": 700}}` (default) and `{"inlay_hints":
{"scroll_debounce_ms": 50}}`. Set a value to `0` to turn off the
debouncing.


### Before


https://github.com/zed-industries/zed/assets/1185253/3afbe548-dcfb-45a3-ab9f-cce14c04a148



### After



https://github.com/zed-industries/zed/assets/1185253/7ea90e42-bca6-4f6c-995e-83324669ab43

---------

Co-authored-by: Kirill <kirill@zed.dev>
2024-02-27 11:18:13 +01:00
..
api Fix uploads to edit_events table (#8318) 2024-02-23 20:58:45 -05:00
bin Fix seed-db script by passing it the correct admin file path (#8022) 2024-02-19 18:53:17 +02:00
db channel projects (#8456) 2024-02-26 22:15:11 -07:00
rpc talkers (#8158) 2024-02-22 10:07:36 -07:00
tests Debounce refresh of inlay hints on buffer edits (#8282) 2024-02-27 11:18:13 +01:00
api.rs Expose extensions API from api.zed.dev (#8307) 2024-02-23 16:08:14 -05:00
auth.rs Update verify_access_token doc comment 2024-01-17 18:06:16 -08:00
db.rs channel projects (#8456) 2024-02-26 22:15:11 -07:00
env.rs Add an extensions API to the collaboration server (#7807) 2024-02-15 12:53:57 -08:00
errors.rs Remove more unused code related to GitHub auth and errors 2022-04-21 08:57:49 -06:00
executor.rs Remove 2 suffix for collab, rope, settings, menu 2024-01-03 12:29:16 -08:00
lib.rs Fix error logging (#8295) 2024-02-23 13:36:20 -05:00
main.rs CI: Enable clippy on Windows (#8240) 2024-02-23 16:23:42 -08:00
rpc.rs channel projects (#8456) 2024-02-26 22:15:11 -07:00
tests.rs channel projects (#8456) 2024-02-26 22:15:11 -07:00