Hi
Given the below example class (Note I use TABS and not spaces, however this issue still happens when set to (insert spaces for tabs)
C#namespace Testing
{
/// <summary>
/// an example class
/// </summary>
public class Class1
{
/// <summary>Initializes a new instance of the <see cref="Class1"/> class.</summary>
/// <remarks>A remark here</remarks>
public Class1()
{
Field1 = string.Empty;
Field2 = string.Empty;
}
/// <summary>Gets or sets the field1.</summary>
/// <value>The field1.</value>
private string Field1 { get; set; }
/// <summary>Gets or sets the field2.</summary>
/// <value>The field2.</value>
private string Field2 { get; set; }
}
}
After running the codeclean up it formats it like this:
C#namespace Testing
{
/// <summary>
/// an example class
/// </summary>
public class Class1
{
/// <summary>Initializes a new instance of the <see cref="Class1"/> class.</summary>
/// <remarks>A remark here</remarks>
public Class1()
{
Field1 = string.Empty;
Field2 = string.Empty;
}
/// <summary>Gets or sets the field1.</summary>
/// <value>The field1.</value>
private string Field1 { get; set; }
/// <summary>Gets or sets the field2.</summary>
/// <value>The field2.</value>
private string Field2 { get; set; }
}
}
Notice how the lines (hopefully in bold) are all tabbed in as well as the 2nd to last curly bracket.
The above issue are when I have the following TURNED ON:
C#>Formatting>Braces>Namespace
C#>Formatting>Braces>Type
I have both set to Wrap, Before, Wrap
If I turn the options off, the clean up looks like the original.
Side note - There is also an issue with the option:
C#>Formatting>Braces>Method
When this is on the method formats like this:
C#public Class1()
{ Field1 = string.Empty;
Field2 = string.Empty;
}
So using the initial code above, with all 3 options turned on with Wrap/before/wrap options it looks like this:
C#namespace Testing
{
/// <summary>
/// an example class
/// </summary>
public class Class1
{
/// <summary>Initializes a new instance of the <see cref="Class1"/> class.</summary>
/// <remarks>A remark here</remarks>
public Class1()
{ Field1 = string.Empty;
Field2 = string.Empty;
}
/// <summary>Gets or sets the field1.</summary>
/// <value>The field1.</value>
private string Field1 { get; set; }
/// <summary>Gets or sets the field2.</summary>
/// <value>The field2.</value>
private string Field2 { get; set; }
}
}
Hope this helps.
Alan,
Thank you for the detailed information on the issue. I can reproduce it locally, please give us some time to find a solution.
Hi Alex,
Excellent news, glad it helps, for now I've turned these options off an will check again when you find the solution :)
Great a fix already :)
I've ordered a HF, so I'll get back to you when I check it out. BTW What is v17.2.3 listed in the fixed list below?
Alan,
17.2.3 is our internal version, which was recently added. Thank you for bringing this to our attention.
We have changed its state to internal for now, and it will be available soon after the official public release.
Alex,
:) No worries, just wondered if I should be getting that instead of the 17.1.10.
Alan,
The fix for this issue will be also available in v17.1.10