From 2bd0b9475384adfb4dd2cc794bbe1d8621546717 Mon Sep 17 00:00:00 2001 From: Theodor Thornhill Date: Sat, 28 Jan 2023 19:51:08 +0100 Subject: [PATCH] Fix java class member without access modifier (bug#61115) This ``` public class T { @Autowired String a; } ``` Should be indented as: ``` public class T { @Autowired String a; } ```` * lisp/progmodes/java-ts-mode.el (java-ts-mode--indent-rules): Add new rule to match edge case of field_declaration indentation. --- lisp/progmodes/java-ts-mode.el | 1 + 1 file changed, 1 insertion(+) diff --git a/lisp/progmodes/java-ts-mode.el b/lisp/progmodes/java-ts-mode.el index 8737472e514..fc264f448af 100644 --- a/lisp/progmodes/java-ts-mode.el +++ b/lisp/progmodes/java-ts-mode.el @@ -89,6 +89,7 @@ ((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) + ((match "type_identifier" "field_declaration") parent-bol 0) ((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) -- 2.39.2