You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
A number of undesirable newlines get added to the generated code during formatting.
As far as I can tell the root cause of the newlines getting added is AbstractTriviaFormatter.GetLineColumnOfWhitespace which returns a value with lines=1. This causes AbstractTriviaFormatter.AddWhitespaceTextChange to add a newline.
[WpfFact,Trait(Traits.Feature,Traits.Features.CodeActionsUseExplicitType)][WorkItem(23752,"https://github.com/dotnet/roslyn/issues/23752")]publicasyncTaskOnNestedDeconstructionVarWithTrivia(){awaitTestInRegularAndScriptAsync(@"using System;class Program{ void M() { /*before*/[|var|]/*after*/ (/*x1*/x/*x2*/, /*yz1*/(/*y1*/y/*y2*/, /*z1*/z/*z2*/)/*yz2*/) /*end*/ = new Program(); } void Deconstruct(out int i, out Program s) { i = 1; s = null; }}",@"using System;class Program{ void M() { /*before*//*after*/ (/*x1*/int x/*x2*/,/*yz1*/(/*y1*/int y/*y2*/,/*z1*/Program z/*z2*/)/*yz2*/) /*end*/ = new Program(); } void Deconstruct(out int i, out Program s) { i = 1; s = null; }}",options:ExplicitTypeEverywhere());}
The text was updated successfully, but these errors were encountered:
A number of undesirable newlines get added to the generated code during formatting.
As far as I can tell the root cause of the newlines getting added is
AbstractTriviaFormatter.GetLineColumnOfWhitespace
which returns a value with lines=1. This causesAbstractTriviaFormatter.AddWhitespaceTextChange
to add a newline.The text was updated successfully, but these errors were encountered: