Need help with some CodeCleanup rules...

Is there a way i can change the following, when i do a Default;Full Code Cleanup.

1) stop var's from being replaced by the Strong Type. eg. var lists = List<foo> lists;
2) Stop putting my classes in #region Nested Type: ClassName

0
7 comments

For #1, go to ReSharper | Options, under Code Editing click on Code Cleanup. Under C# there is a section for "User 'var' in declaration".

For #2, go to ReSharper | Options, under Code Editing click on C# | Type Members Layout.

0
Avatar
Permanently deleted user

>>For #1, go to ReSharper | Options, under Code Editing click on Code Cleanup. Under C# there is a section for "User 'var' in declaration".

When i click on Code Cleaup (in this area), there is NOTHING listed. no profiles. Can't i modifiy the 'default' profile?

>>For #2, go to ReSharper | Options, under Code Editing click on C# | Type Members Layout.
I guess i need to UNTICK 'use default patterns' and then remove the xml for nested types (the very last bit).

    <!--nested types-->
    <Entry>
      <Match>
        <Kind Is="type"/>
      </Match>
      <Sort>
        <Name/>
      </Sort>
      <Group>
        <Name Region="Nested type: ${Name}"/>
      </Group>
    </Entry>



/\__ remove all that.
0
Avatar
Permanently deleted user

Hello
     1. Default profiles cannot be modified. You can create your own profile and tune 'var' related options for that profile.
     2. You should remove the Group clause from that pattern:     
      <Group>
        <Name Region="Nested type: ${Name}"/>
      </Group>

Andrey Serebryansky

Senior Support Engineer

JetBrains, Inc

http://www.jetbrains.com

"Develop with pleasure!"

0
Avatar
Permanently deleted user

Hi Andrey and thanks for the reply!

1) if i create a custom profile, can that be saved to the team-shared file?

2) If i have a team-shared file .. do all the team members need to IMPORT that file .. or .. it is automatically detected and used.

0
Avatar
Permanently deleted user

Hello
     Starting with ReSharper 6.1 sharing a new code cleanup profile and type member layout with the team should be simple: after creating a new profile and modifying the type member layout click 'Save To' and choose team-shared layer. You can then put those changes into VCS and other developers will get them as soon as they update. Let me know if this helps. Thank you!

Andrey Serebryansky

Senior Support Engineer

JetBrains, Inc

http://www.jetbrains.com

"Develop with pleasure!"

0
Avatar
Permanently deleted user

Yeah, Andrey .. this -definitely- helps :)

so i'm assuming that .. by just having this xxx.sln.DotSettings file in the root project directory, R# automatically sees it and auto uses it?

0
Avatar
Permanently deleted user

Hello
     Yes, it automatically picks up changes in that file when it's changed without the need to restart Visual Studio.

Andrey Serebryansky

Senior Support Engineer

JetBrains, Inc

http://www.jetbrains.com

"Develop with pleasure!"

0

Please sign in to leave a comment.