Skip to content

generate_new loses indent #19784

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
A4-Tacks opened this issue May 12, 2025 · 0 comments · May be fixed by #19785
Open

generate_new loses indent #19784

A4-Tacks opened this issue May 12, 2025 · 0 comments · May be fixed by #19785
Labels
C-bug Category: bug

Comments

@A4-Tacks
Copy link
Contributor

rust-analyzer version: rust-analyzer 1.86.0 (05f9846 2025-03-31)

rustc version: rustc 1.86.0 (05f9846f8 2025-03-31)

code snippet to reproduce:

mod foo {
    struct $0Foo {}
}

->

mod foo {
    struct Foo {}

impl Foo {
    fn new() -> Self {
        Self {  }
    }
}
}

Expect:

mod foo {
    struct Foo {}

    impl Foo {
        fn new() -> Self {
            Self {  }
        }
    }
}

Similar to:

mod foo {
    struct $0Foo {}

    impl Foo {
        fn some() {}
    }
}

->

mod foo {
    struct Foo {}

    impl Foo {
        fn new() -> Self {
        Self {  }
    }

        fn some() {}
    }
}

Expect:

mod foo {
    struct Foo {}

    impl Foo {
        fn new() -> Self {
            Self {  }
        }

        fn some() {}
    }
}
@A4-Tacks A4-Tacks added the C-bug Category: bug label May 12, 2025
@A4-Tacks A4-Tacks linked a pull request May 12, 2025 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-bug Category: bug
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant