CSharpEssentials
CSharpEssentials copied to clipboard
CSE0003 Multiline comments are truncated
When a single line return is followed by multiple line comments refactoring removes all but first line.

The same doesn't happen if the comments are inside /*.......*/ block.

Could you provide the actual code that fails? I'm having trouble getting that second example from just the preview (since it's truncated :smile:).
Sure thing, just to be clear it doesn't fail but removes comments.
Original Code
class RefactoringDemo
{
public int MyProperty { get; set; }
public override string ToString()
{
return $"MyProperty: {MyProperty}"; // This is demo for multi line comments
//1) This is line 1
//2) This is line 2
}
public string AnotherExample()
{
return $"MyProperty: {MyProperty}"; /* This is demo for multi line comments
//1) This is line 1
//2) This is line 2
*/
}
}
Refactored code (have a look at comment inside ToString() method)
class RefactoringDemo
{
public int MyProperty { get; set; }
public override string ToString() => $"MyProperty: {MyProperty}"; // This is demo for multi line comments
public string AnotherExample() => $"MyProperty: {MyProperty}"; /* This is demo for multi line comments
//1) This is line 1
//2) This is line 2
*/
}