1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2025-12-06 06:20:55 -08:00
emacs/test/lisp/progmodes/ruby-mode-resources/ruby-ts.rb
Dmitry Gutov 300ca6ac37 ruby-ts-mode: Fix indent after operator or conditional
Make it match ruby-mode's indentation behavior.

* lisp/progmodes/ruby-ts-mode.el (ruby-ts--binary-indent-anchor):
New function.
(ruby-ts--indent-rules): Use it instead of a composite matcher.
Add a rule for 'conditional'.
(ruby-ts--assignment-ancestor, ruby-ts--is-in-condition)
(ruby-ts--endless-method): Remove.

* test/lisp/progmodes/ruby-mode-resources/ruby-ts.rb:
Add examples.
2023-01-18 03:27:37 +02:00

59 lines
548 B
Ruby

variable = foo(
[
qwe
], [
rty
], {
a: 3
}
)
tee = [
qwe
]
qux = [1,
2]
att = {a: 1,
b: 2}
a = 1 ? 2 :(
2 + 3
)
unless bismark
sink += 12
else
dog = 99
end
foo1 =
subject.update(
1
)
foo2 =
subject.
update(
# Might make sense to indent this to 'subject' instead; but this
# style seems more popular.
2
)
foo > bar &&
tee < qux
1 .. 2 &&
3
a = foo(j, k) -
bar_tee
qux = foo.fee ?
bar :
tee
# Local Variables:
# mode: ruby-ts
# End: