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

Show placeholder while run command gets runnables from server #15896

Merged
merged 1 commit into from Dec 8, 2023

Conversation

minestarks
Copy link
Contributor

This PR fixes a UI annoyance in the VS Code extension when working in large codebases where rust-analyzer can take a few moments to interact with the server. Scenario:

  1. Invoke "rust-analyzer: Run" from the command palette or hotkey
  2. Quickly start typing to filter the list (or press Enter to accept the last runnable)

We often do this quickly from muscle memory without waiting to see the picker. The picker often takes several seconds to come up, causing us to type garbage into the currently open editor.

Fix:

Show a placeholder item before we call out to the server.

image

Selecting this item does nothing so if the user accidentally hits Enter nothing happens.

The list is populated and the placeholder dismissed when the actual runnables are retrieved. From here the behavior is the same as before.

image

@rustbot rustbot added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Nov 14, 2023
@minestarks
Copy link
Contributor Author

Maintainers @Veykril @lnicola is there anything I still need to do to get eyes on this PR? This is my first contribution, I believe I've done due diligence and thank this will be a benefit to users. Thank you for your attention! 🙂

@Veykril
Copy link
Member

Veykril commented Dec 8, 2023

The team is just short on time for PR reviews atm, so sorry that it took so long to get back :) Thanks!
@bors r+

@bors
Copy link
Collaborator

bors commented Dec 8, 2023

📌 Commit ec3f35b has been approved by Veykril

It is now in the queue for this repository.

@bors
Copy link
Collaborator

bors commented Dec 8, 2023

⌛ Testing commit ec3f35b with merge c27fc0c...

@bors
Copy link
Collaborator

bors commented Dec 8, 2023

☀️ Test successful - checks-actions
Approved by: Veykril
Pushing c27fc0c to master...

@bors bors merged commit c27fc0c into rust-lang:master Dec 8, 2023
10 checks passed
@minestarks
Copy link
Contributor Author

Thank you for taking this 🧡

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-review Status: Awaiting review from the assignee but also interested parties.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants