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

Very long use line fails to format #5371

Closed
conradludgate opened this issue Jun 7, 2022 · 2 comments
Closed

Very long use line fails to format #5371

conradludgate opened this issue Jun 7, 2022 · 2 comments

Comments

@conradludgate
Copy link

Reproduction:

use a::very::very::very::very::very::very::very::{

    very::very::very::very::very::very::very::very::very::long::Path
};

This tries to format into

use a::very::very::very::very::very::very::very::very::very::very::very::very::very::very::very::very::long::Path

Which I think triggers some misbehaviour and causes the block of imports to fail to format silently.

If given another item in the long module chain, it can format fine:

use a::very::very::very::very::very::very::very::{

    very::very::very::very::very::very::very::very::very::long::Path,
    another::path,
};
// turns into
use a::very::very::very::very::very::very::very::{
    another::path, very::very::very::very::very::very::very::very::very::long::Path,
};

Amount of modules doesn't change anything, only the number of characters.

@Globidev
Copy link

Globidev commented Jun 7, 2022

After experimenting a bit, there might be other parameters at play, like byte length and module nesting possibly ?

use ඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞ::{::};
// one more ඞ
use ඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞ::{::};
// less nesting but longer
use ඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞ::{

    ඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞ
};

only formats the second one incorrectly:

use ඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞ::::;
// one more ඞ
use ඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞ::{::};
// less nesting but longer
use ඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞ::ඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞඞ;

playground

@calebcartwright
Copy link
Member

Thanks for sharing but closing as a duplicate of #4746

@calebcartwright calebcartwright closed this as not planned Won't fix, can't repro, duplicate, stale Jun 11, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants