-
-
Notifications
You must be signed in to change notification settings - Fork 2.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Re-request workspace symbols on keypress in picker #3110
Conversation
Most language servers limit the number of workspace symbols that are returned with an empty query even though all symbols are supposed to be returned, according to the spec (for perfomance reasons). This patch adds a workspace symbol picker based on a dynamic picker that allows re-requesting the symbols on every keypress (i.e. when the picker query text changes). The old behavior has been completely replaced, and I have only tested with rust-analyzer so far.
Debounce: you could use the idle timer event that's used for completion, I can't remember if the change is there or not but I imagined it would trigger a generic event on the compositor so the components can handle idle timeout the way they want |
Ported over from 61365df in the `gui` branch. This will allow adding our own events, most notably an idle timer event (useful for adding debounced input in [dynamic pickers][1] used by interactive global search and workspace symbols). [1]: helix-editor#3110
Very much interested in this, thank you for working on it ! |
Ported over from 61365df in the `gui` branch. This will allow adding our own events, most notably an idle timer event (useful for adding debounced input in [dynamic pickers][1] used by interactive global search and workspace symbols). [1]: helix-editor#3110
Ported over from 61365df in the `gui` branch. This will allow adding our own events, most notably an idle timer event (useful for adding debounced input in [dynamic pickers][1] used by interactive global search and workspace symbols). [1]: #3110 Co-authored-by: Blaž Hrastnik <[email protected]>
Ported over from 61365df in the `gui` branch. This will allow adding our own events, most notably an idle timer event (useful for adding debounced input in [dynamic pickers][1] used by interactive global search and workspace symbols). [1]: helix-editor#3110 Co-authored-by: Blaž Hrastnik <[email protected]>
Is there anything we can do to help move this forward? |
@the-mikedavis @archseer @sudormrfbin Anything blocking this from a merge? cc/ @papertigers |
It requires #3172 (which has some unresolved comments) and then a proper mechanism for debouncing. |
I think just #3172 is enough on it's own for now. It'll slightly lag since we will only send the request on idle and not per keypress but that at least gets it working. |
#4916 is related. I pulled down this PR and ran it successfully. Please note that nothing appears until after I start typing (which may be by design?) See asciinema below: |
Fixes #1437. Most language servers limit the number of workspace symbols that are returned with an empty query even though all symbols are supposed to be returned, according to the spec (for perfomance reasons). This patch adds a workspace symbol picker based on a dynamic picker that allows re-requesting the symbols on every keypress (i.e. when the picker query text changes). The old behavior has been completely replaced, and I have only tested with rust-analyzer so far.
Notice how in the old picker the
format_and_save
function was not being picked up. This is because the picker only filtered the list of symbols that was initially given byrust-analyzer
which does not include all symbols. In the dynamic picker a specific query of the current prompt text is sent to the server and we get accurate results from the server.The newly added dynamic picker can also be used for interactive global search (#196), which is next on my list :)
TODO
Picker
insideDynamicPicker
.