Skip to content

fix: fix some assist indent#22722

Open
A4-Tacks wants to merge 2 commits into
rust-lang:masterfrom
A4-Tacks:assists-newline-indent
Open

fix: fix some assist indent#22722
A4-Tacks wants to merge 2 commits into
rust-lang:masterfrom
A4-Tacks:assists-newline-indent

Conversation

@A4-Tacks

@A4-Tacks A4-Tacks commented Jul 4, 2026

Copy link
Copy Markdown
Member

For exprs like non_newline.call(newline) non_newline(newline) etc, is it worth adding some if in #21719 to exclude newline?

Example

Before this PR:

fn main() {
    {
        {
            loop {
                if let Some(_) = foo(
                            "xxx"
                        )
            {
                    bar(
                        "xxx",
                    );
                } else {
                    break;
                }
            }
        }
    }
}

After this PR:

fn main() {
    {
        {
            loop {
                if let Some(_) = foo(
                    "xxx"
                )
                {
                    bar(
                        "xxx",
                    );
                } else {
                    break;
                }
            }
        }
    }
}

@rustbot rustbot added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Jul 4, 2026
@ChayimFriedman2

Copy link
Copy Markdown
Contributor

@A4-Tacks, I already said many times I think we should not explicitly fixing whitespaces in assists. You seem to disagree. Therefore, I would like to set a policy wrt. this:

@rust-lang/rust-analyzer, do you think we should accept code changes that fix whitespaces in assists?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

S-waiting-on-review Status: Awaiting review from the assignee but also interested parties.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants