[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).
Code Cleanup – The "Apply Code Cleanup when saving a document" option should ignore designer generated files
Answers approved by DevExpress Support
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.
- v19.1.6Download Official Update
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
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.
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.