diff options
author | Noah Peart <noah.v.peart@gmail.com> | 2023-12-10 14:58:31 -0800 |
---|---|---|
committer | Dmitry Gutov <dmitry@gutov.dev> | 2023-12-12 03:13:12 +0200 |
commit | c165247c3009adec912abdf74d6d7d73c8c76c33 (patch) | |
tree | 415f5e856345c830c6d338742ddee4a139766bc9 /test/lisp/progmodes/js-tests.el | |
parent | 7f1bd69cd19504f2bd47e13c530a55ffca08e27d (diff) | |
download | emacs-c165247c3009adec912abdf74d6d7d73c8c76c33.tar.gz emacs-c165247c3009adec912abdf74d6d7d73c8c76c33.tar.bz2 emacs-c165247c3009adec912abdf74d6d7d73c8c76c33.zip |
Add indentation rules for bracketless statements in js-ts-mode
* lisp/progmodes/js.el (js--treesit-indent-rules): Add indentation
rules to handle bracketless statements (bug#67758).
* test/lisp/progmodes/js-tests.el (js-ts-mode-test-indentation):
New test for js-ts-mode indentation.
* test/lisp/progmodes/js-resources/js-ts-indents.erts: New file
with indentation tests for js-ts-mode.
Diffstat (limited to 'test/lisp/progmodes/js-tests.el')
-rw-r--r-- | test/lisp/progmodes/js-tests.el | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/test/lisp/progmodes/js-tests.el b/test/lisp/progmodes/js-tests.el index 5db92b08f8a..827d7bb8a99 100644 --- a/test/lisp/progmodes/js-tests.el +++ b/test/lisp/progmodes/js-tests.el @@ -288,6 +288,12 @@ function bar() { ;; end-of-defun should move point to eob. (should (eobp)))) +;;;; Tree-sitter tests. + +(ert-deftest js-ts-mode-test-indentation () + (skip-unless (treesit-ready-p 'javascript)) + (ert-test-erts-file (ert-resource-file "js-ts-indents.erts"))) + (provide 'js-tests) ;;; js-tests.el ends here |