Add bitstring indentation and navigation for elixir-ts-mode
* lisp/progmodes/elixir-ts-mode.el (elixir-ts--sexp-regexp): Add bistring. (elixir-ts--indent-rules): Handle bitstring indentation. (Bug#63109) * test/lisp/progmodes/elixir-ts-mode-resources/indent.erts: Add test case.
This commit is contained in:
parent
b408df11e3
commit
e0e93f7eec
2 changed files with 15 additions and 1 deletions
|
@ -89,7 +89,7 @@
|
|||
(rx bol
|
||||
(or "call" "stab_clause" "binary_operator" "list" "tuple" "map" "pair"
|
||||
"sigil" "string" "atom" "alias" "arguments" "identifier"
|
||||
"boolean" "quoted_content")
|
||||
"boolean" "quoted_content" "bitstring")
|
||||
eol))
|
||||
|
||||
(defconst elixir-ts--test-definition-keywords
|
||||
|
@ -231,6 +231,7 @@
|
|||
((node-is "^]$") ,'elixir-ts--parent-expression-start 0)
|
||||
((node-is "^}$") ,'elixir-ts--parent-expression-start 0)
|
||||
((node-is "^)$") ,'elixir-ts--parent-expression-start 0)
|
||||
((node-is "^>>$") ,'elixir-ts--parent-expression-start 0)
|
||||
((node-is "^else_block$") grand-parent 0)
|
||||
((node-is "^catch_block$") grand-parent 0)
|
||||
((node-is "^rescue_block$") grand-parent 0)
|
||||
|
@ -250,6 +251,7 @@
|
|||
,'elixir-ts--argument-indent-anchor
|
||||
,'elixir-ts--argument-indent-offset)
|
||||
((parent-is "^pair$") parent ,offset)
|
||||
((parent-is "^bitstring$") parent ,offset)
|
||||
((parent-is "^map_content$") parent-bol 0)
|
||||
((parent-is "^map$") ,'elixir-ts--parent-expression-start ,offset)
|
||||
((node-is "^stab_clause$") parent-bol ,offset)
|
||||
|
|
|
@ -79,6 +79,18 @@ def foo() do
|
|||
end
|
||||
=-=-=
|
||||
|
||||
Name: Bitstring mulitline
|
||||
|
||||
=-=
|
||||
<<12, 22,
|
||||
22, 32
|
||||
>>
|
||||
=-=
|
||||
<<12, 22,
|
||||
22, 32
|
||||
>>
|
||||
=-=-=
|
||||
|
||||
Name: Block assignments
|
||||
|
||||
=-=
|
||||
|
|
Loading…
Add table
Reference in a new issue