Make java-ts-mode use the c-ts-common-indent-type-regexp-alist
* lisp/progmodes/java-ts-mode.el: (java-ts-mode): Setup c-ts-common-indent-type-regexp-alist.
This commit is contained in:
parent
87d39a30b1
commit
746748f5c2
1 changed files with 16 additions and 14 deletions
|
@ -303,20 +303,22 @@ Return nil if there is no name or if NODE is not a defun node."
|
||||||
(c-ts-common-comment-setup)
|
(c-ts-common-comment-setup)
|
||||||
|
|
||||||
;; Indent.
|
;; Indent.
|
||||||
(setq-local c-ts-common-indent-block-type-regexp
|
(setq-local c-ts-common-indent-type-regexp-alist
|
||||||
(regexp-opt '("class_body"
|
`((block . ,(rx (or "class_body"
|
||||||
"array_initializer"
|
"array_initializer"
|
||||||
"constructor_body"
|
"constructor_body"
|
||||||
"annotation_type_body"
|
"annotation_type_body"
|
||||||
"interface_body"
|
"interface_body"
|
||||||
"enum_body"
|
"enum_body"
|
||||||
"switch_block"
|
"switch_block"
|
||||||
"record_declaration_body"
|
"record_declaration_body"
|
||||||
"block")))
|
"block")))
|
||||||
(setq-local c-ts-common-indent-bracketless-type-regexp
|
(close-bracket . "}")
|
||||||
(regexp-opt '("if_statement"
|
(if . "if_statement")
|
||||||
"for_statement"
|
(else . ("if_statement" . "alternative"))
|
||||||
"while_statement")))
|
(for . "for_statement")
|
||||||
|
(while . "while_statement")
|
||||||
|
(do . "do_statement")))
|
||||||
(setq-local c-ts-common-indent-offset 'java-ts-mode-indent-offset)
|
(setq-local c-ts-common-indent-offset 'java-ts-mode-indent-offset)
|
||||||
(setq-local treesit-simple-indent-rules java-ts-mode--indent-rules)
|
(setq-local treesit-simple-indent-rules java-ts-mode--indent-rules)
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue