@@ -51,7 +51,7 @@ void IndentationAnalyzer::Analyze(FormatState &f, const LuaSyntaxTree &t) {
5151 break ;
5252 }
5353 case LuaSyntaxNodeKind::ParamList: {
54- AddIndenter (syntaxNode, t);
54+ AddIndenter (syntaxNode, t, IndentData (IndentType::Standard, f. GetStyle (). continuation_indent . before_block ) );
5555 break ;
5656 }
5757 case LuaSyntaxNodeKind::CallExpression: {
@@ -92,7 +92,7 @@ void IndentationAnalyzer::Analyze(FormatState &f, const LuaSyntaxTree &t) {
9292 if (!f.GetStyle ().never_indent_before_if_condition ) {
9393 auto exprs = syntaxNode.GetChildSyntaxNodes (MultiKind::Expression, t);
9494 for (auto expr: exprs) {
95- AddIndenter (expr, t, IndentData (IndentType::Standard, f.GetStyle ().continuation_indent ));
95+ AddIndenter (expr, t, IndentData (IndentType::Standard, f.GetStyle ().continuation_indent . before_block ));
9696 }
9797 }
9898 break ;
@@ -102,11 +102,11 @@ void IndentationAnalyzer::Analyze(FormatState &f, const LuaSyntaxTree &t) {
102102
103103 for (auto expr: suffixedExpression.GetChildren (t)) {
104104 if (expr.GetSyntaxKind (t) == LuaSyntaxNodeKind::IndexExpression) {
105- AddIndenter (expr, t, IndentData (IndentType::Standard, f.GetStyle ().continuation_indent ));
105+ AddIndenter (expr, t, IndentData (IndentType::Standard, f.GetStyle ().continuation_indent . in_expr ));
106106 } else if (expr.GetSyntaxKind (t) == LuaSyntaxNodeKind::CallExpression) {
107107 auto prevSibling = expr.GetPrevSibling (t);
108108 if (prevSibling.GetSyntaxKind (t) != LuaSyntaxNodeKind::NameExpression) {
109- AddIndenter (expr, t, IndentData (IndentType::WhenPrevIndent, f.GetStyle ().continuation_indent ));
109+ AddIndenter (expr, t, IndentData (IndentType::WhenPrevIndent, f.GetStyle ().continuation_indent . in_expr ));
110110 }
111111 }
112112 }
@@ -131,11 +131,11 @@ void IndentationAnalyzer::Analyze(FormatState &f, const LuaSyntaxTree &t) {
131131
132132 for (auto expr: suffixedExpression.GetChildren (t)) {
133133 if (expr.GetSyntaxKind (t) == LuaSyntaxNodeKind::IndexExpression) {
134- AddIndenter (expr, t, IndentData (IndentType::Standard, f.GetStyle ().continuation_indent ));
134+ AddIndenter (expr, t, IndentData (IndentType::Standard, f.GetStyle ().continuation_indent . in_table ));
135135 } else if (expr.GetSyntaxKind (t) == LuaSyntaxNodeKind::CallExpression) {
136136 auto prevSibling = expr.GetPrevSibling (t);
137137 if (prevSibling.GetSyntaxKind (t) != LuaSyntaxNodeKind::NameExpression) {
138- AddIndenter (expr, t, IndentData (IndentType::WhenPrevIndent, f.GetStyle ().continuation_indent ));
138+ AddIndenter (expr, t, IndentData (IndentType::WhenPrevIndent, f.GetStyle ().continuation_indent . in_table ));
139139 }
140140 }
141141 }
@@ -245,10 +245,10 @@ void IndentationAnalyzer::AnalyzeExprList(FormatState &f, LuaSyntaxNode &exprLis
245245 }
246246
247247 if (shouldIndent) {
248- AddIndenter (exprList, t, IndentData (IndentType::Standard, f.GetStyle ().continuation_indent ));
248+ AddIndenter (exprList, t, IndentData (IndentType::Standard, f.GetStyle ().continuation_indent . in_expr ));
249249 } else {
250250 std::vector<LuaSyntaxNode> group = exprList.GetChildren (t);
251- AddLinebreakGroup (exprList, group, t, f.GetStyle ().continuation_indent );
251+ AddLinebreakGroup (exprList, group, t, f.GetStyle ().continuation_indent . in_expr );
252252 }
253253}
254254
@@ -331,7 +331,7 @@ void IndentationAnalyzer::AnalyzeTableFieldKeyValuePairExpr(FormatState &f, LuaS
331331 }
332332
333333 if (IsExprShouldIndent (expr, t)) {
334- AddIndenter (expr, t, IndentData (IndentType::Standard, f.GetStyle ().continuation_indent ));
334+ AddIndenter (expr, t, IndentData (IndentType::Standard, f.GetStyle ().continuation_indent . in_expr ));
335335 }
336336}
337337
0 commit comments