rust-lang / rust-lang/rust-analyzer

Normalize import assist doesn't agree with rustfmt

Open
#20,827 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

rust-analyzer version: (eg. output of "rust-analyzer: Show RA Version" command, accessible in VSCode via Ctrl/⌘+Shift+P)

rustc version: rust-analyzer version: 0.4.2640-standalone

editor or extension: VSCode

relevant settings: None

repository link (if public, optional): https://github.com/trifectatechfoundation/sudo-rs/

code snippet to reproduce:

use sudo_test::{is_original_sudo, User};

gets normalized to

use sudo_test::{User, is_original_sudo};

but then rustfmt changes it back to the old format. This is on the 2021 edition.

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 in VSCode using the shown sudo_test import on the 2021 edition, then compare rust-analyzer's Normalize Import Assist output with rustfmt's result. Start by checking how the assist and rustfmt handle import ordering; done means both tools agree on the normalized form.

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
Clearly specified
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.