* lisp/progmodes/elixir-ts-mode.el (elixir-ts--thing-settings):
Add extra grouping "keywords" to named sexp nodes.
Add "," to anonymous sexp nodes. Use bos/eos.
* lisp/progmodes/ruby-ts-mode.el (ruby-ts-mode):
Use bos/eos for anonymous sexp nodes for better disambiguation.
* test/lisp/progmodes/heex-ts-mode-tests.el
(heex-ts-mode-test-indentation): Skip the test when 'elixir' is
missing since 'heex-ts-mode' depends on the 'elixir' grammar.
(cherry picked from commit
cd557d6f6480cae81c39a451b2a2aaee720ba985)
(defvar elixir-ts--thing-settings
`((sexp (not (or (and named
- ,(rx bos (or "source" "comment") eos))
+ ,(rx bos (or "source" "keywords" "comment")
+ eos))
(and anonymous
- ,(rx (or "{" "}" "[" "]" "(" ")"
- "do" "end"))))))
+ ,(rx bos (or "{" "}" "[" "]" "(" ")" ","
+ "do" "end")
+ eos)))))
(list
(or (and "\\`arguments\\'" ,#'elixir-ts--with-parens-0-p)
(and "\\`unary_operator\\'" ,#'elixir-ts--with-parens-1-p)
"then")
eos))
(and anonymous
- ,(rx (or "do" "begin"
- "if" "unless"
- "def" "end"
- "(" ")" "[" "]"
- "{" "}" "|" "," ";"))))))
+ ,(rx bos (or "do" "begin"
+ "if" "unless"
+ "def" "end"
+ "(" ")" "[" "]"
+ "{" "}" "|" "," ";")
+ eos)))))
(list ,(cons (rx
bos
(or
(require 'treesit)
(ert-deftest heex-ts-mode-test-indentation ()
- (skip-unless (treesit-ready-p 'heex))
+ (skip-unless (and (treesit-ready-p 'heex) (treesit-ready-p 'elixir)))
(ert-test-erts-file (ert-resource-file "indent.erts")))
(provide 'heex-ts-mode-tests)