ruby-ts-mode: Fix/change indentation of a continuation method call
* lisp/progmodes/ruby-ts-mode.el (ruby-ts--indent-rules): Fix/change indentation of a continuation method call. * test/lisp/progmodes/ruby-mode-resources/ruby-ts.rb: New examples.
This commit is contained in:
parent
5e2e68a0c2
commit
ac5516bd7d
2 changed files with 15 additions and 2 deletions
|
@ -697,9 +697,9 @@ i.e. expr of def foo(args) = expr is returned."
|
||||||
;; 2) With paren, 1st arg on next line
|
;; 2) With paren, 1st arg on next line
|
||||||
((and (query "(argument_list \"(\" _ @indent)")
|
((and (query "(argument_list \"(\" _ @indent)")
|
||||||
(node-is ")"))
|
(node-is ")"))
|
||||||
(ruby-ts--bol ruby-ts--grand-parent-node) 0)
|
parent-bol 0)
|
||||||
((query "(argument_list \"(\" _ @indent)")
|
((query "(argument_list \"(\" _ @indent)")
|
||||||
(ruby-ts--bol ruby-ts--grand-parent-node) ruby-indent-level)
|
parent-bol ruby-indent-level)
|
||||||
;; 3) No paren, ruby-parenless-call-arguments-indent is t
|
;; 3) No paren, ruby-parenless-call-arguments-indent is t
|
||||||
((and ruby-ts--parenless-call-arguments-indent-p (parent-is "argument_list"))
|
((and ruby-ts--parenless-call-arguments-indent-p (parent-is "argument_list"))
|
||||||
first-sibling 0)
|
first-sibling 0)
|
||||||
|
|
|
@ -28,6 +28,19 @@
|
||||||
dog = 99
|
dog = 99
|
||||||
end
|
end
|
||||||
|
|
||||||
|
foo1 =
|
||||||
|
subject.update(
|
||||||
|
1
|
||||||
|
)
|
||||||
|
|
||||||
|
foo2 =
|
||||||
|
subject.
|
||||||
|
update(
|
||||||
|
# Might make sense to indent this to 'subject' instead; but this
|
||||||
|
# style seems more popular.
|
||||||
|
2
|
||||||
|
)
|
||||||
|
|
||||||
# Local Variables:
|
# Local Variables:
|
||||||
# mode: ruby-ts
|
# mode: ruby-ts
|
||||||
# End:
|
# End:
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue