]> git.eshelyaron.com Git - emacs.git/commitdiff
Add array_initializer to java-ts-mode
authorTheodor Thornhill <theo@thornhill.no>
Sun, 5 Feb 2023 07:24:14 +0000 (08:24 +0100)
committerTheodor Thornhill <theo@thornhill.no>
Mon, 6 Feb 2023 06:43:37 +0000 (07:43 +0100)
Indent strings inside arrray_initializer one step:

public class Java {
    void foo() {
        return new String[]{
            "foo", // These
            "bar"
        }
    }
}

* lisp/progmodes/java-ts-mode.el (java-ts-mode--indent-rules): New
matcher.

lisp/progmodes/java-ts-mode.el

index fc264f448afba90b395a10db001eb9a654a5a79d..b9f7894095738a98942f58dc58ad5c51900638de 100644 (file)
@@ -78,6 +78,7 @@
      ((parent-is "comment") prev-adaptive-prefix 0)
      ((parent-is "text_block") no-indent)
      ((parent-is "class_body") parent-bol java-ts-mode-indent-offset)
+     ((parent-is "array_initializer") parent-bol java-ts-mode-indent-offset)
      ((parent-is "annotation_type_body") parent-bol java-ts-mode-indent-offset)
      ((parent-is "interface_body") parent-bol java-ts-mode-indent-offset)
      ((parent-is "constructor_body") parent-bol java-ts-mode-indent-offset)