From c165247c3009adec912abdf74d6d7d73c8c76c33 Mon Sep 17 00:00:00 2001 From: Noah Peart Date: Sun, 10 Dec 2023 14:58:31 -0800 Subject: 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. --- test/lisp/progmodes/js-tests.el | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'test/lisp/progmodes/js-tests.el') 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 -- cgit v1.2.3