Skip to content
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

Symbol picker should open immediately, without waiting for contents to load #8622

Open
Superty opened this issue Oct 26, 2023 · 4 comments
Open
Labels
C-enhancement Category: Improvements

Comments

@Superty
Copy link
Contributor

Superty commented Oct 26, 2023

Say I open helix for a particular file and immediately press space+s to open the symbol picker and start typing my search term. What happens today is that the symbol picker takes time to open probably because the LSP is still starting up. The keys I typed for the search query end up being interpreted as keystrokes for the editor.

The picker should open immediately, my keys should go into the picker's filter, and the contents of the picker can load slowly if the LSP is slow or whatever. AFAIU, async buffering into the picker is already supported.

@Superty Superty added the C-enhancement Category: Improvements label Oct 26, 2023
@the-mikedavis
Copy link
Member

I like this idea and I think the change would be quite small to change the behavior this way: streaming results into the picker is very easy thanks to nucleo (#7814). There's a general problem with the picker though that it doesn't have a way to show the progress of whatever task is adding items to the picker. So if we make a change to stream in the symbols when we get the RPC response from the language server, we would open the picker and see nothing and then symbols would suddenly appear (or not, if there are no symbols in the file). The problem is there for other picker use-cases as well like dynamic global search (#196) - the picker should have a way to indicate that it has finished searching for the pattern.

I talked to @pascalkuthe about this and he has a clever idea for a change in nucleo that would allow you to cheaply detect when the task that streams in items is done. nucleo Injectors are ref counted so when we see the number of references drop to zero we know we're no longer streaming in new items. We're not sure how the picker should show that it is running/working though. The braille spinner we use for LSP progress is a little complicated rendering-wise and visually distracting so it'd be nice to find something more subtle.

@Superty
Copy link
Contributor Author

Superty commented Oct 29, 2023

Thanks for looking into this. I'm a little confused, because the picker seems to already support this. It currently just says (running) when this is the case.

screenshot

(Helix built from tip of tree helix 23.10 (44e03fa4))

@the-mikedavis
Copy link
Member

That's the indicator that nucleo is working on filtering the available items. For a simple progress indicator, we could repurpose that element to say "running" when the items are being streamed in and "filtering" when nucleo is working

@Superty
Copy link
Contributor Author

Superty commented Oct 29, 2023

It shows that even if I don't type in any filter though, and it disappears as soon as all items are loaded 🤔

The running/filtering messages sound good to me personally!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-enhancement Category: Improvements
Projects
None yet
Development

No branches or pull requests

2 participants