aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorDmitry Gutov2023-01-19 17:31:43 +0200
committerDmitry Gutov2023-01-19 19:44:10 +0200
commit0d3b6518e39a28774e4e70ed9bb7ef4aa009c0cf (patch)
tree632a1de9e0d3c0b30d3e93c6c3db9980ffcae672 /test
parent7fb69ce233b8a655af63d4c47b7359c43660acf6 (diff)
downloademacs-0d3b6518e39a28774e4e70ed9bb7ef4aa009c0cf.tar.gz
emacs-0d3b6518e39a28774e4e70ed9bb7ef4aa009c0cf.zip
(ruby-ts--indent-rules): Indent inside empty parens properly
* lisp/progmodes/ruby-ts-mode.el (ruby-ts--indent-rules): Consider the case when there are no arguments inside the call yet. * test/lisp/progmodes/ruby-ts-mode-tests.el (ruby-ts-indent-call-no-args): Add test.
Diffstat (limited to 'test')
-rw-r--r--test/lisp/progmodes/ruby-ts-mode-tests.el12
1 files changed, 12 insertions, 0 deletions
diff --git a/test/lisp/progmodes/ruby-ts-mode-tests.el b/test/lisp/progmodes/ruby-ts-mode-tests.el
index d34c235e82b..18e3e60a04a 100644
--- a/test/lisp/progmodes/ruby-ts-mode-tests.el
+++ b/test/lisp/progmodes/ruby-ts-mode-tests.el
@@ -110,6 +110,18 @@ The whitespace before and including \"|\" on each line is removed."
110 | 42 110 | 42
111 | end"))) 111 | end")))
112 112
113
114(ert-deftest ruby-ts-indent-call-no-args ()
115 (skip-unless (treesit-ready-p 'ruby t))
116 (ruby-ts-with-temp-buffer
117 "variable = foo(
118
119)"
120 (goto-char (point-min))
121 (forward-line 1)
122 (funcall indent-line-function)
123 (should (= (current-indentation) ruby-indent-level))))
124
113(ert-deftest ruby-ts-add-log-current-method-examples () 125(ert-deftest ruby-ts-add-log-current-method-examples ()
114 (skip-unless (treesit-ready-p 'ruby t)) 126 (skip-unless (treesit-ready-p 'ruby t))
115 (let ((pairs '(("foo" . "#foo") 127 (let ((pairs '(("foo" . "#foo")