; * lisp/treesit.el (treesit-language-at-point-function): Fix doc.

(cherry picked from commit 07ede5e92a)
(Bug#66183)
This commit is contained in:
Yuan Fu
2023-09-26 23:15:14 -07:00
committed by Eli Zaretskii
parent a74e51cfd1
commit 247743bd1e

View File

@@ -132,7 +132,14 @@ Return the root node of the syntax tree."
This is used by `treesit-language-at', which is used by various
functions to determine which parser to use at point.
The function is called with one argument, the position of point.")
The function is called with one argument, the position of point.
In general, this function should call `treesit-node-at' with an
explicit language (usually the host language), and determine the
language at point using the type of the returned node.
DO NOT derive the language at point from parser ranges. It's
cumbersome and can't deal with some edge cases.")
(defun treesit-language-at (position)
"Return the language at POSITION.