rust-lang / rust-lang/rust-analyzer

Autocomplete let with unresolved identifiers

Open
#8,216 6 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

For example

let <|>
println!("{}", foo);

should list foo as autocomplete option. Preferable this would also work at other locations variables are defined. As a nice bonus it would also work for items:

struct <|>

fn main() {
    let bar = 0;
    Foo { bar }
}

should autocomplete at least Foo.

I often write the usage of a variable before I actually define it, so the extract variable assist doesn't help.

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

Start by reproducing the two Rust autocomplete examples: an unresolved foo after let and Foo in the struct expression. Trace the autocomplete entry point that handles these positions and make completion include identifiers or items declared later; done means both examples offer the expected completions.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
devtools
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.