GNU bug report logs - #77906
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)

Previous Next

Package: emacs;

Reported by: Vincenzo Pupillo <v.pupillo <at> gmail.com>

Date: Fri, 18 Apr 2025 18:58:05 UTC

Severity: normal

Fixed in version 31.0.50

Done: Juri Linkov <juri <at> linkov.net>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Yuan Fu <casouri <at> gmail.com>
To: Juri Linkov <juri <at> linkov.net>
Cc: Vincenzo Pupillo <v.pupillo <at> gmail.com>, 77906 <at> debbugs.gnu.org
Subject: bug#77906: 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)
Date: Sun, 20 Apr 2025 07:55:04 -0700

> On Apr 19, 2025, at 11:19 PM, Juri Linkov <juri <at> linkov.net> wrote:
> 
>> 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?
> 
> I noticed the same problem that the end of a range
> unexpectedly belongs to its host that breaks many things
> such as navigation to the start of the embedded root node
> from its end.  Instead it uses the host node.
> 
> Maybe point at the end of the range should belong
> to the embedded parser?

The end position of a region has always been considered not part of a region, not only in Emacs, but pretty much everywhere. Let’s fix treesit-show-paren-data—categorize instead. We can add optional arguments to treesit-language-at and friends to make it easier to handle the end-of-range case.

Yuan



This bug report was last modified 5 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.