Skip to content

Commit

Permalink
Trying ? at the end
Browse files Browse the repository at this point in the history
closes #561
  • Loading branch information
belav committed Feb 8, 2022
1 parent a338a6c commit c265d71
Showing 1 changed file with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,10 @@ private static List<List<PrintedNode>> GroupPrintedNodes(List<PrintedNode> print
var hasSeenInvocationExpression = false;
for (; index < printedNodes.Count; index++)
{
if (hasSeenInvocationExpression && IsMemberish(printedNodes[index].Node))
if (
hasSeenInvocationExpression && IsMemberish(printedNodes[index].Node)
|| printedNodes[index - 1].Node is ConditionalAccessExpressionSyntax
)
{
groups.Add(currentGroup);
currentGroup = new List<PrintedNode>();
Expand All @@ -209,7 +212,7 @@ private static List<List<PrintedNode>> GroupPrintedNodes(List<PrintedNode> print

private static bool IsMemberish(CSharpSyntaxNode node)
{
return node is MemberAccessExpressionSyntax or ConditionalAccessExpressionSyntax;
return node is MemberAccessExpressionSyntax;
}

private static Doc PrintIndentedGroup(ExpressionSyntax node, IList<List<PrintedNode>> groups)
Expand Down

0 comments on commit c265d71

Please sign in to comment.