How to sort functions with no special attributes first?
I am trying to get my methods sorted in a particular way and can't seem to figure out how to do so.
I would like to have them be first grouped by accessibility, and then by abstract/virtual/override with the first ones being the functions that have no special attribute. It would look like this:
public void OrindaryFunc() { }//Nothing special, so it goes first.
public abstract void AbstractFunc();//Then abstract functions.
public virtual void VirtualFunc() { }//Then virtual functions.
public virtual override void OverridenFunc() { }//Finally overriden functions.
No matter what I try, I get this instead:
public abstract void AbstractFunc();
public virtual void VirtualFunc() { }
public virtual override void OverridenFunc() { }
public void OrindaryFunc() { }//This always ends up last, when I want it to be first.
The problem is that you can only tell it to sort by something (abstract/virtual/override). There is no way to tell it to put the functions with no special attributes on top. It would be the equivalent of saying sort by <Nothing/>, if there were such a thing.
Can anyone suggest a way to do this? Any help is much appreciated.
<Entry> <Match> <And> <Kind Is="method"/>
<Access Is="public"/> <Not> <Static/> </Not> <Not> <HandlesEvent /> </Not> <Not> <Kind Is="destructor"/> </Not> </And> </Match> <Sort> <Abstract/> <Virtual/> <Override/> <Name/> </Sort> <Group Region="Instance Methods"/> </Entry>
Please sign in to leave a comment.
Bump?
I see 2 possible solutions:
1) Create separate match entry for methods without attributes, and with. For example:
.......
2) Create single entry, but sort them by attributes in descending order (so, method without attribute goes first)
Thanks for the help.
I really would like to use #2, however when I try it, this line:
<Sort Descending="true">
Gives me the error:
The 'Descending' attribute is not declared.
Is there another way to specify the sort order?
Thanks.
Oops, I was wrong, sorry.
Use the following:
<Sort>
<Abstract Descending="true"/>
</Sort>
Or
<Sort>
<Abstract Ascending="false"/>
</Sort>
both variants are the same
Neither of those has any effect. Regardless of which I use, I get this:
For now, there are no multiple matches in a single gerion :(
For now, there are no multiple matches in a single gerion :(
Ok, well it looks like this functionality is not supported at the time.
May I suggest it as a feature request for a future update? I imagine it would be something along the lines of a <None/> element where you are specifying that a function has no special attributes.
Thanks for the help.
Sure. Here it is:
http://youtrack.jetbrains.net/issue/RSRP-275420
Thanks! I look forward to it in a future release.