rust-lang / rust-lang/rust-analyzer

Ability to quality all imports for a given import

Open
#17,209 0 comments 1 reaction 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

When working with a large codebase with many different types, types often need to be aliased or partially/fully qualified to distinguish it from a different type of the same name.

For example,

use geo::Point;
use a::b::generated::Point;

let x: Point; // Eh? Which one?

User flows

This issue proposes the following flow:

Replace use with qualified path

For qualifying a useed type, one would:

  1. Right-click a used type.
  2. Click "Replace use with qualified path".
  3. Observe that all imports are fully qualified.

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 code-action handling for Rust use imports and trace how a selected imported type is resolved; done means a right-clicked import can be replaced by a fully qualified path across the described example.

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
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.