Subject: Re: bug#77256: Treesit language-at-point

From: Yuan Fu <[email-masked]>
Date: Sat, 29 Mar 2025 01:25:44 -0700

> On Mar 25, 2025, at 11:42 AM, Juri Linkov <[email-masked]> wrote:
> 
> Do we still need such complicated functions as
> mhtml-ts-mode--language-at-point, js--treesit-language-at-point, etc.
> that duplicate the rules from 'treesit-range-rules'
> when now the default language-at-point function could be implemented
> just as
> 
>  (treesit-parser-language
>   (or (seq-some (lambda (o) (overlay-get o 'treesit-parser))
>                 (overlays-at (point) t))
>       treesit-primary-parser))

Yeah, we can provide a default language-at-point function now that determines the “most relevant parser” by embed level. But we should keep treesit-language-at-point-function because a) it’s already in a release version and b) we want major modes to be able to customize what parser to pick at any given point.

Yuan