Improve call indentation for elixir-ts-mode

* lisp/progmodes/elixir-ts-mode.el
(elixir-ts--indent-rules): Change match order.
(Bug#63110)

* test/lisp/progmodes/elixir-ts-mode-resources/indent.erts:
Add test case.
This commit is contained in:
Wilhelm H Kirschbaum 2023-04-27 12:13:25 +02:00 committed by Eli Zaretskii
parent e0e93f7eec
commit e03cfec0a4
2 changed files with 14 additions and 2 deletions

View file

@ -257,7 +257,6 @@
((node-is "^stab_clause$") parent-bol ,offset)
((query ,elixir-ts--capture-operator-parent) grand-parent 0)
((node-is "^when$") parent 0)
((node-is "^keywords$") parent-bol ,offset)
((parent-is "^body$")
(lambda (node parent _)
(save-excursion
@ -272,6 +271,7 @@
,'elixir-ts--argument-indent-anchor
,'elixir-ts--argument-indent-offset)
;; Handle incomplete maps when parent is ERROR.
((node-is "^keywords$") parent-bol ,offset)
((n-p-gp "^binary_operator$" "ERROR" nil) parent-bol 0)
;; When there is an ERROR, just indent to prev-line.
((parent-is "ERROR") prev-line ,offset)

View file

@ -193,7 +193,19 @@ tuple = {
}
=-=-=
Name: Spec and method
Name: Call with keywords
=-=
def foo() do
bar(:one,
:two,
one: 1,
two: 2
)
end
=-=-=
Name: Call with @spec
=-=
@spec foobar(