From 3020ff5ae9dbe5f5c8d5bb8079e42ca1e7f31e5c Mon Sep 17 00:00:00 2001 From: Yuan Fu Date: Thu, 13 Feb 2025 07:57:19 -0800 Subject: [PATCH] Add java-ts-mode-method-chaining-indent-offset (bug#75154) Default method chaining to indent 8 spaces. * lisp/progmodes/java-ts-mode.el: (java-ts-mode-method-chaining-indent-offset): New custom option. (java-ts-mode--indent-rules): Use java-ts-mode-method-chaining-indent-offset. (cherry picked from commit 8fb31f58664b2c963dcc49706c163ffb4fafd699) --- lisp/progmodes/java-ts-mode.el | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/lisp/progmodes/java-ts-mode.el b/lisp/progmodes/java-ts-mode.el index 961af5e1202..441c9db140a 100644 --- a/lisp/progmodes/java-ts-mode.el +++ b/lisp/progmodes/java-ts-mode.el @@ -58,6 +58,13 @@ :safe 'integerp :group 'java) +(defcustom java-ts-mode-method-chaining-indent-offset 8 + "Indent offset for method chaining in `java-ts-mode'." + :version "31.1" + :type 'integer + :safe 'integerp + :group 'java) + (defcustom java-ts-mode-enable-doxygen nil "Enable doxygen syntax highlighting. If Non-nil, enable doxygen based font lock for comment blocks. @@ -129,7 +136,7 @@ again." ((parent-is "variable_declarator") parent-bol java-ts-mode-indent-offset) ((match ">" "type_arguments") parent-bol 0) ((parent-is "type_arguments") parent-bol java-ts-mode-indent-offset) - ((parent-is "method_invocation") parent-bol java-ts-mode-indent-offset) + ((parent-is "method_invocation") parent-bol java-ts-mode-method-chaining-indent-offset) ((parent-is "switch_rule") parent-bol java-ts-mode-indent-offset) ((parent-is "switch_label") parent-bol java-ts-mode-indent-offset) ((parent-is "ternary_expression") parent-bol java-ts-mode-indent-offset) -- 2.39.5