Function: elixir-ts--parent-expression-start
elixir-ts--parent-expression-start is a byte-compiled function defined
in elixir-ts-mode.el.gz.
Signature
(elixir-ts--parent-expression-start NODE PARENT &rest _)
Documentation
Return the indentation expression start for NODE and PARENT.
Source Code
;; Defined in /usr/src/emacs/lisp/progmodes/elixir-ts-mode.el.gz
(defun elixir-ts--parent-expression-start (_node parent &rest _)
"Return the indentation expression start for NODE and PARENT."
;; If the parent is the first expression on the line return the
;; parent start of node position, otherwise use the parent call
;; start if available.
(if (eq (treesit-node-start parent)
(save-excursion
(goto-char (treesit-node-start parent))
(back-to-indentation)
(point)))
(treesit-node-start parent)
(let ((expr-parent
(treesit-parent-until
parent
(lambda (n)
(member (treesit-node-type n)
'("call" "binary_operator" "keywords" "list"))))))
(save-excursion
(goto-char (treesit-node-start expr-parent))
(back-to-indentation)
(if (looking-at "|>")
(point)
(treesit-node-start expr-parent))))))