rust-lang / rust-lang/rust-analyzer

"Fill struct fields" should insert fields in the same order as in struct's definition

Open
#10,622 1 comment 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

struct Struct {
    field: String,
    field_added_later: i32,
    other_field: bool,
}

fn main() {
    let test = Struct {
        field: "test".to_string(),
        other_field: true,$0
    };
}

->

struct Struct {
    field: String,
    field_added_later: i32,
    other_field: bool,
}

fn main() {
    let test = Struct {
        field: "test".to_string(),
        field_added_later: todo!(),
        other_field: true,
    };
}

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

The issue does not name files, tests, or an entry point. Locate the implementation and tests for the “Fill struct fields” assist, then reproduce the example and verify that inserted fields follow their declaration order while preserving existing field values.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
developer-experience
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Quiet
Clarity
Clearly specified
Newbie friendliness
55/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.