rust-lang / rust-lang/rust-analyzer

Quick-Fix (and CTRL+TAB) suggestions show re-exports and import re-export instead of requested thing

Open
#15,987 0 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

C-bug
Dominant language
Rust
Stars
16.9k
Forks
2.2k
Avg merge
1d 12h
Merged PRs (30d)
72

Description

image

Notice how we have Report, yet the suggestion points to Report (use color_eyre::error::Error).

While color_eyre::error::Error an alias of color_eyre::error::Report, accepting this suggestion does not compile.

Re-export in eyre:

https://github.com/eyre-rs/eyre/blob/da84e8c624804d99bf23c6e315eaf584722f6027/eyre/src/lib.rs#L383

Same issue occurs with invoking Quick Fix:

image

->

image

rust-analyzer version: rust-analyzer version: 0.3.1748-standalone

rustc version: rustc 1.74.0 (79e9716c9 2023-11-13)

relevant settings: Not sure there are any

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 issue with the linked eyre re-export example and compare the completion suggestion with the Quick Fix result. Trace the completion and Quick Fix handling for re-exported items; done means both suggest the requested item rather than the re-export and the accepted import compiles.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
tooling
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 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.