You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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
*/
}
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.The text was updated successfully, but these errors were encountered: