Customizing formatting of preprocessor directives, #region specifically

Hi,

First time poster.

I'm not sure if I'm looking in the wrong place but I've searched for this a variety of ways and in a variety of places and haven't been able to find it.

I'm using Resharper 6, most recent version. I'm working in C#.

The problem I'm having is that I'd like my #region directives to be formatted in the following way (#region and #endregion are at left margin):

#region Event notifiers

        internal void OnLoggedIn()

        {

            if (LoggedInEventHandler != null)

                LoggedInEventHandler(this, EventArgs.Empty);

        }

        internal void OnLogout()

        {

            if (LoggedOutEventHandler != null)

                LoggedOutEventHandler(this, EventArgs.Empty);

        }

#endregion

whereas the default formatting (#region and #endregion are indented) is:

        #region Event notifiers

        internal void OnLoggedIn()

        {

            if (LoggedInEventHandler != null)

                LoggedInEventHandler(this, EventArgs.Empty);

        }

        internal void OnLogout()

        {

            if (LoggedOutEventHandler != null)

                LoggedOutEventHandler(this, EventArgs.Empty);

        }

        #endregion

Is there an option within Resharper to change the formatting of #region specifically? Where is it (if I could find it I could probably figure out how to change it)?

Thanks for any help.

-D

2 comments

Hello Doug,

At the moment there's no option to get that kind of formatting. You're welcome
to put a feature request at http://youtrack.jetbrains.net/issues/RSRP. Thank
you!

Andrey Serebryansky
Senior Support Engineer
JetBrains, Inc
http://www.jetbrains.com
"Develop with pleasure!"

Hi,

First time poster.

I'm not sure if I'm looking in the wrong place but I've searched for
this a variety of ways and in a variety of places and haven't been
able to find it.

I'm using Resharper 6, most recent version. I'm working in C#.

The problem I'm having is that I'd like my #region directives to be
formatted in the following way (#region and #endregion are at left
margin):

#region Event notifiers

internal void OnLoggedIn()
{
if (LoggedInEventHandler != null)
LoggedInEventHandler(this, EventArgs.Empty);
}
internal void OnLogout()
{
if (LoggedOutEventHandler != null)
LoggedOutEventHandler(this, EventArgs.Empty);
}
#endregion

whereas the default formatting (#region and #endregion are indented)
is:

  •        #region Event notifiers*


internal void OnLoggedIn()
{
if (LoggedInEventHandler != null)
LoggedInEventHandler(this, EventArgs.Empty);
}
internal void OnLogout()
{
if (LoggedOutEventHandler != null)
LoggedOutEventHandler(this, EventArgs.Empty);
}

  •        #endregion*


Is there an option within Resharper to change the formatting of
#region specifically? Where is it (if I could find it I could probably
figure out how to change it)?

Thanks for any help.

-D

---
Original message URL:
http://devnet.jetbrains.net/message/5319293#5319293



0

I'm actually having the opposite problem.  Before I upgraded to 6.0, my #region directives would be inline with my code.  Now the are always going to the left margin.

Is there no way for me to change this back?

Thanks,
Matt

0

Please sign in to leave a comment.