Quantcast
Channel: YouTrackReSharper (RSRP) - Bug and Issue Tracker
Viewing all articles
Browse latest Browse all 106942

RSRP-288332: C# Advanced Naming Rules are ordered wrong

$
0
0
Reporter Torsten Preuß (TorstenP) Torsten Preuß (TorstenP)
Created Feb 15, 2012 8:52:33 PM
Updated Feb 15, 2012 8:55:44 PM
Priority Normal
Type Bug
Fix versions No Fix versions
State Submitted
Assignee Sergey Shkredov (serjic.shkredov)
Subsystem Naming
Affected versions 6.1, 6.1.1
Fixed in build No Fixed in build
We're using advanced naming rules. (C# -> Naming Style -> Advanced Settings)
1. These rules cannot be reordered. Move up or down is not working!

2. If you Export/Import these settings (Manage -> Export/Import) then these rules get reordered. That is resulting in wrong warnings in the code-editor, because wrong rules are used first.
I opended the .DotSettings-File and searched for the rules. I found them and I think I found the problem. It looks like the rules are ordered by there unique ID. I then exchanged the ID's of the rules and now the rules are ordered correct.
Here is an example of my rules with the ID's in correct order:

    <s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/UserRules/=0b828848_002Dee4b_002D4aa9_002D97f0_002D6681636c75de/@EntryIndexedValue">&lt;Policy&gt;&lt;Descriptor Staticness="Static, Instance" AccessRightKinds="Private, Protected, ProtectedInternal, Internal, Public" Description="interfaces"&gt;&lt;ElementKinds&gt;&lt;Kind Name="INTERFACE" /&gt;&lt;/ElementKinds&gt;&lt;/Descriptor&gt;&lt;Policy Inspect="True" Prefix="I" Suffix="" Style="AaBb" /&gt;&lt;/Policy&gt;</s:String>
    <s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/UserRules/=8a1ba912_002D5a66_002D4b0b_002Daa86_002Dcae7b9ba95fd/@EntryIndexedValue">&lt;Policy&gt;&lt;Descriptor Staticness="Static, Instance" AccessRightKinds="Private, Protected, ProtectedInternal, Internal, Public" Description="type parameters"&gt;&lt;ElementKinds&gt;&lt;Kind Name="TYPE_PARAMETER" /&gt;&lt;/ElementKinds&gt;&lt;/Descriptor&gt;&lt;Policy Inspect="True" Prefix="T" Suffix="" Style="AaBb" /&gt;&lt;/Policy&gt;</s:String>
    <s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/UserRules/=a76382bb_002D6209_002D4bc6_002D897a_002D5d3be5ff1a59/@EntryIndexedValue">&lt;Policy&gt;&lt;Descriptor Staticness="Instance" AccessRightKinds="No" Description="local variables/constants/parameters"&gt;&lt;ElementKinds&gt;&lt;Kind Name="LOCAL_VARIABLE" /&gt;&lt;Kind Name="LOCAL_CONSTANT" /&gt;&lt;Kind Name="PARAMETER" /&gt;&lt;/ElementKinds&gt;&lt;/Descriptor&gt;&lt;Policy Inspect="True" Prefix="" Suffix="" Style="aaBb" /&gt;&lt;/Policy&gt;</s:String>
    <s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/UserRules/=bf9b0462_002D4e79_002D4661_002Dbdcb_002D6ce765ef4121/@EntryIndexedValue">&lt;Policy&gt;&lt;Descriptor Staticness="Static, Instance" AccessRightKinds="Private, Protected, ProtectedInternal, Internal" Description="not public fields (constant)"&gt;&lt;ElementKinds&gt;&lt;Kind Name="FIELD" /&gt;&lt;Kind Name="CONSTANT_FIELD" /&gt;&lt;/ElementKinds&gt;&lt;/Descriptor&gt;&lt;Policy Inspect="True" Prefix="_" Suffix="" Style="aaBb" /&gt;&lt;/Policy&gt;</s:String>
    <s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/UserRules/=c933ba32_002D4871_002D465a_002D8d03_002D7e200a943b51/@EntryIndexedValue">&lt;Policy&gt;&lt;Descriptor Staticness="Static, Instance" AccessRightKinds="Public" Description="public fields"&gt;&lt;ElementKinds&gt;&lt;Kind Name="FIELD" /&gt;&lt;/ElementKinds&gt;&lt;/Descriptor&gt;&lt;Policy Inspect="True" Prefix="BAD_" Suffix="" Style="AaBb" /&gt;&lt;/Policy&gt;</s:String>
    <s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/UserRules/=f1e5221a_002D8216_002D467b_002D9e2b_002D5325c1dbd075/@EntryIndexedValue">&lt;Policy&gt;&lt;Descriptor Staticness="Static, Instance" AccessRightKinds="Private, Protected, ProtectedInternal, Internal, Public" Description="all other entries"&gt;&lt;ElementKinds&gt;&lt;Kind Name="LAMBDA_PARAMETER" /&gt;&lt;Kind Name="ASYNC_METHOD" /&gt;&lt;Kind Name="FIELD" /&gt;&lt;Kind Name="READONLY_FIELD" /&gt;&lt;Kind Name="CONSTANT_FIELD" /&gt;&lt;Kind Name="ENUM_MEMBER" /&gt;&lt;Kind Name="LOCAL_VARIABLE" /&gt;&lt;Kind Name="LOCAL_CONSTANT" /&gt;&lt;Kind Name="CLASS" /&gt;&lt;Kind Name="INTERFACE" /&gt;&lt;Kind Name="DELEGATE" /&gt;&lt;Kind Name="ENUM" /&gt;&lt;Kind Name="NAMESPACE" /&gt;&lt;Kind Name="METHOD" /&gt;&lt;Kind Name="PROPERTY" /&gt;&lt;Kind Name="EVENT" /&gt;&lt;Kind Name="PARAMETER" /&gt;&lt;Kind Name="LABEL" /&gt;&lt;Kind Name="TYPE_PARAMETER" /&gt;&lt;Kind Name="TEST_TYPE" /&gt;&lt;Kind Name="TEST_MEMBER" /&gt;&lt;/ElementKinds&gt;&lt;/Descriptor&gt;&lt;Policy Inspect="True" Prefix="" Suffix="" Style="AaBb" /&gt;&lt;/Policy&gt;</s:String>

As you can see, the rules are ordered by there ID.

This is just a workaround. The solution would be an index for every rule.

I hope I could help.

Viewing all articles
Browse latest Browse all 106942

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>