summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorDmitry Gutov <dmitry@gutov.dev>2024-02-17 22:34:55 +0200
committerDmitry Gutov <dmitry@gutov.dev>2024-02-17 22:35:16 +0200
commit5a64d2c7595dc393504c6eee9321d74dbd8ae9e2 (patch)
treeae8c1b8667d9885142efb4cf5be5e547754e6be8 /test
parent9e56bd5ed8775f53c3025b114525cee7c578e2d0 (diff)
downloademacs-5a64d2c7595dc393504c6eee9321d74dbd8ae9e2.tar.gz
emacs-5a64d2c7595dc393504c6eee9321d74dbd8ae9e2.tar.bz2
emacs-5a64d2c7595dc393504c6eee9321d74dbd8ae9e2.zip
java-ts-mode: Indentation for opening brace on a separate line
* lisp/progmodes/java-ts-mode.el (java-ts-mode--indent-rules): Support putting the opening brace on a separate line (bug#67556). * test/lisp/progmodes/java-ts-mode-resources/indent.erts: Add a test.
Diffstat (limited to 'test')
-rw-r--r--test/lisp/progmodes/java-ts-mode-resources/indent.erts31
1 files changed, 31 insertions, 0 deletions
diff --git a/test/lisp/progmodes/java-ts-mode-resources/indent.erts b/test/lisp/progmodes/java-ts-mode-resources/indent.erts
index 4fca74dd2e1..514d2e08977 100644
--- a/test/lisp/progmodes/java-ts-mode-resources/indent.erts
+++ b/test/lisp/progmodes/java-ts-mode-resources/indent.erts
@@ -110,3 +110,34 @@ public class Java {
}
}
=-=-=
+
+Name: Opening bracket on separate line (bug#67556)
+
+=-=
+public class Java {
+ void foo(
+ String foo)
+ {
+ for (var f : rs)
+ return new String[]
+ {
+ "foo",
+ "bar"
+ };
+ if (a == 0)
+ {
+ return 0;
+ } else if (a == 1)
+ {
+ return 1;
+ }
+
+ switch(expr)
+ {
+ case x:
+ // code block
+ break;
+ }
+ }
+}
+=-=-=