rust-lang / rust-lang/rust-analyzer

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

Open
#3,021 6 comments 2 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

A-completion C-enhancement E-hard S-actionable
Dominant language
Rust
Stars
16.9k
Forks
2.2k
Avg merge
1d 12h
Merged PRs (30d)
72

Description

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.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the autocomplete case described with the nightly toolchain using Some(22).expect_none, then trace the autocomplete handling for unstable methods and feature-flag insertion. Done means accepting the completion adds the required feature flag when it is absent and does not add a duplicate when it is already present.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
developer-experience, tooling
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.