Description
By default, CSharpier allows with expressions to stay on one line. However, if a comment is added before the with expression, CSharpier will unexpectedly split the with into 4+ lines.
Steps to Reproduce
Try the following two inputs and observe the outputs.
Input 1
public class ClassName {
public void Method() {
var apples = new { Item = "Apples", Price = 1.19m };
var saleApples = apples with { Price = 0.79m };
}
}
Input 2
public class ClassName {
public void Method() {
var apples = new { Item = "Apples", Price = 1.19m };
// test
var saleApples = apples with { Price = 0.79m };
}
}
Expected Behavior
Output 1
public class ClassName
{
public void Method()
{
var apples = new { Item = "Apples", Price = 1.19m };
var saleApples = apples with { Price = 0.79m };
}
}
Output 2
public class ClassName
{
public void Method()
{
var apples = new { Item = "Apples", Price = 1.19m };
// test
var saleApples = apples with { Price = 0.79m };
}
}
Actual Behavior
Output 1
public class ClassName
{
public void Method()
{
var apples = new { Item = "Apples", Price = 1.19m };
var saleApples = apples with { Price = 0.79m };
}
}
Output 2
public class ClassName
{
public void Method()
{
var apples = new { Item = "Apples", Price = 1.19m };
// test
var saleApples = apples with
{
Price = 0.79m,
};
}
}
Description
By default, CSharpier allows
withexpressions to stay on one line. However, if a comment is added before thewithexpression, CSharpier will unexpectedly split thewithinto 4+ lines.Steps to Reproduce
Try the following two inputs and observe the outputs.
Input 1
Input 2
Expected Behavior
Output 1
Output 2
Actual Behavior
Output 1
Output 2