Skip to content

Conversation

@deltamaya
Copy link
Contributor

@deltamaya deltamaya commented Oct 25, 2025

Previously, the hover popover delay was implemented using two overlapping timers, which caused the minimum delay to always be at least HOVER_REQUEST_DELAY_MILLIS, regardless of the hover_popover_delay setting.
This change updates the logic to wait for hover_popover_delay only, ensuring the total delay is always equals to hover_popover_delay . As a result, the hover popover now appears after the intended delay, matching the user's configuration more accurately.

Release Notes:

  • Improved hover popover respecting settings delay correctly

@cla-bot cla-bot bot added the cla-signed The user has signed the Contributor License Agreement label Oct 25, 2025
Comment on lines 307 to 309
if let Some(delay) = delay {
delay.await;
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The intent here is so to start the lsp request before the actual delay, such that when the request takes longer its not as noticeable (as we won't have to wait for the request as the delay expired).

I think we want to retain the previous system, but try to split the user configured delay into two parts. That is we could try removing HOVER_REQUEST_DELAY_MILLIS from the user delay. That way we also do not spam the server with requests.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you, I think I roughly understand how this works now.
But if we just subtract HOVER_REQUEST_DELAY_MILLIS, then if the user sets a delay smaller than that value, wouldn’t it cause every hover action to trigger an LSP request?
Or maybe we could make HOVER_REQUEST_DELAY_MILLIS smaller, so that the extra waiting time isn’t as noticeable — for example, set it to around 50 ms?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yea I think we do want a minimum here either way, reducing this to 50 is probably fine.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for your time! In the latest commit, I kept the early LSP request strategy while dynamically adjusting the early request timing to maintain consistency with the configured delay. I believe this change helps keep the application responsive without putting too much load on the LSP server.

@Veykril Veykril self-assigned this Oct 25, 2025
Copy link
Member

@Veykril Veykril left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@Veykril Veykril enabled auto-merge (squash) October 27, 2025 07:50
@Veykril Veykril disabled auto-merge October 27, 2025 07:50
@Veykril Veykril changed the title Make hover popover delay strictly respect hover_popover_delay setting editor: Make hover popover delay strictly respect hover_popover_delay setting Oct 27, 2025
@zed-industries-bot
Copy link

Warnings
⚠️

This PR is missing release notes.

Please add a "Release Notes" section that describes the change:

Release Notes:

- Added/Fixed/Improved ...

If your change is not user-facing, you can use "N/A" for the entry:

Release Notes:

- N/A

Generated by 🚫 dangerJS against 819bb64

@Veykril Veykril enabled auto-merge (squash) October 27, 2025 07:51
@Veykril Veykril disabled auto-merge October 27, 2025 07:53
@Veykril Veykril enabled auto-merge (squash) October 27, 2025 07:54
@Veykril Veykril merged commit edf2ec7 into zed-industries:main Oct 27, 2025
22 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cla-signed The user has signed the Contributor License Agreement

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants