The XAML Formatting option "Add whitespace before closing /> for empty elements" is not respected. It appears whitespace is always removed when formatting via CodeRush.
Formatting – The "Add whitespace before closing /> for empty elements" option has no effect in XAML
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.3Download Official Update
- v18.2.10Sign in to Request Hotfix
Hi Adam,
Thank you for contacting us.
I have tried to reproduce this issue but everything works fine on my side.
I have attached a screencast that illustrates my attempts.
To help us research this issue would you please provide the following:
- CodeRush log files (from "%LocalAppData%\CodeRush\Logs");
- CodeRush settings (from "%AppData%\CodeRush\Settings");
- CodeRush settings for the solution (from the "YOUR_SOLUTION_ROOT.cr" folder where YOUR_SOLUTION_ROOT - the root folder of your solution);
- clarify whether this issue occurs only in specific projects and files, or in the newly created WPF project as well.
I hope this information will help reproduce the issue on my side.
- CodeRush log files (from "%LocalAppData%\CodeRush\Logs")
I have attached these files under the CodeRush_Logs directory in the attachment.
- CodeRush settings (from "%AppData%\CodeRush\Settings")
I have attached these files under the CodeRush_Settings directory in the attachment.
- CodeRush settings for the solution (from the "YOUR_SOLUTION_ROOT.cr" folder where YOUR_SOLUTION_ROOT - the root folder of your solution)
I have attached these files under two seperate directories to represent both my sample app and our production directory as well. The sample files are under CodeRush_SampleSolution_Settings and the production files are under CodeRush_ProductionSolution_Settings.
- Clarify whether this issue occurs only in specific projects and files, or in the newly created WPF project as well.
It is not project or file specific. I have tested this in a new sample wpf app with same problem.
I also recorded a screencast demonstrating what I am able to reproduce on both my home and work machines.
https://drive.google.com/file/d/1Xv4_4DrJJASPP7ElxWNaqMgciQ84Ixd7/view
I filed this ticket while on CodeRush 18.2.8 but I'm now on 18.2.9 with the same problem. Thanks.
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.
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.