|
1 | 1 | use emmylua_parser::{ |
2 | 2 | BinaryOperator, LuaAssignStat, LuaAstNode, LuaAstToken, LuaBinaryExpr, LuaCallArgList, |
3 | 3 | LuaCallExpr, LuaClosureExpr, LuaComment, LuaExpr, LuaIndexExpr, LuaIndexKey, LuaKind, |
4 | | - LuaLiteralExpr, LuaLiteralToken, LuaLocalStat, LuaNameExpr, LuaNilCoalescingExpr, LuaParamList, |
5 | | - LuaParenExpr, LuaSingleArgExpr, LuaStat, LuaSyntaxId, LuaSyntaxKind, LuaSyntaxNode, |
6 | | - LuaSyntaxToken, LuaTableExpr, LuaTableField, LuaTernaryExpr, LuaTokenKind, LuaUnaryExpr, |
| 4 | + LuaLiteralExpr, LuaLiteralToken, LuaLocalStat, LuaNameExpr, LuaParamList, LuaParenExpr, |
| 5 | + LuaSingleArgExpr, LuaStat, LuaSyntaxId, LuaSyntaxKind, LuaSyntaxNode, LuaSyntaxToken, |
| 6 | + LuaTableExpr, LuaTableField, LuaTernaryExpr, LuaTokenKind, LuaUnaryExpr, |
7 | 7 | }; |
8 | 8 | use rowan::TextRange; |
9 | 9 |
|
@@ -61,7 +61,6 @@ pub fn format_expr_with_options( |
61 | 61 | LuaExpr::TableExpr(expr) => format_table_expr(ctx, plan, expr), |
62 | 62 | LuaExpr::ClosureExpr(expr) => format_closure_expr(ctx, plan, expr), |
63 | 63 | LuaExpr::TernaryExpr(expr) => format_ternary_expr(ctx, plan, expr), |
64 | | - LuaExpr::NilCoalescingExpr(expr) => format_nil_coalescing_expr(ctx, plan, expr), |
65 | 64 | } |
66 | 65 | } |
67 | 66 |
|
@@ -2366,22 +2365,6 @@ fn format_ternary_expr( |
2366 | 2365 | docs |
2367 | 2366 | } |
2368 | 2367 |
|
2369 | | -fn format_nil_coalescing_expr( |
2370 | | - ctx: &FormatContext, |
2371 | | - plan: &FormatPlan, |
2372 | | - expr: &LuaNilCoalescingExpr, |
2373 | | -) -> Vec<DocIR> { |
2374 | | - let Some((left_expr, right_expr)) = expr.get_left_right_exprs() else { |
2375 | | - return vec![ir::source_node(expr.syntax().clone())]; |
2376 | | - }; |
2377 | | - let mut docs = format_expr(ctx, plan, &left_expr); |
2378 | | - docs.push(ir::space()); |
2379 | | - docs.push(ir::syntax_token(LuaTokenKind::TkNilCoalescing)); |
2380 | | - docs.push(ir::space()); |
2381 | | - docs.extend(format_expr(ctx, plan, &right_expr)); |
2382 | | - docs |
2383 | | -} |
2384 | | - |
2385 | 2368 | fn try_format_simple_inline_closure_expr( |
2386 | 2369 | ctx: &FormatContext, |
2387 | 2370 | plan: &FormatPlan, |
|
0 commit comments