postsharp / Metalama

Metalama is a Roslyn-based meta-programming framework. Use this repo to report bugs or ask questions.
164 stars 4 forks source link

Introducing the first attribute places attribute above code comments #214

Closed jon-armen closed 9 months ago

jon-armen commented 10 months ago

When introducing a new attribute, if no other attributes exist on a target, the new attribute is introduced above the code comments. This causes issues with CS1587 as the output file now has attributes above code comments. New attributes should be introduced below the code comments.

        /// <summary>
        /// Test class for creating aspects.
        /// </summary>
        [InjectAttributeAspect]
        private class TestTarget
        {
[InjectedAttribute]

            /// <summary>
            /// Gets or sets a test property value.
            /// </summary>
            public static object? TestProperty { get; set; }
[InjectedAttribute]

            /// <summary>
            /// A test method.
            /// </summary>
            public static void TestMethod()
            {
            }
        }
PostSharpBot commented 10 months ago

Hello @jon-armen, thank you for submitting this issue. We will try to get back to you as soon as possible. Note to the PostSharp team, this ticket is being tracked in our dashboard under ID TP-33720.

svick commented 10 months ago

Thanks for reporting. I will work on fixing this.

gfraiteur commented 9 months ago

Solved in 2023.3.5-rc.