rust-lang / rust-lang/rust-analyzer

"Flip comma" assist in parameter list should update callers

Open
#8,625 7 comments 2 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

A-assists E-hard fun S-actionable
Dominant language
Rust
Stars
16.9k
Forks
2.2k
Avg merge
1d 12h
Merged PRs (30d)
72

Description

fn f(a: u32,$0 b: &str) {}

fn g() {
    f(0, "");
}

Applying "Flip comma" results in:

fn f(b: &str, a: u32) {}

fn g() {
    f(0, "");
}

Ideally it would update the call in g to update the argument order. (The same should probably happen when applying "Flip comma" in f(0,$0 ""))

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

Start by locating the implementation of the "Flip comma" assist and its existing tests. Reproduce the parameter-list and call-site examples, then verify that applying the assist in either location keeps caller argument order aligned with the reordered parameters.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
developer-experience, tooling
Issue type
Bug
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.