First time use, found a quirk with comments

I've heard tons about resharper and want to explore it.

Reorder type members doesn't like comments for #region tags.  I'm not sure how common or "correct" it is to comment #regions, inside or outside.  Is this by design?

        static void Main(string[] args)
        {
        }

        // Comment for foo
        #region foo
        #endregion

        // Comment for bar
        private int bar;

Turns into

        // Comment for foo

        // Comment for bar
        private int bar;

        static void Main(string[] args)
        {
        }

        #region foo
        #endregion

2 comments
Comment actions Permalink

Hello Harold
     ReSharper doesn't consider comments which are outside of the region as related to that region. In order to avoid this behavior you can move comments inside the region. Thank you!

Andrey Serebryansky

Support Engineer

JetBrains, Inc

http://www.jetbrains.com

"Develop with pleasure!"

0
Comment actions Permalink

Sounds reasonable.  I has just figured that it related comments to some line immediately following it.  Just like the comment for the int moved with the int.  A comment followed by something that's active without a break seems like it would contextually belong to it, whether it be a function dec, #ifdef, class name, etc.

Thank you for your reply.

0

Please sign in to leave a comment.