Subject: 31.0.50; php-js-mode and js-ts-mode: treesit-show-paren-data--categorize: peculiar error: ("Cannot find the definition of the predicate in `treesit-thing-settings'" list)

From: Vincenzo Pupillo <[email-masked]>
Date: Fri, 18 Apr 2025 20:57:01 +0200

Ciao,
both php-ts-mode and js-ts-mode show the same error. It is similar to bug 
#75456. It was fixed by me at the time, for js-ts-mode, with a patch to 
js--treesit-language-at-point. The problem arises when there are languages 
other than the main language in the buffer.
The following snippet shows the problem, just put the cursor at the end of the 
comment (jsdoc parser required):

function MyBigFunc(param1,
                   param2) {
    const abc = 'def';
}
/**
 * Rapresent
 * @param {int} a dada
 */| <-- cursor here
var variablename = function(a) {
    console.log("text"); // dada
    /** dada */
    // dada
};

With php it is even worse because of the number of embedded languages.

Any idea?

Thanks.
Vincenzo