Resharper File Layout problem

Using registered/purchased Resharper 2022.1.2 Build 221.0.20220601.154737

I'm trying to modify the file layout configuration to control the access order and I'm having zero luck with it.  I know the changes I make are having an effect because I can modify the .cs file and then reapply the layout and it consistently puts it back to the order I do not want.

What I want is to more or less reverse the order of methods when I do a Code Cleanup and have private protected public, in that order and to that intent I have the following in my file layout xaml (with information provided from an older post here):

        <Region Name="Methods">
            <Group DisplayName="Group">
                <Group.GroupBy>
                    <Access/>
                    <Name/>
                </Group.GroupBy>
                <Entry DisplayName="Methods">
                    <Entry.Match>
                        <Kind Is="Method"/>
                    </Entry.Match>
                    <Entry.SortBy>
                        <Access Order="Internal Private Protected Public ProtectedInternal"/>
                    </Entry.SortBy>
                </Entry>
                <Entry DisplayName="All other members">
                    <Entry.SortBy>
                        <Access Order="Internal Private Protected Public ProtectedInternal"/>
                    </Entry.SortBy>
                </Entry>
            </Group>
        </Region>

Despite this the order is constantly changed to public protected private. Any suggestions on what I'm doing wrong?

3 comments
Comment actions Permalink

Hello,

 

Please try changing the XAML sample you've specified with the following one:

    <Entry DisplayName="All other members" />
    <Region Name="Methods">
                            <Entry DisplayName="Methods">
                    <Entry.Match>
                        <Kind Is="Method"/>
                    </Entry.Match>
                    <Entry.SortBy>
                        <Access Order="Internal Private Protected Public ProtectedInternal"/>
                    </Entry.SortBy>
                </Entry>
        </Region>

Please let me know how it works for you.

Thank you.

0
Comment actions Permalink

That does appear to work, thank you.  I am having some further problems though, is there a web page that documents the options available in the XAML file?

0
Comment actions Permalink

We have no such document. I'd suggest using File Layout GUI option, we have a detailed article for that - https://www.jetbrains.com/help/resharper/File_and_Type_Layout.html.

If you experiencing any other issues please let me know, I'll gladly assist you.

0

Please sign in to leave a comment.