mirror of
https://github.com/masscollaborationlabs/emacs.git
synced 2025-07-07 12:49:38 +00:00
Add expression handling to heex-ts-mode
On the latest update of the grammar expressions were added and won't be seen as directives anymore. * lisp/progmodes/heex-ts-mode.el (heex-ts--sexp-regexp): Match on expression as well. (heex-ts--indent-rules): Indent on expression end. (Bug#75191) * test/lisp/progmodes/heex-ts-mode-resources/indent.erts: Add expression indent test.
This commit is contained in:
parent
0cacf80639
commit
ae2589ea7a
2 changed files with 18 additions and 1 deletions
|
@ -54,7 +54,7 @@
|
||||||
(defconst heex-ts--sexp-regexp
|
(defconst heex-ts--sexp-regexp
|
||||||
(rx bol
|
(rx bol
|
||||||
(or "directive" "tag" "component" "slot"
|
(or "directive" "tag" "component" "slot"
|
||||||
"attribute" "attribute_value" "quoted_attribute_value")
|
"attribute" "attribute_value" "quoted_attribute_value" "expression")
|
||||||
eol))
|
eol))
|
||||||
|
|
||||||
;; There seems to be no parent directive block for tree-sitter-heex,
|
;; There seems to be no parent directive block for tree-sitter-heex,
|
||||||
|
@ -81,6 +81,7 @@
|
||||||
((node-is "end_slot") parent-bol 0)
|
((node-is "end_slot") parent-bol 0)
|
||||||
((node-is "/>") parent-bol 0)
|
((node-is "/>") parent-bol 0)
|
||||||
((node-is ">") parent-bol 0)
|
((node-is ">") parent-bol 0)
|
||||||
|
((node-is "}") parent-bol 0)
|
||||||
((parent-is "comment") prev-adaptive-prefix 0)
|
((parent-is "comment") prev-adaptive-prefix 0)
|
||||||
((parent-is "component") parent-bol ,offset)
|
((parent-is "component") parent-bol ,offset)
|
||||||
((parent-is "tag") parent-bol ,offset)
|
((parent-is "tag") parent-bol ,offset)
|
||||||
|
|
|
@ -45,3 +45,19 @@ Name: Slots
|
||||||
</:bar>
|
</:bar>
|
||||||
</Foo>
|
</Foo>
|
||||||
=-=-=
|
=-=-=
|
||||||
|
|
||||||
|
Name: Expression
|
||||||
|
|
||||||
|
=-=
|
||||||
|
<div>
|
||||||
|
{
|
||||||
|
@bar
|
||||||
|
}
|
||||||
|
</div>
|
||||||
|
=-=
|
||||||
|
<div>
|
||||||
|
{
|
||||||
|
@bar
|
||||||
|
}
|
||||||
|
</div>
|
||||||
|
=-=-=
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue