Skip to content

When an unstable method is autocompleted and no feature flag is present, add one #3021

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

Open
SomeoneToIgnore opened this issue Feb 5, 2020 · 6 comments
Labels
A-completion autocompletion C-enhancement Category: enhancement E-hard S-actionable Someone could pick this issue up and work on it right now

Comments

@SomeoneToIgnore
Copy link
Contributor

In the project with nightly toolchain used, Some(22).ex<|> proposes expect_none method which is unstable currently.

image

But when I autocomplete it, I need to manually add the feature flag to enable the feature.
I would expect RA to add this flag automatically, if not added already.

@SomeoneToIgnore SomeoneToIgnore changed the title When an unstable method is used and no feature flag is present, add one When an unstable method is autocompleted and no feature flag is present, add one Feb 5, 2020
@matklad matklad added the E-hard label Feb 5, 2020
@matklad
Copy link
Member

matklad commented Feb 5, 2020

Hard, as we first need to design the infra for answering the question "which unstable features are available".

@lnicola
Copy link
Member

lnicola commented Feb 5, 2020

Maybe we could use the #[unstable] attribute on the item?

@p-avital
Copy link

p-avital commented Feb 5, 2020

Wasn't there an other issue recently that asked about "not offering to complete with unstable methods"?
Maybe "marking" the completions as unstable would be useful, seems like infra to handle unstableness has use cases either way.

@lnicola lnicola added A-completion autocompletion S-actionable Someone could pick this issue up and work on it right now labels Jan 22, 2021
@installgentoo
Copy link

So is there a way to hide unstable? Not autocompleting things that won't compile seems to me like a stable release gating feature, not just some minor thing.

@bjorn3
Copy link
Member

bjorn3 commented Dec 6, 2022

Not that I know of. In any case it should be possible to autocomplete unstable things as you may be using nightly or be working in a part of the code gated behind nightly. I do agree that it would be useful to indicate that a method is unstable and deprioritize it though.

@lowr
Copy link
Contributor

lowr commented May 29, 2023

microsoft/language-server-protocol#1605 is needed to support this feature without limiting it to the crate-root files (which would be super weird from users' perspective). Or can we add another LSP extension until then? (I don't really know to what extent LSP extensions are capable of)

lnicola pushed a commit to lnicola/rust-analyzer that referenced this issue Apr 7, 2024
Use Vec's binary search instead of hand-written one.
RalfJung pushed a commit to RalfJung/rust-analyzer that referenced this issue Apr 27, 2024
Use Vec's binary search instead of hand-written one.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-completion autocompletion C-enhancement Category: enhancement E-hard S-actionable Someone could pick this issue up and work on it right now
Projects
None yet
Development

No branches or pull requests

8 participants