From 10032f424ccf611783f5b92742e91e70595587c4 Mon Sep 17 00:00:00 2001 From: Theodor Thornhill Date: Fri, 13 Jan 2023 11:33:58 +0100 Subject: [PATCH] Fix indentation of some declarations and statements * lisp/progmodes/java-ts-mode.el (java-ts-mode--indent-rules): Add new rules so that we don't anchor at col 0. --- lisp/progmodes/java-ts-mode.el | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lisp/progmodes/java-ts-mode.el b/lisp/progmodes/java-ts-mode.el index 86e753c5f53..1d704f16b47 100644 --- a/lisp/progmodes/java-ts-mode.el +++ b/lisp/progmodes/java-ts-mode.el @@ -85,6 +85,10 @@ ((parent-is "record_declaration_body") parent-bol java-ts-mode-indent-offset) ((query "(method_declaration (block _ @indent))") parent-bol java-ts-mode-indent-offset) ((query "(method_declaration (block (_) @indent))") parent-bol java-ts-mode-indent-offset) + ((parent-is "local_variable_declaration") parent-bol java-ts-mode-indent-offset) + ((parent-is "expression_statement") parent-bol java-ts-mode-indent-offset) + ((parent-is "field_declaration") parent-bol java-ts-mode-indent-offset) + ((parent-is "return_statement") parent-bol java-ts-mode-indent-offset) ((parent-is "variable_declarator") parent-bol java-ts-mode-indent-offset) ((parent-is "method_invocation") parent-bol java-ts-mode-indent-offset) ((parent-is "switch_rule") parent-bol java-ts-mode-indent-offset) -- 2.39.2