dotnet/roslyn
Decompilation should put new lines between blocks
Aberta
#25.303 aberto em 7 de mar. de 2018
Area-IDEIDE-Formatterhelp wanted
Métricas do repositório
- Stars
- (20.414 estrelas)
- Métricas de merge de PR
- (Mesclagem média 6d 17h) (256 fundiu PRs em 30d)
Description
We should layout methods a little better by introducing new lines to make a little more readable (Reflector did this well)
- Create Console App (.NET Framework)
- In the following, CTRL+Click
int
class Program
{
static void Main(string[] args)
{
int foo;
}
}
- When prompted say Yes to decompile
- Scroll down to CompareTo:
Expected:
public int CompareTo(object value)
{
if (value == null)
{
return 1;
}
if (value is int)
{
int num = (int)value;
if (this < num)
{
return -1;
}
if (this > num)
{
return 1;
}
return 0;
}
throw new ArgumentException(Environment.GetResourceString("Arg_MustBeInt32"));
}
Actual:
public int CompareTo(object value)
{
if (value == null)
{
return 1;
}
if (value is int)
{
int num = (int)value;
if (this < num)
{
return -1;
}
if (this > num)
{
return 1;
}
return 0;
}
throw new ArgumentException(Environment.GetResourceString("Arg_MustBeInt32"));
}