codemaid
codemaid copied to clipboard
Codemaid removing whitespaces on XML Comments inside <code> tags
Environment
- Visual Studio version: 2019 Professional
- CodeMaid version: 12.0
- Code language: c#
Description
Codemaid is removing leading whitespaces when providing code examples in XML comments.
Steps to recreate
Add an XML comment with code example:
/// <summary>
/// Implementation of <see cref="INotifyPropertyChanged"/> to simplify models.
/// <code>
/// this.PropertyChanged?.Invoke(this, args);
/// </code>
/// </summary>
/// <example>
public class BindableBase : INotifyPropertyChanged
Current behavior
I have Codemaid automatic cleanup on document save enabled. This removes leading whitespaces on code examples. This is especially annoying when providing longer code examples.
/// <summary>
/// Implementation of <see cref="INotifyPropertyChanged"/> to simplify models.
/// <code>
///this.PropertyChanged?.Invoke(this, args);
/// </code>
/// </summary>
/// <example>
public class BindableBase : INotifyPropertyChanged
Expected behavior
Codemaid should retain a leading whitespaces to show intendation on code.
/// <summary>
/// Implementation of <see cref="INotifyPropertyChanged"/> to simplify models.
/// <code>
/// this.PropertyChanged?.Invoke(this, args);
/// </code>
/// </summary>
/// <example>
public class BindableBase : INotifyPropertyChanged
Thanks for reporting the issue. I wasn't able to reproduce it. Could you please include an export of your CodeMaid settings?
@codecadwallader , thanks for the response, here is the config file CodeMaid.txt .
Ok, thanks for the configuration. I discovered the reason I couldn't reproduce it was because the trailing unmatched <example> tag above was throwing things off. If I remove that I can reproduce the issue with default settings.
/// <summary>
/// <code>
/// this.PropertyChanged?.Invoke(this, args);
/// </code>
/// </summary>
@w5l If you have a chance would you mind taking a look? This sounds familiar.
#707