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

No space after semicolons & comma after struct fields is not "pretty" #290

Closed
Boscop opened this issue Dec 6, 2020 · 4 comments
Closed
Labels
feature A new feature for the syntax or library.

Comments

@Boscop
Copy link

Boscop commented Dec 6, 2020

Consider this:

        [
            Some((
                asset: Misc(Buffer),
                sampler: (filter:mipmap,wrap:clamp,vflip:true), // should have spaces after semicolons & commas
            )),// [0]
            None,// [1]
            None,// [2]
            Some((
                asset: Misc(Stream),
                sampler: (filter:linear,wrap:clamp,vflip:true),
            )),
        ],

https://docs.rs/ron/0.6.2/ron/ser/struct.PrettyConfig.html#structfield.depth_limit

The types after this depth should still follow normal formatting guidelines like having spaces after semicolons & commas.

depth_limit: usize
Limit the pretty-ness up to the given depth.

What does this even mean? That everything after that level is not pretty-printed?
I use .with_depth_limit(4) but I don't want everything beyond that depth to not be pretty,
I just want to limit the depth for expanding types to multiple lines.

Actually what I'd really want is some max_width limit like in rustfmt to say that types should be written on one line unless they go over that limit. I thought that's what the depth limit is for, but apprently not.
Can you please add something like max_width? :)

@kvark
Copy link
Collaborator

kvark commented Dec 6, 2020

What does this even mean?

I think having spaces after commas would still be nice there. But the idea was to stop breaking the lines, at least.

max_width is not something I needed personally, but if you want to contribute this, I can believe it's going to be useful to some.

@kvark kvark added the feature A new feature for the syntax or library. label Dec 6, 2020
@github-actions
Copy link

Issue has had no activity in the last 180 days and is going to be closed in 7 days if no further activity occurs

@github-actions github-actions bot added the stale label Nov 18, 2021
@kvark kvark reopened this Dec 3, 2021
@kvark
Copy link
Collaborator

kvark commented Dec 17, 2021

comment

@juntyr
Copy link
Member

juntyr commented Dec 18, 2021

@Boscop Have #344 and #349 solved your issue?

@github-actions github-actions bot removed the stale label Dec 18, 2021
@juntyr juntyr closed this as completed Feb 19, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature A new feature for the syntax or library.
Projects
None yet
Development

No branches or pull requests

3 participants