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

Method auto-complete randomly doesn't work (jumps between three different behaviors) #7560

Closed
kangalio opened this issue Feb 4, 2021 · 2 comments · Fixed by #12431
Closed
Labels
A-completion autocompletion S-actionable Someone could pick this issue up and work on it right now

Comments

@kangalio
Copy link

kangalio commented Feb 4, 2021

output-2021-02-04_21.37.48.mp4

As you can see in the video, when typing the first few characters of a method, three different things may happen, seemingly without no pattern:

  1. rust-analyzer's nice method list pops up
  2. VSCode's built-in autocomplete pops up
  3. Nothing pops up

Through experimentation, I could identify what triggers each of the behaviors:

  1. type all characters normally
  2. type the first 2-3 characters rapidly
  3. type the last 2-3 characters rapidly

This issue seems easy to reproduce, but here is a copy-and-pastable code just in case (I tested it in a blank project, it behaves the same)

fn trim_multiline(string: &str) -> &str {
    while string./*type "ends" here, in varying speeds*/
}

Versions:

  • VSCode: 1.52.1
  • rust-analyzer: v0.2.473
  • OS: KDE Linux

If there is anything else I can provide to make the issue more clear, I'm happy to provide it

@SomeoneToIgnore
Copy link
Contributor

Thank you for finding the time to record a video and experiment with it.

Most probably it's the same case as discussed in #7542
When zero completion input is done after . symbol, we might get slow when finding traits appropriate for importing.

I have a few ideas in the same issue on how to improve the situation, we also have an issue for benchmarks.

@lnicola lnicola added A-completion autocompletion S-actionable Someone could pick this issue up and work on it right now labels Feb 5, 2021
@memoryruins
Copy link
Contributor

Before finding this, I posted a couple vscode settings in a similar issue #10187 (comment)

"editor.wordBasedSuggestions": false,
"editor.quickSuggestionsDelay": 200,

It has made r-a's suggestions pop up much more consistently for me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-completion autocompletion S-actionable Someone could pick this issue up and work on it right now
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants