1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2025-12-10 00:00:39 -08:00
emacs/test/lisp/progmodes/java-ts-mode-resources/indent.erts
Theodor Thornhill 61cdf42a48 Backport: Add some basic tests for java-ts-mode and typescript-ts-mode
* test/lisp/progmodes/java-ts-mode-resources/indent.erts: New file
with tests for indentation.
* test/lisp/progmodes/java-ts-mode-resources/movement.erts: New file
with tests for movement.
* test/lisp/progmodes/java-ts-mode-tests.el: New tests.
* test/lisp/progmodes/typescript-ts-mode-resources/indent.erts: New
file with tests for indentation.
* test/lisp/progmodes/typescript-ts-mode-tests.el: New tests.

(cherry picked from commit c8dd37b16c)
2023-11-21 16:26:54 +02:00

44 lines
519 B
Text

Code:
(lambda ()
(setq indent-tabs-mode nil)
(setq java-ts-mode-indent-offset 2)
(java-ts-mode)
(indent-region (point-min) (point-max)))
Point-Char: |
Name: Basic
=-=
public class Basic {
public void basic() {
return;
}
}
=-=-=
Name: Empty Line
=-=
public class EmptyLine {
public void emptyLine() {
|
}
}
=-=-=
Name: Statements
=-=
if (x) {
for (var foo : foos) {
|
}
} else if (y) {
for (int i = 0; x < foos.size(); i++) {
return;
}
} else {
return;
}
=-=-=