-
Notifications
You must be signed in to change notification settings - Fork 888
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: add spaces_within_parenthesized_items option. #5434
base: master
Are you sure you want to change the base?
Conversation
Thanks for submitting your first PR 🎉 Could you open a feature request issue where we can discuss the motivation for this change as well as the scope of the new option. This PR seems focused on functions and methods, but I think there are some other areas where parentheses appear that we might also need to consider. For example, Tuple literals I also want to point out that rustfmt is an implementation of the Rust Style Guide, and there are cases like There's also a pending PR (#5386), which wraps certain cast expressions in parens to avoid compiler errors. I wonder if we need to hold off on this PR until after that one is merged to avoid any issues with how this option might behave with those changes.
Default configuration tests typically live in It would also be nice to include comments in weird places to see if that affects anything. For example, the current tests show that All that said, lets start with the feature request issue and take it from there. |
I would personally like this feature very much, partially because I write a lot of C++ and C# so I am used to having this as a formatting option in Visual Studio, but mainly because I've found that spacing brackets out can make it a lot easier to keep my place when dealing with nested parenthesis, especially with code that has a lot of nested function calls. |
Merge lastest master branch
@henriquemelicias thanks for reaching out again. This is still a fairly low-priority feature request for the team, and I don't think we'll have the bandwidth to look into this in the near future. |
Hello!
Tracking issue: #5435
This feature adds the option to put a space after '(' and before ')' on items surrounded by parentheses (on function/method declarations, calls, ...).
Tips on improvements would be highly appreciated!