How to define File Layout for classes inheriting from a specific base class?

I would like to create a specific C# Resharper File Layout for classes that inherit from a certain base class, but I can't seem to figure out how.

I am a Unity3D developer and the base class for components in Unity3D is called "Monobehaviour". Inheriting from this class allows developers to use a few dozen magic methods which are then automatically executed when appropriate. I have created a File Layout with a region containing all names of these methods in an OR-Group. This works just fine, but it also works when any of the magic method names is used in a class that does not derive from the Monobehaviour base class. 

My idea was to duplicate the Default Pattern and give that duplicate it a constraint that requires the class to inherit from this base class somewhere in its inheritance chain. The problem is that the available constraints do not offer any inheritance checks. The closest thing is "Implements Interface" and I don't want to add an empty interface to each of my components just to get this to work.

Am I missing something or is an inheritance check simply not possible?

Any help is highly appreciated.

Thanks in advance,

Patrick

 

0
1 comment
Official comment

Hello Patrick,

Unfortunately, it is not possible right now. I've filed a new feature request on YouTrack https://youtrack.jetbrains.com/issue/RSRP-470724. Feel free to follow and comment on it.

Thanks! 

Please sign in to leave a comment.