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

[Feature request] Vertical formatting for attributes #5646

Open
blyxyas opened this issue Dec 30, 2022 · 1 comment
Open

[Feature request] Vertical formatting for attributes #5646

blyxyas opened this issue Dec 30, 2022 · 1 comment
Labels
blocked Blocked on rustc, an RFC, etc. feature-request

Comments

@blyxyas
Copy link
Member

blyxyas commented Dec 30, 2022

Hi, it would be really cool if an attribute's content could be arranged in more ways. (Similar to array_width)

Example:

Currently, if you have this attribute:

#[diagnostic(
    code(...),
    url(...),
    severity(...)
)]
fn x() {...}

It will get rearranged to:

#[diagnostic(code(...), url(...), severity(...))]
fn x() {...}

It would be useful if there was an option specifically for vertical formatting in attributes' content

@ytmimi ytmimi added feature-request blocked Blocked on rustc, an RFC, etc. labels Dec 30, 2022
@ytmimi
Copy link
Contributor

ytmimi commented Dec 30, 2022

Hey @blyxyas thanks for reaching out.

A lot of the work needed to implement this feature is currently being added in #5337. Once that PR lands this should be fairly straightforward to implement, but until then let's keep this on hold.

In the meantime you might try to see if you can use attr_fn_like_width to achieve the formatting you're looking for

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
blocked Blocked on rustc, an RFC, etc. feature-request
Projects
None yet
Development

No branches or pull requests

2 participants