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

Option to split parameters across lines #153

Open
adamralph opened this issue Nov 19, 2019 · 4 comments
Open

Option to split parameters across lines #153

adamralph opened this issue Nov 19, 2019 · 4 comments
Labels
enhancement New feature or request

Comments

@adamralph
Copy link
Contributor

E.g.

public void Foo(
   string bar,
   string baz) { }

This would be a huge help in cases where the method signature gets long.

@danielmarbach
Copy link
Member

Would it be ok if this switch would generally just do method signature wrapping or only if a method is too long?

And what would you classify as a method too long? Would this have to be configurable?

Could you live with an option that just bluntly turns on wrapping for all method parameters?

@adamralph
Copy link
Contributor Author

Could you live with an option that just bluntly turns on wrapping for all method parameters?

Yep, that's what I was thinking.

@sungam3r
Copy link
Member

This may be helpful. But only as an option.

@danielmarbach
Copy link
Member

It should technically be possible to pipe the option into the normalizer and from there into the MethodModifierMatcher. The last match group is the method with the parameters and that could be augmented with Environment.NewLine for each parameter with comma expect but not for generics that contain commas

    public class MethodWithGenericUseOfClassTypeParameter<T, U>
    {
        public MethodWithGenericUseOfClassTypeParameter() { }
        public System.Collections.Generic.Dictionary<T, U> Method(System.Collections.Generic.Dictionary<T, U> item) { }
    }

@sungam3r sungam3r added the enhancement New feature or request label Jan 17, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants