❔ Why wont visual studio auto format this with CTRL K + CTRL D?

can anyone think of why visual studio wont format these lambda arrows with CTRL K + CTRL D but it will format things around it like spacing between semicolons?
var exportBatchInputs = new List<TbExportBatchInput>()
{
TestHelper.Fixture.Build<TbExportBatchInput>()
.With(c => c.ExportBatchId, TestHelper.BatchID)
.With(c=>c.FieldName, "PO Box") // note the spacing between the fat arrow here
.With(c=>c.FieldData, "12345") // note the spacing between the fat arrow here
.Create()
};
var exportBatchInputs = new List<TbExportBatchInput>()
{
TestHelper.Fixture.Build<TbExportBatchInput>()
.With(c => c.ExportBatchId, TestHelper.BatchID)
.With(c=>c.FieldName, "PO Box") // note the spacing between the fat arrow here
.With(c=>c.FieldData, "12345") // note the spacing between the fat arrow here
.Create()
};
if i do something like this
var foo = ()=>5;
var foo = ()=>5;
it correctly auto formats it to
var foo = () => 5;
var foo = () => 5;
so im not sure what the difference is in context between those 2 that would cause visual studio to not format the first instance.
2 Replies
Yawnder
Yawnder3y ago
@fenixblades Because in the first case you basically already told the IDE that you didn't want to follow a regular formatting style. Your .With at the same depth as your TestHelper, for example.
Accord
Accord2y ago
Was this issue resolved? If so, run /close - otherwise I will mark this as stale and this post will be archived until there is new activity.
Want results from more Discord servers?
Add your server