rust-lang / rust-lang/rust-analyzer

feature request: highlight uses of wildcard import when cursor is on it

Open
#16,557 0 comments 3 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

image
this is a screenshot of current behavior, where the cursor is on 'VecDeque' in the import statement. uses of 'VecDeque' are highlighted.

to me, it would be useful to also be able to see uses of wildcard imports (use ...::*), like for prelude imports where it is common to import the whole module using this. in the screen below i would want occurrences of StructA and StructC to be highlighted because the cursor is on the *.

image

something to think about is whether the * should be highlighted when the cursor is on any of its imported things (things are structs, enums, types, traits etc), but when the cursor is on StructA, StructC should not be highlighted

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 two wildcard-import examples shown in the issue and compare them with the existing highlighting of a named import such as VecDeque. Trace the current use-highlighting behavior, then verify that placing the cursor on * highlights its imported uses while placing it on one imported item does not highlight the other items.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
tooling
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.