Bug Report T1015384
Visible to All Users

Formatting - An attribute is indented incorrectly

created 4 years ago (modified 4 years ago)

Been using CR for a while now, and have it set up good for formatting the code, I work with a lot of legacy code and often format them as most of them are really a mess to look at. I have noticed this small formatting issue

Create a C# Class with the following:

C#
namespace MyNameSpace { [Serializable()] public class BaseEntity { [field: NonSerialized] public event EventHandler ValueChanged; [XmlIgnore] public virtual bool MonitorDirty { get; set; } protected virtual void OnValueChanged() => ValueChanged?.Invoke(this, new EventArgs()); } }

Now, when I do a code cleanup I get the following:

C#
namespace MyNameSpace { [Serializable()] public class BaseEntity { [field: NonSerialized] // <<-- THIS SHOULD NOT BE LEFT ALIGNED WITH NAMESPACE public event EventHandler ValueChanged; [XmlIgnore] public virtual bool MonitorDirty { get; set; } protected virtual void OnValueChanged() => ValueChanged?.Invoke(this, new EventArgs()); } }

Basically after formatting / cleaning the attribute with the work "field: " in it if left aligned with the namespace, when it should remain above the "public" word just like the XmlIgnore attribute. Is it a bug or am I missing a setting for this?

Cheers.

Comments (3)
DevExpress Support Team 4 years ago

    Hello,
    Thank you for bringing our attention to this issue. We reproduced it and will fix it soon.

    AM AM
    Alan Middleton 4 years ago

      WOW, that was quick, Great work. Thanks. :)

      DevExpress Support Team 4 years ago

        You are welcome. We will notify you once a fix is ready.

        Answers approved by DevExpress Support

        created 4 years ago

        We have addressed the issue described in this ticket and will include a fix in our next maintenance update. Should you need to apply our fix prior to official release, you can request a hotfix here.

        Note: Hotfixes may be unavailable for betas/updates set for release within a week.

          Comments (2)
          AM AM
          Alan Middleton 4 years ago

            Excellent work, thanks guys. I'll wait for the next update. No rush for the HF. ;)

            DevExpress Support Team 4 years ago

              You are always welcome. Please let us know if you need further assistance.

              Disclaimer: The information provided on DevExpress.com and affiliated web properties (including the DevExpress Support Center) is provided "as is" without warranty of any kind. Developer Express Inc disclaims all warranties, either express or implied, including the warranties of merchantability and fitness for a particular purpose. Please refer to the DevExpress.com Website Terms of Use for more information in this regard.

              Confidential Information: Developer Express Inc does not wish to receive, will not act to procure, nor will it solicit, confidential or proprietary materials and information from you through the DevExpress Support Center or its web properties. Any and all materials or information divulged during chats, email communications, online discussions, Support Center tickets, or made available to Developer Express Inc in any manner will be deemed NOT to be confidential by Developer Express Inc. Please refer to the DevExpress.com Website Terms of Use for more information in this regard.