Custom region handling via Layout

In ReSharper 8 we used to be able to have custom regions as well as regions created via the layout file. A while back we upgraded to v9 and due to some bugs regions were all moved to the end of the class. I've reported the issue but had to downgrade eventually as regions moved to the end didn't suit the way we worked and having a file change due to formatting made source comparison unnecessary harder. We recently upgraded to 2016.3 and it seems the region handling is even worse than v9.

Right now it seems the only way to preserve custom regions are to NOT automatically create regions via the layout file and of course all custom regions are STILL moved to the end of the class. Although annoying, we'll forego regions via layout if we can only get our custom regions moved to the top.

I'm actually really hoping we're missing something but I couldn't find any obvious means to select where custom regions should be placed.

Are we missing something or has region handling indeed become crippled after v8?

Comment actions Permalink
Official comment

There are two theoretical choices: either move all unmatched entries (and the whole region is treated as a single entty) to the bottom, or to the top. Right now we are moving them to the bottom. One could also introduce an entity which would specify where to custom regions should be put inside class. But such entity exited neither in V8 nor does it exist now. I am wondering now why the behavior of could have changed. I will investigate it shortly.

There is a corresponding issue: Feel free to follow and vote.

Comment actions Permalink

Thanks for that Eugene,

Unfortunately the youtrack link returns a "You have no permissions to view this page" for multiple people.

Also, how would you go about defining an "unmatched" entity?

Comment actions Permalink


"One could also introduce an entity which would specify where to custom regions should be put inside class"

How soon could a feature like this be made available?




Comment actions Permalink

Hello JetBrains,

Any update on how NOT to move our custom regions to the bottom of the file?


Please sign in to leave a comment.