csharpier
csharpier copied to clipboard
Improved breaking for ExpressionBody in Parenthesized Lambda
I feel like we could clean up how this breaks
entity.HasKey(
e =>
new
{
e.BusinessEntityID,
e.PersonID,
e.ContactTypeID
}
);
// could instead be something like
entity.HasKey(e => new
{
e.BusinessEntityID,
e.PersonID,
e.ContactTypeID
}
);
Lambda in method formatting should probably be a separate issue than lambda formatting. So, it should probably be something closer to:
entity.HasKey(
e => new
{
e.BusinessEntityID,
e.PersonID,
e.ContactTypeID
}
);
or at least work the same way as:
var e => new
{
e.BusinessEntityID,
e.PersonID,
e.ContactTypeID
}
);
This will most likely require conditional groups somewhere. At least prettier uses them.
See call-arguments.js
These are some of the related cases with possible desired formatting.
entity.HasKey(e => new
{
e.BusinessEntityID,
e.PersonID,
e.ContactTypeID________________________________________________
});
// prettier differs from this
entity.HasKey(
e => new
{
e.BusinessEntityID,
e.PersonID,
e.ContactTypeID________________________________________________
},
two
);
entity.HasKey((e) =>
{
return new
{
One = e.BusinessEntityID,
Two = e.PersonID,
Three = e.ContactTypeID________________________________________________
};
});
var variableDeclarator = conditionalAccessExpression?.invocationExpression(
o => someLongValue___________________________________
);
var y = someList.Where(
o =>
someLongValue_______________________
&& theseShouldNotIndent_________________
&& theseShouldNotIndent_________________
> butThisOneShould_________________________________________
);