Created
January 15, 2024 14:53
-
-
Save deMD/4f2c9bb3404abac806b2951d269d0946 to your computer and use it in GitHub Desktop.
Rider C# File Layout Template with layout for public, internal and private methods. Also makes sure the CreateNull method is always directly below constructor for findability
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<Patterns xmlns="urn:schemas-jetbrains-com:member-reordering-patterns"> | |
<TypePattern DisplayName="Non-reorderable types"> | |
<TypePattern.Match> | |
<Or> | |
<And> | |
<Kind Is="Interface" /> | |
<Or> | |
<HasAttribute Name="System.Runtime.InteropServices.InterfaceTypeAttribute" /> | |
<HasAttribute Name="System.Runtime.InteropServices.ComImport" /> | |
</Or> | |
</And> | |
<Kind Is="Struct" /> | |
<HasAttribute Name="JetBrains.Annotations.NoReorderAttribute" /> | |
<HasAttribute Name="JetBrains.Annotations.NoReorder" /> | |
</Or> | |
</TypePattern.Match> | |
</TypePattern> | |
<TypePattern DisplayName="xUnit.net Test Classes" RemoveRegions="All"> | |
<TypePattern.Match> | |
<And> | |
<Kind Is="Class" /> | |
<HasMember> | |
<And> | |
<Kind Is="Method" /> | |
<HasAttribute Name="Xunit.FactAttribute" Inherited="True" /> | |
<HasAttribute Name="Xunit.TheoryAttribute" Inherited="True" /> | |
</And> | |
</HasMember> | |
</And> | |
</TypePattern.Match> | |
<Entry DisplayName="Fields"> | |
<Entry.Match> | |
<And> | |
<Kind Is="Field" /> | |
<Not> | |
<Static /> | |
</Not> | |
</And> | |
</Entry.Match> | |
<Entry.SortBy> | |
<Readonly /> | |
<Name /> | |
</Entry.SortBy> | |
</Entry> | |
<Entry DisplayName="Constructors"> | |
<Entry.Match> | |
<Kind Is="Constructor" /> | |
</Entry.Match> | |
<Entry.SortBy> | |
<Static/> | |
</Entry.SortBy> | |
</Entry> | |
<Entry DisplayName="Teardown Methods"> | |
<Entry.Match> | |
<And> | |
<Kind Is="Method" /> | |
<ImplementsInterface Name="System.IDisposable" /> | |
</And> | |
</Entry.Match> | |
</Entry> | |
<Entry DisplayName="All other members" /> | |
<Entry DisplayName="Test Methods" Priority="100"> | |
<Entry.Match> | |
<And> | |
<Kind Is="Method" /> | |
<HasAttribute Name="Xunit.FactAttribute" Inherited="false" /> | |
<HasAttribute Name="Xunit.TheoryAttribute" Inherited="false" /> | |
</And> | |
</Entry.Match> | |
<Entry.SortBy> | |
<Name /> | |
</Entry.SortBy> | |
</Entry> | |
</TypePattern> | |
<TypePattern DisplayName="NUnit Test Fixtures" RemoveRegions="All"> | |
<TypePattern.Match> | |
<And> | |
<Kind Is="Class" /> | |
<Or> | |
<HasAttribute Name="NUnit.Framework.TestFixtureAttribute" Inherited="true" /> | |
<HasAttribute Name="NUnit.Framework.TestFixtureSourceAttribute" Inherited="true" /> | |
<HasMember> | |
<And> | |
<Kind Is="Method" /> | |
<HasAttribute Name="NUnit.Framework.TestAttribute" Inherited="false" /> | |
<HasAttribute Name="NUnit.Framework.TestCaseAttribute" Inherited="false" /> | |
<HasAttribute Name="NUnit.Framework.TestCaseSourceAttribute" Inherited="false" /> | |
</And> | |
</HasMember> | |
</Or> | |
</And> | |
</TypePattern.Match> | |
<Entry DisplayName="Setup/Teardown Methods"> | |
<Entry.Match> | |
<And> | |
<Kind Is="Method" /> | |
<Or> | |
<HasAttribute Name="NUnit.Framework.SetUpAttribute" Inherited="true" /> | |
<HasAttribute Name="NUnit.Framework.TearDownAttribute" Inherited="true" /> | |
<HasAttribute Name="NUnit.Framework.TestFixtureSetUpAttribute" Inherited="true" /> | |
<HasAttribute Name="NUnit.Framework.TestFixtureTearDownAttribute" Inherited="true" /> | |
<HasAttribute Name="NUnit.Framework.OneTimeSetUpAttribute" Inherited="true" /> | |
<HasAttribute Name="NUnit.Framework.OneTimeTearDownAttribute" Inherited="true" /> | |
</Or> | |
</And> | |
</Entry.Match> | |
</Entry> | |
<Entry DisplayName="All other members" /> | |
<Entry DisplayName="Test Methods" Priority="100"> | |
<Entry.Match> | |
<And> | |
<Kind Is="Method" /> | |
<HasAttribute Name="NUnit.Framework.TestAttribute" Inherited="false" /> | |
<HasAttribute Name="NUnit.Framework.TestCaseAttribute" Inherited="false" /> | |
<HasAttribute Name="NUnit.Framework.TestCaseSourceAttribute" Inherited="false" /> | |
</And> | |
</Entry.Match> | |
<Entry.SortBy> | |
<Name /> | |
</Entry.SortBy> | |
</Entry> | |
</TypePattern> | |
<TypePattern DisplayName="Default Pattern"> | |
<Entry DisplayName="Public Delegates" Priority="100"> | |
<Entry.Match> | |
<And> | |
<Access Is="Public" /> | |
<Kind Is="Delegate" /> | |
</And> | |
</Entry.Match> | |
<Entry.SortBy> | |
<Name /> | |
</Entry.SortBy> | |
</Entry> | |
<Entry DisplayName="Public Enums" Priority="100"> | |
<Entry.Match> | |
<And> | |
<Access Is="Public" /> | |
<Kind Is="Enum" /> | |
</And> | |
</Entry.Match> | |
<Entry.SortBy> | |
<Name /> | |
</Entry.SortBy> | |
</Entry> | |
<Entry DisplayName="Static Fields and Constants"> | |
<Entry.Match> | |
<Or> | |
<Kind Is="Constant" /> | |
<And> | |
<Kind Is="Field" /> | |
<Static /> | |
</And> | |
</Or> | |
</Entry.Match> | |
<Entry.SortBy> | |
<Kind> | |
<Kind.Order> | |
<DeclarationKind>Constant</DeclarationKind> | |
<DeclarationKind>Field</DeclarationKind> | |
</Kind.Order> | |
</Kind> | |
</Entry.SortBy> | |
</Entry> | |
<Entry DisplayName="Fields"> | |
<Entry.Match> | |
<And> | |
<Kind Is="Field" /> | |
<Not> | |
<Static /> | |
</Not> | |
</And> | |
</Entry.Match> | |
<Entry.SortBy> | |
<Readonly /> | |
<Name /> | |
</Entry.SortBy> | |
</Entry> | |
<Entry DisplayName="Constructors"> | |
<Entry.Match> | |
<Kind Is="Constructor" /> | |
</Entry.Match> | |
<Entry.SortBy> | |
<Static/> | |
</Entry.SortBy> | |
</Entry> | |
<Entry DisplayName="Properties, Indexers"> | |
<Entry.Match> | |
<Or> | |
<Kind Is="Property" /> | |
<Kind Is="Indexer" /> | |
</Or> | |
</Entry.Match> | |
</Entry> | |
<Entry DisplayName="Nullable Implementations" Priority="100"> | |
<Entry.Match> | |
<And> | |
<Kind Is="Method" /> | |
<Access Is="Public" /> | |
<Static /> | |
<Name Is="CreateNull" /> | |
</And> | |
</Entry.Match> | |
<Entry.SortBy> | |
<ImplementsInterface Immediate="true" /> | |
</Entry.SortBy> | |
</Entry> | |
<Entry DisplayName="Interface Implementations" Priority="100"> | |
<Entry.Match> | |
<And> | |
<Kind Is="Member" /> | |
<ImplementsInterface /> | |
</And> | |
</Entry.Match> | |
<Entry.SortBy> | |
<ImplementsInterface Immediate="true" /> | |
</Entry.SortBy> | |
</Entry> | |
<Entry DisplayName="Public Methods" Priority="100"> | |
<Entry.Match> | |
<And> | |
<Kind Is="Method" /> | |
<Access Is="Public" /> | |
</And> | |
</Entry.Match> | |
<Entry.SortBy> | |
<Name /> | |
</Entry.SortBy> | |
</Entry> | |
<Entry DisplayName="Internal Methods" Priority="100"> | |
<Entry.Match> | |
<And> | |
<Kind Is="Method" /> | |
<Access Is="Internal" /> | |
</And> | |
</Entry.Match> | |
<Entry.SortBy> | |
<Name /> | |
</Entry.SortBy> | |
</Entry> | |
<Entry DisplayName="Private Methods" Priority="100"> | |
<Entry.Match> | |
<And> | |
<Kind Is="Method" /> | |
<Access Is="Private" /> | |
</And> | |
</Entry.Match> | |
<Entry.SortBy> | |
<Name /> | |
</Entry.SortBy> | |
</Entry> | |
<Entry DisplayName="All other members" /> | |
<Entry DisplayName="Nested Types"> | |
<Entry.Match> | |
<Kind Is="Type" /> | |
</Entry.Match> | |
</Entry> | |
</TypePattern> | |
</Patterns> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment