Area-IDEBugFeature - Extract MethodIDE-Formatterhelp wanted
描述
Version Used: 15.3 Preview 7
:link: Originally revealed by ExtractMethodTests.TestUseExpressionWhenOnSingleLine_AndNotIsOnSingleLine in #21439.
Steps to Reproduce:
-
Use the following code
using System; namespace ConsoleApp5 { class Program { static void Main(string[] args) { bool b = true; Console.WriteLine(b != true ? b = true : b = false); } } } -
Select
b != true -
Apply the Extract Method refactoring
Expected Behavior:
using System;
namespace ConsoleApp5
{
class Program
{
static void Main(string[] args)
{
bool b = true;
Console.WriteLine(NewMethod(b) ? b = true : b = false);
}
private static bool NewMethod(bool b)
{
return b !=
true;
}
}
}
Actual Behavior:
using System;
namespace ConsoleApp5
{
class Program
{
static void Main(string[] args)
{
bool b = true;
Console.WriteLine(NewMethod(b) ? b = true : b = false);
}
private static bool NewMethod(bool b)
{
return b !=
true;
}
}
}