Bug Report T728540
Visible to All Users

Formatting – The "Add whitespace before closing /> for empty elements" option has no effect in XAML

created 6 years ago

The XAML Formatting option "Add whitespace before closing /> for empty elements" is not respected. It appears whitespace is always removed when formatting via CodeRush.

Show previous comments (2)
DevExpress Support Team 6 years ago

    Hello Adam,

    Thank you for providing this information and the screencast.

    I created a clean machine with Visual Studio 2019 and CodeRush 18.2.9.
    After that, I imported both of your common and solution CodeRush settings.
    Finally, I created a similar project as the one shown in your screencast and Format Document works as expected for me.
    Here is a screencast that illustrates my attempts: https://monosnap.com/file/grINcg2HLCl2MR0KD6qVWY6bblmq8v

    Perhaps, the issue is related to your environment settings.
    To help us research this further, please provide the following information:
    - your Visual Studio settings (use the "Tools -> Import and Export Settings…" menu item for exporting them);
    - information about extensions you installed (click the Copy Info button in the Help -> About Microsoft Visual Studio dialog).

    Your cooperation is appreciated.

      I regret it is such a hassle to repro. I disabled all my extensions except CodeRush and I still have the issue (Whitespace is removed, disregarding the CodeRush XAML Formatting setting). Attached are the details you requested along with our editorconfig file in case that is related.

      DevExpress Support Team 6 years ago

        Thank you for sharing your Visual Studio settings with us.
        I have reproduced the issue with them.

        After further research, we found that the issue is related to the "Keep tabs" option selected on the "Text Editor \ XAML \ Tabs" options page.
        As a workaround, you can change it to "Insert spaces" on your machine.

        We will continue analyzing this issue and let you know when we have any results.

        Answers approved by DevExpress Support

        created 6 years ago (modified 6 years ago)

        We have fixed the issue described in this ticket and will include the fix in our next maintenance update. To apply this solution before the official update, request a hotfix by clicking the corresponding link for product versions you require.

        Note: Hotfixes may be unavailable for beta versions and updates that are about to be released.

          Comments (2)

            Thank you

            DevExpress Support Team 6 years ago

              You are always welcome!

              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.