Make auto-signature help respect popover delay#46745
Make auto-signature help respect popover delay#46745SomeoneToIgnore merged 4 commits intozed-industries:mainfrom
Conversation
| return; | ||
| } | ||
|
|
||
| self.signature_help_state.task = None; |
There was a problem hiding this comment.
Drop the task incase the previous one is waiting on timer or LSP and we're starting a new one.
Also important when the current iteration will exit early — incase the cursor has exited the region inside the parenthesis of a function.
crates/editor/src/signature_help.rs
Outdated
| // respect hover_popover_delay | ||
| let signature_help_delay_ms = EditorSettings::get_global(cx).hover_popover_delay.0; | ||
|
|
||
| self.signature_help_state | ||
| .set_task(cx.spawn_in(window, async move |editor, cx| { | ||
| // wait for debounce delay | ||
| if signature_help_delay_ms > 0 { | ||
| cx.background_executor() | ||
| .timer(Duration::from_millis(signature_help_delay_ms)) | ||
| .await; | ||
| } |
There was a problem hiding this comment.
read the global setting, and before awaiting on the lsp task, await on the timer if non-zero.
e7b2d3b to
8d855bc
Compare
|
Hi @maxdeviant, can you help me take this forward? Seems like I'll need a maintainer to trigger workflows. Thanks! |
SomeoneToIgnore
left a comment
There was a problem hiding this comment.
Thank you.
Can we please remove all the useless comments that repeat the code below verbatim?
And, please, can we add a test for this? editor_tests.rs should contain the signature help-related tests as an example.
|
Thanks for guiding me on the next steps. I've removed the useless comments, and I've added coverage for the new code to an existing test for signature help. Could you please review this now. |
| cx.update_global::<SettingsStore, _>(|settings, cx| { | ||
| settings.update_user_settings(cx, |settings| { | ||
| settings.editor.auto_signature_help = Some(true); | ||
| settings.editor.hover_popover_delay = Some(DelayMs(300)); |
There was a problem hiding this comment.
Add hover_popover_delay for coverage.
|
was it intended that this applies to all forms of signature help? the mentioned issue only referred to |
|
No, sorry, I have relied on the contributor. |
Follow-up of #46745 Release Notes: - N/A
Closes zed-industries#46191 Release Notes: - Make the auto signature popover — `"auto_signature_help": true` — respect `hover_popover_delay`.
Closes #46191
Release Notes:
"auto_signature_help": true— respecthover_popover_delay.