rust-lang / rust-lang/rust-analyzer

Inlay hints for glob imports showing the used items used

Open
#17,751 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

When you use glob imports, it's hard to tell which items you are actually importing. The only way to check is to manually checked which items are used or by deleting the import and seeing where there are unresolved references. If you double clicked on it (and maybe also a keyboard shortcut), it could replace the glob import with an explicit one.

Glob imports are useful for rapid development, but maybe later you want to use a normal one once the project is more stable, or maybe the hint shows you that you're only importing 2 or 3 items; then you could double click and it would replace it with a normal import. It would also be very useful when you glob import preludes.

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

No files or tests are named. Start by locating the glob-import and inlay-hint entry points, then trace how explicit imports are produced; done means hints show the imported items and the proposed interaction replaces the glob import with an explicit one.

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.