Skip to content
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

Formatter can't recognize newline missing #65

Closed
ShiKaiWi opened this issue Jun 24, 2022 · 5 comments
Closed

Formatter can't recognize newline missing #65

ShiKaiWi opened this issue Jun 24, 2022 · 5 comments
Labels
feature New feature or request

Comments

@ShiKaiWi
Copy link
Member

Description
Now the rust formatter can't recognize the necessary newline missing, e.g.:

use crate::{
    instance::{Instance, InstanceRef},
    mysql::{error::*, worker::MysqlWorker},
};
pub struct MysqlService<C, Q> {

Make the formatter can fix this case.

Proposal
No proposal yet.

Additional context

@ShiKaiWi ShiKaiWi added the feature New feature or request label Jun 24, 2022
@jiacai2050
Copy link
Contributor

There is a tracking issue in rustfmt:

@waynexia
Copy link
Member

current version of blank_lines_lower_bound is not what we want: https://rust-lang.github.io/rustfmt/?version=v1.5.0&search=#blank_lines_lower_bound

its example behavior is a bit wired

fn foo() {

    println!("a");
}

fn bar() {

    println!("b");

    println!("c");
}

@jiacai2050
Copy link
Contributor

current version of blank_lines_lower_bound is not what we want

This comment says it's already been fixed in this rust-lang/rustfmt#4295, just not released...

@ygf11
Copy link
Contributor

ygf11 commented Jun 28, 2022

I think rust-lang/rustfmt#4295 is merged to the rustfmt-v2-rc branch, which is not going to release.

So the current release(rustfmt-v1) does not contain this patch.

rustfmt-v2 tracking issue:
rust-lang/rustfmt#3887

@jiacai2050
Copy link
Contributor

jiacai2050 commented Mar 2, 2023

Closing since this won't be fixed with rustfmt-v1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature New feature or request
Projects
None yet
Development

No branches or pull requests

4 participants