Function: cmake-ts-mode--indent-rules
cmake-ts-mode--indent-rules is a byte-compiled function defined in
cmake-ts-mode.el.gz.
Signature
(cmake-ts-mode--indent-rules)
Documentation
Return tree-sitter indent rules for cmake-ts-mode.
Source Code
;; Defined in /usr/src/emacs/lisp/progmodes/cmake-ts-mode.el.gz
(defun cmake-ts-mode--indent-rules ()
"Return tree-sitter indent rules for `cmake-ts-mode'."
`((cmake
((node-is ")") parent-bol 0)
((node-is "else_command") parent-bol 0)
((node-is "elseif_command") parent-bol 0)
((node-is "endforeach_command") parent-bol 0)
((node-is "endfunction_command") parent-bol 0)
((node-is "endif_command") parent-bol 0)
((parent-is "foreach_loop") parent-bol cmake-ts-mode-indent-offset)
((parent-is "function_def") parent-bol cmake-ts-mode-indent-offset)
((parent-is "if_condition") parent-bol cmake-ts-mode-indent-offset)
((parent-is "normal_command") parent-bol cmake-ts-mode-indent-offset)
;; Release v0.4.0 wraps arguments in an argument_list node.
,@(ignore-errors
(treesit-query-capture 'cmake '((argument_list) @capture))
`(((parent-is "argument_list") grand-parent cmake-ts-mode-indent-offset)))
;; Release v0.3.0 wraps the body of commands into a body node.
,@(ignore-errors
(treesit-query-capture 'cmake '((body) @capture))
`(((parent-is "body") grand-parent cmake-ts-mode-indent-offset))))))