Bug Report T754408
Visible to All Users

Code Cleanup – The "Apply Code Cleanup when saving a document" option should ignore designer generated files

created 6 years ago

[DevExpress Support Team: CLONED FROM T751377: Exclude file from code cleanup]
Hey Andrew,
We have the same problems and would like such a feature as well because if there are changes in a WinForm, the designer file gets formatted as well. To clarify, i don't make the changes in the designer file myself, it's just the auto-generated code. The problem there is performance. For a designer file with about 5.8k lines of code, the saving process takes about 7 minutes. This occurs every time i have a change in a Form file, which makes the tool (and especially the auto-format on save function) absolutely useless to us. As for the form itself, its basically just a file with a RichEdit and all your office ribbon functions added. In this case, we wouldn't want to exclude a file depending on it's content but it's name (similar to a gitignore on a file because of it's name/it's type/it's extension).

Comments (1)
DevExpress Support Team 6 years ago

    Hi,

    Thank you for pointing out this issue.

    I have reproduced this issue locally. We agree that applying the Code Cleanup for generated files is wrong. We will correct the behavior of the "Apply Code Cleanup when saving a document" option to ignore these files and notify you of our progress.

    Answers approved by DevExpress Support

    created 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)
      BS BS
      Bert Stomphorst 5 years ago

        Hi DX,

        Is there a way I can use this functionality to prevent formatting a part of my code?

        The scenario I have is a huge testset, with generated test-initializing code (generated external, copy/pasted into my Unit-test TestInitialize-method). In this code I would love it to be able to ignore the Right-margin-column-size (or the whole formatting) for that part of my code.
        I can surround it with special information/region/methodnames/whatever.

        Currently I've a lot of code-lines that are split into multiple lines but are never read by humans (but should be easy to replace during test-development).

        Thank you,
        Bert

        DevExpress Support Team 5 years ago

          Hi Bert,

          Thank you for contacting us and explaining your use case.
          Now, we do not support the possibility to exclude code parts from formatting.
          Though this is a task with high priority on our TO-DO list and we plan to implement it in one of the nearest releases.

          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.