Automatic insertion of "private"

Whenever I add a new class member in C#, for example:

bool isTrue;


Resharper automatically inserts the word "private" in front of it:

private bool isTrue;

This makes me sad. How do I tell Resharper to NOT insert this keyword proactively? :(

7 comments
Comment actions Permalink

penciluser schrieb:

This makes me sad. How do I tell Resharper to NOT insert this keyword proactively? :(


ReSharper -> Options -> Languages -> C# -> Formatting Style -> Other ->
Modifiers -> Use explicit private modifier

Regards

Albert

0
Comment actions Permalink

Is it possible to make ReSharper not perfrom any action on this rule?

Having "Use explicit private modifier" checked makes it insert the private modifier
Having "Use explicit private modifier" unchecked makes it remove the modifer if i have added it.

I would llike to have it perform no actio - if i add the modifier, leave it there, if i dont add one, dont insert one.
Alternativly, if i can disable this on a project/file wildcard basis that would work too.

Thanks.

0
Comment actions Permalink

wouldn't it be a good idea to always use an explicit modifier? Code will be more readable with it. And what will you do if MS decides to change the default scope of variables?

Regards
Klaus

0
Comment actions Permalink

Yes, in normal projects I totaly agree in always using Explicit Modifers, however when you have an mspec test, the modifiers make it look far worse:
See this article for what I mean: http://codebetter.com/aaronjensen/2008/10/19/getting-resharper-and-vs-to-play-nice-with-mspec/

0
Comment actions Permalink

Hello Andy,

You can turn off both 'Arrange modifiers in existing code' and 'Use explicit
private modifier' options and ReSharper should not take any actions whether
there's a private modifier or not. Thank you!

Andrey Serebryansky
Senior Support Engineer
JetBrains, Inc
http://www.jetbrains.com
"Develop with pleasure!"

Is it possible to make ReSharper not perfrom any action on this rule?

Having "Use explicit private modifier" checked makes it insert the
private modifier Having "Use explicit private modifier" unchecked
makes it remove the modifer if i have added it.

I would llike to have it perform no actio - if i add the modifier,
leave it there, if i dont add one, dont insert one.

Alternativly, if i can disable this on a project/file wildcard basis
that would work too.

Thanks.

---
Original message URL:
http://devnet.jetbrains.net/message/5300335#5300335



0
Comment actions Permalink

ok, i agree with you. In this special case the code is in fact more readable B-)

0
Comment actions Permalink

Thats exactly what I was after, thank you.

0

Please sign in to leave a comment.