<!DOCTYPE html SYSTEM "about:legacy-compat">
<html lang="en-US" data-preset="contrast" data-primary-color="#307FFF"><head><link rel="canonical" href="https://www.jetbrains.com/help/rider/File_and_Type_Layout.html" data-react-helmet="true"/><meta charset="UTF-8"></meta><meta name="built-on" content="2025-07-03T09:54:37.505695025"><meta name="build-number" content="780"><title>Rearrange members with file and type layout patterns | JetBrains&nbsp;Rider Documentation</title><script type="application/json" id="virtual-toc-data">[{"id":"introduction-to-layout-patterns","level":0,"title":"Introduction to layout patterns","anchor":"#introduction-to-layout-patterns"},{"id":"file-and-type-layout-preferences","level":0,"title":"File and type layout preferences","anchor":"#file-and-type-layout-preferences"},{"id":"configuring-file-and-type-layout-by-editing-the-source-xaml","level":0,"title":"Configure file and type layout by editing the source XAML","anchor":"#configuring-file-and-type-layout-by-editing-the-source-xaml"},{"id":"group_in_regions_by_name","level":0,"title":"Scenario: group items in regions by partial name match","anchor":"#group_in_regions_by_name"},{"id":"reordering-file-and-type-members","level":0,"title":"Reorder file and type members","anchor":"#reordering-file-and-type-members"},{"id":"disable-member-reordering-in-specific-types","level":0,"title":"Disable member reordering in specific types","anchor":"#disable-member-reordering-in-specific-types"}]</script><script type="application/json" id="topic-shortcuts">{"CodeCleanup":{"Visual Studio 2022":{"keystrokes":[{"keys":["mod-Control","char-E"]},{"keys":["char-C"]}],"platform":"PC"},"Visual Studio":{"keystrokes":[{"keys":["mod-Control","char-E"]},{"keys":["char-C"]}],"platform":"PC"},"$default":{"platform":"PC"},"VSCode":{"platform":"PC"},"Visual Assist":{"keystrokes":[{"keys":["mod-Control","char-E"]},{"keys":["char-C"]}],"platform":"PC"},"ReSharper":{"keystrokes":[{"keys":["mod-Control","mod-Alt","char-F"]}],"platform":"PC"},"Sublime Text":{"platform":"PC"},"Emacs":{"platform":"PC"},"Mnemonic Keymap":{"keystrokes":[{"keys":["mod-Control","char-R"]},{"keys":["char-C"]}],"platform":"PC"},"Default for KDE":{"platform":"PC"},"Default for GNOME":{"platform":"PC"},"Default for XWin":{"platform":"PC"},"Mac OS X 10.5+":{"platform":"MAC"},"VSCode OSX":{"platform":"MAC"},"macOS System Shortcuts":{"platform":"MAC"},"Sublime Text (Mac OS X)":{"platform":"MAC"},"Visual Studio OSX":{"keystrokes":[{"keys":["mod-Command","char-E"]},{"keys":["char-C"]}],"platform":"MAC"},"ReSharper OSX":{"keystrokes":[{"keys":["mod-Command","mod-Alt","char-F"]}],"platform":"MAC"},"Visual Assist OSX":{"keystrokes":[{"keys":["mod-Command","char-E"]},{"keys":["char-C"]}],"platform":"MAC"}},"ShowSettings":{"Visual Studio 2022":{"keystrokes":[{"keys":["mod-Control","mod-Alt","char-S"]}],"platform":"PC"},"Visual Studio":{"keystrokes":[{"keys":["mod-Control","mod-Alt","char-S"]}],"platform":"PC"},"$default":{"keystrokes":[{"keys":["mod-Control","mod-Alt","char-S"]}],"platform":"PC"},"VSCode":{"keystrokes":[{"keys":["mod-Control","char-,"]}],"platform":"PC"},"Visual Assist":{"keystrokes":[{"keys":["mod-Control","mod-Alt","char-S"]}],"platform":"PC"},"ReSharper":{"keystrokes":[{"keys":["mod-Control","mod-Alt","char-S"]}],"platform":"PC"},"Sublime Text":{"keystrokes":[{"keys":["mod-Control","mod-Alt","char-S"]}],"platform":"PC"},"Emacs":{"keystrokes":[{"keys":["mod-Control","mod-Alt","char-S"]}],"platform":"PC"},"Mnemonic Keymap":{"keystrokes":[{"keys":["mod-Control","char-U"]},{"keys":["char-S"]}],"platform":"PC"},"Default for KDE":{"keystrokes":[{"keys":["mod-Control","mod-Alt","char-S"]}],"platform":"PC"},"Default for GNOME":{"keystrokes":[{"keys":["mod-Control","mod-Alt","char-S"]}],"platform":"PC"},"Default for XWin":{"keystrokes":[{"keys":["mod-Control","mod-Alt","char-S"]}],"platform":"PC"},"Mac OS X 10.5+":{"keystrokes":[{"keys":["mod-Command","char-,"]}],"platform":"MAC"},"VSCode OSX":{"keystrokes":[{"keys":["mod-Command","char-,"]}],"platform":"MAC"},"macOS System Shortcuts":{"keystrokes":[{"keys":["mod-Command","char-,"]}],"platform":"MAC"},"Sublime Text (Mac OS X)":{"keystrokes":[{"keys":["mod-Command","char-,"]}],"platform":"MAC"},"Visual Studio OSX":{"keystrokes":[{"keys":["mod-Command","char-,"]}],"platform":"MAC"},"ReSharper OSX":{"keystrokes":[{"keys":["mod-Command","char-,"]}],"platform":"MAC"},"Visual Assist OSX":{"keystrokes":[{"keys":["mod-Command","char-,"]}],"platform":"MAC"}},"SilentCodeCleanup":{"Visual Studio 2022":{"keystrokes":[{"keys":["mod-Control","char-E"]},{"keys":["char-F"]}],"platform":"PC"},"Visual Studio":{"keystrokes":[{"keys":["mod-Control","char-E"]},{"keys":["char-F"]}],"platform":"PC"},"$default":{"platform":"PC"},"VSCode":{"platform":"PC"},"Visual Assist":{"keystrokes":[{"keys":["mod-Control","char-E"]},{"keys":["char-F"]}],"platform":"PC"},"ReSharper":{"keystrokes":[{"keys":["mod-Control","mod-Alt","mod-Shift","char-F"]}],"platform":"PC"},"Sublime Text":{"platform":"PC"},"Emacs":{"platform":"PC"},"Mnemonic Keymap":{"keystrokes":[{"keys":["mod-Control","char-R"]},{"keys":["char-G"]}],"platform":"PC"},"Default for KDE":{"platform":"PC"},"Default for GNOME":{"platform":"PC"},"Default for XWin":{"platform":"PC"},"Mac OS X 10.5+":{"platform":"MAC"},"VSCode OSX":{"platform":"MAC"},"macOS System Shortcuts":{"platform":"MAC"},"Sublime Text (Mac OS X)":{"platform":"MAC"},"Visual Studio OSX":{"keystrokes":[{"keys":["mod-Command","char-E"]},{"keys":["char-F"]}],"platform":"MAC"},"ReSharper OSX":{"keystrokes":[{"keys":["mod-Command","mod-Alt","mod-Shift","char-F"]}],"platform":"MAC"},"Visual Assist OSX":{"keystrokes":[{"keys":["mod-Command","char-E"]},{"keys":["char-F"]}],"platform":"MAC"}}}</script><link href="https://resources.jetbrains.com/writerside/apidoc/6.22.0-b799/app.css" rel="stylesheet"><link rel="manifest" href="https://www.jetbrains.com/site.webmanifest"><meta name="msapplication-TileColor" content="#000000"><link rel="apple-touch-icon" sizes="180x180" href="https://jetbrains.com/apple-touch-icon.png"><link rel="icon" type="image/png" sizes="32x32" href="https://jetbrains.com/favicon-32x32.png"><link rel="icon" type="image/png" sizes="16x16" href="https://jetbrains.com/favicon-16x16.png"><meta name="msapplication-TileImage" content="https://resources.jetbrains.com/storage/ui/favicons/mstile-144x144.png"><meta name="msapplication-square70x70logo" content="https://resources.jetbrains.com/storage/ui/favicons/mstile-70x70.png"><meta name="msapplication-square150x150logo" content="https://resources.jetbrains.com/storage/ui/favicons/mstile-150x150.png"><meta name="msapplication-wide310x150logo" content="https://resources.jetbrains.com/storage/ui/favicons/mstile-310x150.png"><meta name="msapplication-square310x310logo" content="https://resources.jetbrains.com/storage/ui/favicons/mstile-310x310.png"><meta name="image" content="https://resources.jetbrains.com/storage/products/rider/img/meta/preview.png"><!-- Open Graph --><meta property="og:title" content="Rearrange members with file and type layout patterns | JetBrains&nbsp;Rider"><meta property="og:description" content=""><meta property="og:image" content="https://resources.jetbrains.com/storage/products/rider/img/meta/preview.png"><meta property="og:site_name" content="JetBrains&nbsp;Rider Help"><meta property="og:type" content="website"><meta property="og:locale" content="en_US"><meta property="og:url" content="https://www.jetbrains.com/help/rider/File_and_Type_Layout.html"><!-- End Open Graph --><!-- Twitter Card --><meta name="twitter:card" content="summary_large_image"><meta name="twitter:site" content="@JetBrainsRider"><meta name="twitter:title" content="Rearrange members with file and type layout patterns | JetBrains&nbsp;Rider"><meta name="twitter:description" content=""><meta name="twitter:creator" content="@JetBrainsRider"><meta name="twitter:image:src" content="https://resources.jetbrains.com/storage/products/rider/img/meta/preview.png"><!-- End Twitter Card --><!-- Schema.org WebPage --><script type="application/ld+json">{
    "@context": "http://schema.org",
    "@type": "WebPage",
    "@id": "https://www.jetbrains.com/help/rider/File_and_Type_Layout.html#webpage",
    "url": "https://www.jetbrains.com/help/rider/File_and_Type_Layout.html",
    "name": "Rearrange members with file and type layout patterns | JetBrains Rider",
    "description": "",
    "image": "https://resources.jetbrains.com/storage/products/rider/img/meta/preview.png",
    "inLanguage":"en-US"
}</script><!-- End Schema.org --><!-- Schema.org WebSite --><script type="application/ld+json">{
    "@type": "WebSite",
    "@id": "https://www.jetbrains.com/help/rider/#website",
    "url": "https://www.jetbrains.com/help/rider/",
    "name": "JetBrains Rider Help"
}</script><!-- End Schema.org --><script>
    (function (w, d, s, l, i) {
        w[l] = w[l] || [];
        w[l].push({ 'gtm.start': new Date().getTime(), event: 'gtm.js' });
        var f = d.getElementsByTagName(s)[0], j = d.createElement(s), dl = l != 'dataLayer' ? '&amp;l=' + l : '';
        j.async = true;
        j.src = '//www.googletagmanager.com/gtm.js?id=' + i + dl;
        f.parentNode.insertBefore(j, f);
    })(window, document, 'script', 'dataLayer', 'GTM-5P98');
</script>
<script src="https://resources.jetbrains.com/storage/help-app/v6/analytics.js"></script>
</head><body data-id="File_and_Type_Layout" data-main-title="Rearrange members with file and type layout patterns" data-article-props="{&quot;seeAlso&quot;:[{&quot;title&quot;:&quot;Concepts&quot;,&quot;links&quot;:[{&quot;url&quot;:&quot;Code_Cleanup__Index.html&quot;,&quot;text&quot;:&quot;Code cleanup&quot;},{&quot;url&quot;:&quot;Code_Analysis__Quick-Fixes.html&quot;,&quot;text&quot;:&quot;Quick-fixes for code issues&quot;},{&quot;url&quot;:&quot;Coding_Assistance__Importing_Namespaces.html&quot;,&quot;text&quot;:&quot;Import missing namespaces&quot;}]},{&quot;title&quot;:&quot;Procedures&quot;,&quot;links&quot;:[{&quot;url&quot;:&quot;Coding_Assistance__Naming_Style.html&quot;,&quot;text&quot;:&quot;Naming style&quot;},{&quot;url&quot;:&quot;Enforcing_Code_Formatting_Rules.html&quot;,&quot;text&quot;:&quot;Apply formatting rules&quot;},{&quot;url&quot;:&quot;File_Header_Style.html&quot;,&quot;text&quot;:&quot;File header style&quot;},{&quot;url&quot;:&quot;Namespace_Imports_Style.html&quot;,&quot;text&quot;:&quot;Code Syntax Style: Namespace Imports&quot;},{&quot;url&quot;:&quot;Using_var_Keyword_in_Declarations.html&quot;,&quot;text&quot;:&quot;Code Syntax Style: Implicit/Explicit Typing (\u0027var\u0027 Keyword)&quot;},{&quot;url&quot;:&quot;Built_In_Type_Naming.html&quot;,&quot;text&quot;:&quot;Code Syntax Style: Built-In Type References&quot;},{&quot;url&quot;:&quot;Using_Auto_Properties.html&quot;,&quot;text&quot;:&quot;Use auto-properties&quot;},{&quot;url&quot;:&quot;Making_Field_Readonly.html&quot;,&quot;text&quot;:&quot;Make fields readonly&quot;},{&quot;url&quot;:&quot;Making_AutoProperties_GetOnly.html&quot;,&quot;text&quot;:&quot;Make auto-properties get-only&quot;},{&quot;url&quot;:&quot;Attributes_Style.html&quot;,&quot;text&quot;:&quot;Code Syntax Style: Multiple Attributes&quot;},{&quot;url&quot;:&quot;Modifiers_Style.html&quot;,&quot;text&quot;:&quot;Code Syntax Style: Modifiers&quot;},{&quot;url&quot;:&quot;Argument_Style.html&quot;,&quot;text&quot;:&quot;Code Syntax Style: Named/Positional Arguments&quot;},{&quot;url&quot;:&quot;Arranging_Member_Qualifiers.html&quot;,&quot;text&quot;:&quot;Code Syntax Style: Optional Member Qualifiers&quot;},{&quot;url&quot;:&quot;Trailing_Commas_Style.html&quot;,&quot;text&quot;:&quot;Code Syntax Style: Trailing Commas&quot;},{&quot;url&quot;:&quot;Default_Value_Expressions_Style.html&quot;,&quot;text&quot;:&quot;Code Syntax Style: Default Value Expressions (\u0027default\u0027 vs \u0027default(T)\u0027)&quot;},{&quot;url&quot;:&quot;Object_Creation_Style.html&quot;,&quot;text&quot;:&quot;Code Syntax Style: Object Creation (\u0027new()\u0027 vs \u0027new T()\u0027)&quot;},{&quot;url&quot;:&quot;Code_Cleanup__Usage_Scenarios__Reformatting_XML.html&quot;,&quot;text&quot;:&quot;Reformat XML Doc comments&quot;},{&quot;url&quot;:&quot;Removing_Code_Redundancies.html&quot;,&quot;text&quot;:&quot;Remove code redundancies&quot;}]},{&quot;title&quot;:&quot;External Links&quot;,&quot;links&quot;:[{&quot;url&quot;:&quot;http://blog.jetbrains.com/dotnet/2016/02/03/code-style-settings-resharper/&quot;,&quot;text&quot;:&quot;\n                    .NET Tools Blog: Code Style Settings in ReSharper\n                &quot;}]}],&quot;seeAlsoStyle&quot;:&quot;links&quot;}" data-template="article" data-breadcrumbs="Code_Style_Assistance.topic|Code style and cleanup"><div class="wrapper"><main class="panel _main"><header class="panel__header"><div class="container"><h3>JetBrains&nbsp;Rider 2025.1 Help</h3><div class="panel-trigger"></div></div></header><section class="panel__content"><div class="container"><article class="article" data-shortcut-switcher="inactive"><h1 data-toc="File_and_Type_Layout" id="File_and_Type_Layout.topic">Rearrange members with file and type layout patterns</h1><p id="adb6e1_3">JetBrains&nbsp;Rider can reorder types and type members in C# files according to different patterns. Patterns can describe a lot of conditions and constraints that are evaluated when reordering items in a file and/or wrapping them with specified regions.</p><aside class="prompt" data-type="tip" data-title="" id="adb6e1_4"><p id="adb6e1_78">Your file layout preferences are saved using the mechanism of <a href="Sharing_Configuration_Options.html" id="adb6e1_79">layer-based settings</a>. Among other things, this mechanism allows you to maintain different preferences for different solutions as well as to keep these preferences under a VCS and automatically share them with your team members.</p></aside><section class="chapter"><h2 id="introduction-to-layout-patterns" data-toc="introduction-to-layout-patterns">Introduction to layout patterns</h2><p id="adb6e1_18">You can configure multiple layout patterns to be applied in different contexts (for example, you can have different patterns for classes and interfaces). </p><p id="adb6e1_19">Within the patterns, you can specify matcher entries and snippets in the desired order, as well as regions/groups into which the matching items are wrapped/grouped.</p><p id="adb6e1_20">The algorithm of applying the current pattern set works as follows:</p><ol class="list _decimal" id="adb6e1_21" type="1"><li class="list__item" id="adb6e1_22"><p>If a file pattern exists, JetBrains&nbsp;Rider checks whether regions in the file should be removed, then it checks whether each of the matcher entries or snippets in the pattern matches any code item in the file.</p></li><li class="list__item" id="adb6e1_23"><p>If there are matching entries, their position in the file is changed according to the position of the corresponding matcher item in the file pattern.</p></li><li class="list__item" id="adb6e1_24"><p>If the same code item matches several matcher entries, then the matcher with higher priority or stronger constraints is applied. That is, if there is pattern <span class="emphasis" id="adb6e1_32">A</span> that matches public types and pattern <span class="emphasis" id="adb6e1_33">B</span> that matches public static types, then all public static types will be matched by the pattern <span class="emphasis" id="adb6e1_34">B</span>. To change this, you can raise the priority of the pattern <span class="emphasis" id="adb6e1_35">A</span>.</p></li><li class="list__item" id="adb6e1_25"><p>If there are matcher entries with the same set of constraints, the matching items are moved according to the position of the first of such matcher entries.</p></li><li class="list__item" id="adb6e1_26"><p id="adb6e1_36">If regions or groups are specified, the matched items are grouped or wrapped with the regions accordingly.</p><p id="adb6e1_37">A group or a region allows you to specify priority for it. For example, if a group/region has higher priority than other matchers outside it, then JetBrains&nbsp;Rider first processes matchers inside the group/region, and then the rest of the matchers. The only difference between group an region is that the region wraps matched items into <code class="code" id="adb6e1_38">#region</code>/<code class="code" id="adb6e1_39">#endregion</code>.</p></li><li class="list__item" id="adb6e1_27"><p>Everything that is not matched is moved after the matched items. If you need to put the unmatched items elsewhere, you can create a matcher without constraints and set the desired position for it in the pattern.</p></li><li class="list__item" id="adb6e1_28"><p>After that, type patterns are applied, if any. JetBrains&nbsp;Rider checks whether each of the type patterns matches any type in the file. If there are several matching patterns for a type, the conflicts are resolved similarly to steps&nbsp;3&nbsp;and&nbsp;4.</p></li><li class="list__item" id="adb6e1_29"><p>When the type match is established, JetBrains&nbsp;Rider checks whether regions in the type should be removed; then it checks whether each of the matcher entries in the pattern matches any member in the file.</p></li><li class="list__item" id="adb6e1_30"><p>If there are matching members, their position in the type is changed according to the position of the corresponding matcher item in the type pattern.</p></li><li class="list__item" id="adb6e1_31"><p>Regions, groups and unmatched members are dealt with similarly to steps&nbsp;5&nbsp;and&nbsp;6.</p></li></ol></section><section class="chapter"><h2 id="file-and-type-layout-preferences" data-toc="file-and-type-layout-preferences">File and type layout preferences</h2><p id="adb6e1_40">The default member layout rules are based on the numerous best practices and can be recommended in most cases. However, if your personal preferences or company standards differ from JetBrains&nbsp;Rider defaults, you can configure code reordering patterns based on the default ones as well as create new patterns for specific cases.</p><p id="adb6e1_41">All modifications to the layout patterns are done in the <span class="menupath" id="adb6e1_81">Editor | Code Style | C# | File Layout</span> page of JetBrains&nbsp;Rider settings <kbd id="adb6e1_85" data-key="ShowSettings">Ctrl+Alt+S</kbd>. After the editing is done, click <span class="control" id="adb6e1_87">Save</span> in the Settings dialog to apply the modifications and let JetBrains&nbsp;Rider choose where to save them, or save the modifications to a specific settings layer by choosing this layer from the  <span class="control" id="adb6e1_89">Save</span> selector. For more information, see <a href="Sharing_Configuration_Options.html" id="adb6e1_90">layer-based settings</a>. </p></section><section class="chapter"><h2 id="configuring-file-and-type-layout-by-editing-the-source-xaml" data-toc="configuring-file-and-type-layout-by-editing-the-source-xaml">Configure file and type layout by editing the source XAML</h2><p id="adb6e1_44">We recommend that you load one of the default patterns and check the tags used in this format. They are rather self-explanatory, for example, the <code class="code" id="adb6e1_47">Entry</code> tag defines a matcher entry and the <code class="code" id="adb6e1_48">Entry.Match</code> specifies what code items should be matched. the <code class="code" id="adb6e1_49">Entry.SortBy</code> tag specifies how the matched items should be sorted, and so on. Consider the example below:</p><figure id="adb6e1_45"><img alt="JetBrains&nbsp;Rider: Configuring file and type layout by editing the source XAML" src="https://resources.jetbrains.com/help/img/rider/2025.1/Code_Cleanup__Usage_Scenarios__Reordering_Type_Members_01.png" title="JetBrains&nbsp;Rider: Configuring file and type layout by editing the source XAML" width="333" height="130"></figure><p id="adb6e1_46">This XAML code matches constructors and sorts them in such way that first go static constructors.</p></section><section class="chapter"><h2 id="group_in_regions_by_name" data-toc="group_in_regions_by_name">Scenario: group items in regions by partial name match</h2><p id="adb6e1_50">Consider a class where all methods start with <code class="code" id="adb6e1_57">test</code>, and then some of them have one common substring, others — another one, and so on:</p><div class="code-block" data-lang="csharp">
            public void test_groupOne_nameOne(){ /*...*/}

            public void test_groupTwo_nameTwo(){ /*...*/}

            public void test_groupOne_nameTwo(){ /*...*/}

            public void test_groupTwo_nameOne(){ /*...*/}
        </div><p id="adb6e1_52">You can use type layout to wrap each set of methods in a region and use the common substrings as region names.</p><p id="adb6e1_53">To do so, add the following pattern to the XAML:</p><div class="code-block" data-lang="markup">

  &lt;TypePattern&gt;
    &lt;Region Name="${Name}" Priority="100"&gt;
      &lt;Region.GroupBy&gt;
        &lt;Name Is="(test\w+?)_.*" /&gt;
      &lt;/Region.GroupBy&gt;

      &lt;Entry&gt;
        &lt;Entry.Match&gt;
          &lt;Name Is="test\w+?_.*" /&gt;
        &lt;/Entry.Match&gt;
      &lt;/Entry&gt;
    &lt;/Region&gt;
  &lt;/TypePattern&gt;

        </div><p id="adb6e1_55">After <a href="#reordering-file-and-type-members" id="adb6e1_58">applying the layout</a> to the class, the methods will be sorted and wrapped in the corresponding regions:</p><div class="code-block" data-lang="csharp">
    #region test_groupOne

    public void test_groupOne_nameOne(){ /*...*/ }

    public void test_groupOne_nameTwo(){ /*...*/ }

    #endregion

    #region test_groupTwo

    public void test_groupTwo_nameOne(){ /*...*/ }

    public void test_groupTwo_nameTwo(){ /*...*/ }

    #endregion
        </div></section><section class="chapter"><h2 id="reordering-file-and-type-members" data-toc="reordering-file-and-type-members">Reorder file and type members</h2><p id="adb6e1_59">To apply your file and type layout settings in the desired scope, use either <a href="Code_Cleanup__Index.html#running" id="adb6e1_94">run code cleanup</a> with  the <span class="emphasis" id="adb6e1_98">Built-in: Full Cleanup</span> profile  or create and run <a href="Code_Cleanup__Index.html#custom_profile" id="adb6e1_97">a custom profile</a> solely targeted at your specific task as described below.</p><section class="procedure-steps"><h3 id="adb6e1_73" data-toc="adb6e1_73">Apply file and type layout with custom Code Cleanup profile</h3><ol class="list _decimal"><li class="list__item" id="adb6e1_107"><p> Press <kbd id="adb6e1_124" data-key="ShowSettings">Ctrl+Alt+S</kbd> or choose <span class="menupath" id="adb6e1_125">File | Settings</span> (Windows and Linux) or <span class="menupath" id="adb6e1_126">JetBrains&nbsp;Rider | Preferences</span> (macOS) from the menu .</p></li><li class="list__item" id="adb6e1_109"><p>Go to the cleanup profiles settings page:  <span class="menupath" id="adb6e1_127">Editor | Code Cleanup</span>.</p></li><li class="list__item" id="create-a-new-profile-as-describe"><p>Create a new profile as described in the <a href="Code_Cleanup__Index.html#custom_profile" id="adb6e1_128">Create a new custom cleanup profile</a> section. In the <span class="control" id="adb6e1_129">Selected profile settings</span> section for the new profile, tick the <span class="control" id="adb6e1_130">Apply file layout</span> checkbox. Optionally, you can enable other code cleanup tasks in this profile.</p></li><li class="list__item" id="adb6e1_113"><p> Click  <span class="control" id="adb6e1_133">Save</span> in the Settings dialog to apply the modifications and let JetBrains&nbsp;Rider choose where to save them, or save the modifications to a specific settings layer by choosing this layer from the  <span class="control" id="adb6e1_135">Save</span> selector. For more information, see <a href="Sharing_Configuration_Options.html" id="adb6e1_136">layer-based settings</a>. </p></li><li class="list__item" id="adb6e1_115"><p id="adb6e1_137">Select the scope where you want to apply file layout:</p><ul class="list _bullet" id="adb6e1_138"><li class="list__item" id="adb6e1_139"><p>Place the caret anywhere in the file to apply file layout to the file.</p></li><li class="list__item" id="adb6e1_140"><p>Select one or more items in the <span class="control" id="adb6e1_141">Solution Explorer</span> to apply file layout in the files under these nodes and their child items.</p></li></ul></li><li class="list__item" id="adb6e1_120"><p>Press <kbd id="adb6e1_146" data-key="CodeCleanup">Ctrl+R, C</kbd> or choose <span class="menupath" id="adb6e1_149">Code | Reformat and Cleanup…</span> from the main menu. </p></li><li class="list__item" id="adb6e1_117"><p>In the Reformat and Cleanup Code dialog that opens, select the newly created profile  and choose another scope if needed. .</p></li><li class="list__item" id="adb6e1_118"><p>Click  <span class="control" id="adb6e1_151">OK</span>. JetBrains&nbsp;Rider will apply file layout in the selected scope.</p></li></ol></section><p id="adb6e1_75">If you want to apply file layout without opening the Reformat and Cleanup Code dialog to choose a profile, you can bind the  created  profile to the <a href="Code_Cleanup__Index.html#silent_mode" id="adb6e1_154">silent cleanup</a> and run it by pressing  <kbd id="adb6e1_155" data-key="SilentCodeCleanup">Ctrl+R, G</kbd>. You can also create a <a href="Code_Cleanup__Index.html#custom_profile" id="adb6e1_156">custom cleanup profile</a> that would combine applying file layout with other code style tasks.</p></section><section class="chapter"><h2 id="disable-member-reordering-in-specific-types" data-toc="disable-member-reordering-in-specific-types">Disable member reordering in specific types</h2><p id="adb6e1_68">If you want to reorder members during the cleanup, but you want to preserve the original member order in specific types, mark these types with the <a href="Reference__Code_Annotation_Attributes.html#NoReorderAttribute" id="adb6e1_69">[NoReorder]</a> attribute from <a href="Code_Analysis__Code_Annotations.html" id="adb6e1_70">JetBrains.Annotations</a>.</p></section><div class="last-modified">26 May 2024</div><div data-feedback-placeholder="true"></div><div class="navigation-links _bottom"><a href="File_Header_Style.html" class="navigation-links__prev">File header style</a><a href="Removing_Code_Redundancies.html" class="navigation-links__next">Remove code redundancies</a></div></article><div id="disqus_thread"></div></div></section></main></div><script src="https://resources.jetbrains.com/writerside/apidoc/6.22.0-b799/app.js"></script></body></html>