Query certain editor ranges for inlays with a delay (#2891)
Part of https://linear.app/zed-industries/issue/Z-2750/investigate-performance-of-collaborating-on-large-files-with-inlay Fixes https://linear.app/zed-industries/issue/Z-2824/inlay-hints-affect-code-layout-in-multibuffer We query hints for visible part of the screen, and two parts above and below the visible range, of the same range (if applicable, we can be on the edge of the document). When rapidly typing, we do not care about the invisible range updates, yet still query a lot of them + rust-analyzer sends /refresh hint requests shortly after every modification too, forcing us to re-query. Instead querying both visible and invisible ranges altogether, wait for visible range query first and wait add a `400ms` delay afterwards before querying the invisible ranges. This allows any /refresh requests or rapid typing to avoid 2 extra requests, cancelling them before they start. Visible part of the screen is still queried after every change, without any debouncing. Release Notes: - Delay certain inlay hint requests to reduce general LSP server load
This commit is contained in:
commit
205e101dd0
1 changed files with 360 additions and 215 deletions
File diff suppressed because it is too large
Load diff
Loading…
Add table
Add a link
Reference in a new issue