-
-
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
Some sort of filtering on code actions menu #3502
Comments
Okay in this case you're not talking about autocomplete, but code actions. |
The original UI actually had a small picker for this but I didn't expect the LSP to ever offer this many options so we simplified to a menu |
Ah okay, I figured I got the terminology wrong - I'll modify the title. |
When you say "the original UI had a small picker," do you mean the UI was something similar to the fuzzy finder used for files? And yeah, I'm surprised rust-analyzer is offering this many options as well. Perhaps if any change were to be made, would it be best to only give a larger picker (instead of a menu) if the LSP returns more than, say, 10 items? But in that case, you'd have inconsistency between the two interfaces, which sucks if you don't know which interface will appear beforehand. |
One general way I could see is to always use a menu (the current behavior) and adding a function/keybind to open the current menu in a picker. For consistency, this could be used for other menus aswell like auto complete. |
It would be awesome to be able to select the action through fuzzy search so a picker would be nice (if that's the correct term).
Could that be paired with an option to open the menu in a picker by default? It would be much more comfortable and faster to select the item you want, especially if you know in advance its name (e.g. for import actions) if you can avoid an extra key press. Or maybe instead of an option a simple remap like |
Hi, I have just opened #4134. While that PR doesn't directly solve the feature request (fuzzy matching on code-actions), it does solve the original usecase: With #4134 the |
Describe your feature request
There are some scenarios where there are a lot of code action options available, and the option I want is very far down the list.
This is what I encountered today: I created a new .rs file, and added an Arc. I wanted to use Space+A to use LSP to import it, and this is what showed up:
So I use tab to go further down...
and further still...
and another page of options...
until finally I get to the option I'm looking for:
I'm not sure what the best UI/UX choice would be for this, but it would be nice if there was some way to filter out or "search" the options, e.g. if I could hit Space+A and then type "imp" to get the import option. As is, if I type "imp" I end up inserting the text "mp" into the document, which I assume is because I'm in normal mode while the modal is up.
Any thoughts on this? For now, it looks like hitting Shift+Tab twice works, so it's not a huge deal in the mean time.
The text was updated successfully, but these errors were encountered: