WeSt
WeSt

Reputation: 929

ReSharper functionheader code formating

I'm using ReSharper with VS2015. I want to do some changes in the code formatin settings, but I don't get exactly what I want.

For example I use a function like this:

public static MyFunction(int one, string two, double three)
{
....
}

when I hit save and the line is to long the code will be formatted like this.

public static MyFunction(
    int one, 
    string two, 
    double three)
{
....
}

But what I want is this.

public static MyFunction(
                         int one, 
                         string two, 
                         double three)
{
....
}

I would like to format it also like this when I call a function. So is there a possibility to format it like the last one? Could find the correct settings in the ReSharper options.

Thanks for your help

Upvotes: 1

Views: 47

Answers (1)

MartinPtrl
MartinPtrl

Reputation: 71

I'd like to strongly discourage you from trying to format the code like this. There is no resharper setting that would allow this. Stay with the second option:

`public static MyFunction(
    int one, 
    string two, 
    double three)
{
....
}`

This is totally fine, I see no added value when you format the code like you want to.

But if you really really really want it you can create your own Custom code inspection which is not exactly what you are looking for since you won't get your results on formatting but when invoking resharper's code inspection.

Upvotes: 1

Related Questions