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

Very limited autocomplete #15711

Closed
rsalmei opened this issue Oct 4, 2023 · 8 comments · Fixed by #15713
Closed

Very limited autocomplete #15711

rsalmei opened this issue Oct 4, 2023 · 8 comments · Fixed by #15713
Labels
C-bug Category: bug

Comments

@rsalmei
Copy link

rsalmei commented Oct 4, 2023

Hi,

Please, why is the autocomplete so very limited like this? Is this correct? Is this intended??

I want to autocomplete Ipv6Addr, I push I (upper i):
image
Yep, there are only these 17 entries. I push p:
image
Now there isn't any... I push v:
image

Now it suddenly finds these two. It's very weird (and worrying, I must be missing A LOT of suggestions).
Why didn't these two entries come on the very first suggestions? They do contain upper I after all.
Why does Ip return nothing?
Is there some configuration I could change to get all the entries at once?

Thank you.

rust-analyzer version: rust-analyzer version: 0.3.1681-standalone (0840038 2023-09-30)
rustc version: rustc 1.72.0 (5680fa18f 2023-08-23)

@rsalmei rsalmei added the C-bug Category: bug label Oct 4, 2023
@flodiebold
Copy link
Member

Suggestions for names that aren't imported yet (that add a use statement) are only provided if there are at least three characters to match. Otherwise the completion list would get huge and slow.

@Veykril
Copy link
Member

Veykril commented Oct 5, 2023

I wonder, we could maybe do mere prefix matching for importing completions with <3 characters? That should limit the completions pretty well and gives intuitive results I think?

@rsalmei
Copy link
Author

rsalmei commented Oct 5, 2023

Suggestions for names that aren't imported yet (that add a use statement) are only provided if there are at least three characters to match. Otherwise the completion list would get huge and slow.

Thanks, I see.
But I wonder if that list would really be that huge and slow... Jetbrains' Rust plugin does bring a huge list with a single upper I, and instantaneously, including the Ipv6Addr:
image

EDIT: Oh, and they do find within the words (not only prefix search), even with lowercase:
image

@Veykril
Copy link
Member

Veykril commented Oct 5, 2023

Ideally we'd do the same, but it's just not currently feasible with how do things.

@rsalmei
Copy link
Author

rsalmei commented Oct 5, 2023

May I ask why? Because they use Kotlin+Java, and we use Rust after all...
Anyway, this PR of yours will surely improve things a lot!! Thank you very much.

@Veykril
Copy link
Member

Veykril commented Oct 5, 2023

Different architecture, having to align with the LSP which mainly results in our completions currently just not being very efficient currently.

@rsalmei
Copy link
Author

rsalmei commented Oct 5, 2023

I see, it is not performant with the current architecture... Thanks, man.

@bors bors closed this as completed in dca63d1 Oct 9, 2023
@rsalmei
Copy link
Author

rsalmei commented Oct 17, 2023

Please @Veykril, when is this going to be released?
It didn't make both the changelogs 202 and 203 already.

EDIT: Never mind, it did make into the 203! (I've looked for the issue, it was the PR) 👍

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

Successfully merging a pull request may close this issue.

3 participants