GNU bug report logs - #75456
31.0.50; Cannot find the definition of the predicate in `treesit-thing-settings'" sexp-list)

Previous Next

Package: emacs;

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

Date: Thu, 9 Jan 2025 09:51:02 UTC

Severity: normal

Found in version 31.0.50

Done: Yuan Fu <casouri <at> gmail.com>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 75456 in the body.
You can then email your comments to 75456 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-gnu-emacs <at> gnu.org:
bug#75456; Package emacs. (Thu, 09 Jan 2025 09:51:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Vincenzo Pupillo <v.pupillo <at> gmail.com>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Thu, 09 Jan 2025 09:51:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Vincenzo Pupillo <v.pupillo <at> gmail.com>
To: bug-gnu-emacs <at> gnu.org
Subject: 31.0.50;
 Cannot find the definition of the predicate in `treesit-thing-settings'"
 sexp-list)
Date: Thu, 09 Jan 2025 10:49:44 +0100
[Message part 1 (text/plain, inline)]
Ciao, 
this problem occurs with js-ts-mode when jsdoc is enabled. Occurs when you 
place the cursor in a comment highlighted by jsdoc.
This is the error message:

"treesit-show-paren-data--categorize: peculiar error: ("Cannot find the 
definition of the predicate in `treesit-thing-settings'" sexp-list)"

Could this be due to commit 493bb2eaf1610ec950e4a2f7229d6e1f939064b9 ?

GNU Emacs 31.0.50 (build 4, x86_64-pc-linux-gnu, GTK+ Version 3.24.43, cairo 
version 1.18.2) of 2025-01-09

Thanks.

Vincenzo
[js_sexp-list_issue.png (image/png, attachment)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#75456; Package emacs. (Thu, 09 Jan 2025 18:13:02 GMT) Full text and rfc822 format available.

Message #8 received at 75456 <at> debbugs.gnu.org (full text, mbox):

From: Juri Linkov <juri <at> linkov.net>
To: Vincenzo Pupillo <v.pupillo <at> gmail.com>
Cc: Yuan Fu <casouri <at> gmail.com>, 75456 <at> debbugs.gnu.org
Subject: Re: bug#75456: 31.0.50; Cannot find the definition of the predicate
 in `treesit-thing-settings'" sexp-list)
Date: Thu, 09 Jan 2025 20:10:28 +0200
> Ciao, 
> this problem occurs with js-ts-mode when jsdoc is enabled. Occurs when you 
> place the cursor in a comment highlighted by jsdoc.
> This is the error message:
>
> "treesit-show-paren-data--categorize: peculiar error: ("Cannot find the 
> definition of the predicate in `treesit-thing-settings'" sexp-list)"

Recently I fixed bug#75198 and tested it on your mhtml-ts-mode
where it works nicely, and (treesit-language-at (point))
returns e.g. 'css' on embedded css.

However, now I discovered that (treesit-language-at (point))
returns 'javascript' on embedded jsdoc parts of a js file.

I wonder is this intended?

Since 'treesit-node-match-p' uses node's parser, I could use
(treesit-parser-language (treesit-node-parser (treesit-node-at (point))))
that returns 'jsdoc'.

But first I'd like to know why treesit-language-at doesn't return the same?




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#75456; Package emacs. (Thu, 09 Jan 2025 22:43:02 GMT) Full text and rfc822 format available.

Message #11 received at 75456 <at> debbugs.gnu.org (full text, mbox):

From: Vincenzo Pupillo <v.pupillo <at> gmail.com>
To: Juri Linkov <juri <at> linkov.net>
Cc: Yuan Fu <casouri <at> gmail.com>, 75456 <at> debbugs.gnu.org
Subject: Re: bug#75456: 31.0.50;
 Cannot find the definition of the predicate in `treesit-thing-settings'"
 sexp-list)
Date: Thu, 09 Jan 2025 23:42:01 +0100
Ciao Juri,

In data giovedì 9 gennaio 2025 19:10:28 Ora standard dell’Europa centrale, 
Juri Linkov ha scritto:
> > Ciao,
> > this problem occurs with js-ts-mode when jsdoc is enabled. Occurs when you
> > place the cursor in a comment highlighted by jsdoc.
> > This is the error message:
> > 
> > "treesit-show-paren-data--categorize: peculiar error: ("Cannot find the
> > definition of the predicate in `treesit-thing-settings'" sexp-list)"
> 
> Recently I fixed bug#75198 and tested it on your mhtml-ts-mode
> where it works nicely, and (treesit-language-at (point))
> returns e.g. 'css' on embedded css.
> 
> However, now I discovered that (treesit-language-at (point))
> returns 'javascript' on embedded jsdoc parts of a js file.
> 
> I wonder is this intended?
> 
> Since 'treesit-node-match-p' uses node's parser, I could use
> (treesit-parser-language (treesit-node-parser (treesit-node-at (point))))
> that returns 'jsdoc'.
> 
> But first I'd like to know why treesit-language-at doesn't return the same?

Local parsers, like jsdoc or phpdoc, are "ignored" by several functions used 
by treesit. But I don't know in detail how treesit works.
I tried to return local parser languages ​​in the past, but both indentation 
and font-locking got messed up.
I just tried and the result is the same (maybe I did something wrong), and 
then treesit-parser-list also returns jsdoc as if it were a global parser.

@Yuan can be of more help.

Thanks.

Vincenzo







Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#75456; Package emacs. (Fri, 10 Jan 2025 03:25:01 GMT) Full text and rfc822 format available.

Message #14 received at 75456 <at> debbugs.gnu.org (full text, mbox):

From: Yuan Fu <casouri <at> gmail.com>
To: Vincenzo Pupillo <v.pupillo <at> gmail.com>
Cc: 75456 <at> debbugs.gnu.org, Juri Linkov <juri <at> linkov.net>
Subject: Re: bug#75456: 31.0.50; Cannot find the definition of the predicate
 in `treesit-thing-settings'" sexp-list)
Date: Thu, 9 Jan 2025 19:23:42 -0800

> On Jan 9, 2025, at 2:42 PM, Vincenzo Pupillo <v.pupillo <at> gmail.com> wrote:
> 
> Ciao Juri,
> 
> In data giovedì 9 gennaio 2025 19:10:28 Ora standard dell’Europa centrale, 
> Juri Linkov ha scritto:
>>> Ciao,
>>> this problem occurs with js-ts-mode when jsdoc is enabled. Occurs when you
>>> place the cursor in a comment highlighted by jsdoc.
>>> This is the error message:
>>> 
>>> "treesit-show-paren-data--categorize: peculiar error: ("Cannot find the
>>> definition of the predicate in `treesit-thing-settings'" sexp-list)"
>> 
>> Recently I fixed bug#75198 and tested it on your mhtml-ts-mode
>> where it works nicely, and (treesit-language-at (point))
>> returns e.g. 'css' on embedded css.
>> 
>> However, now I discovered that (treesit-language-at (point))
>> returns 'javascript' on embedded jsdoc parts of a js file.
>> 
>> I wonder is this intended?
>> 
>> Since 'treesit-node-match-p' uses node's parser, I could use
>> (treesit-parser-language (treesit-node-parser (treesit-node-at (point))))
>> that returns 'jsdoc'.
>> 
>> But first I'd like to know why treesit-language-at doesn't return the same?
> 
> Local parsers, like jsdoc or phpdoc, are "ignored" by several functions used 
> by treesit. But I don't know in detail how treesit works.
> I tried to return local parser languages ​​in the past, but both indentation 
> and font-locking got messed up.
> I just tried and the result is the same (maybe I did something wrong), and 
> then treesit-parser-list also returns jsdoc as if it were a global parser.
> 
> @Yuan can be of more help.
> 
> Thanks.
> 
> Vincenzo

If local parsers somehow doesn’t work, it’s a bug. What are the functions that ignore local parsers? And how exactly does indentation and font-lock mess up?

For indentation, there’s a special condition: if the largest node at point is a root node for the local parser, we don’t use it for matching indent rules, because it’s impossible to figure out how to indent it; instead, Emacs uses the host parser’s node at that point. (The logic is in treesit--indent-largest-node-at).

What do you mean by  treesit-parser-list also returns jsdoc as if it were a global parser? Does it return the jsdoc parser even you pass nil to the TAG parameter? If so, I think it’s because some treesit function accidentally created it when looking for a parser for jsdoc. I’ll try fix that.

Yuan



Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#75456; Package emacs. (Fri, 10 Jan 2025 13:51:02 GMT) Full text and rfc822 format available.

Message #17 received at 75456 <at> debbugs.gnu.org (full text, mbox):

From: Vincenzo Pupillo <v.pupillo <at> gmail.com>
To: Yuan Fu <casouri <at> gmail.com>
Cc: 75456 <at> debbugs.gnu.org, Juri Linkov <juri <at> linkov.net>
Subject: Re: bug#75456: 31.0.50;
 Cannot find the definition of the predicate in `treesit-thing-settings'"
 sexp-list)
Date: Fri, 10 Jan 2025 14:50:17 +0100
[Message part 1 (text/plain, inline)]
Ciao Yuan

In data venerdì 10 gennaio 2025 04:23:42 Ora standard dell’Europa centrale, 
Yuan Fu ha scritto:
> > On Jan 9, 2025, at 2:42 PM, Vincenzo Pupillo <v.pupillo <at> gmail.com> wrote:
> > 
> > Ciao Juri,
> > 
> > In data giovedì 9 gennaio 2025 19:10:28 Ora standard dell’Europa centrale,
> > 
> > Juri Linkov ha scritto:
> >>> Ciao,
> >>> this problem occurs with js-ts-mode when jsdoc is enabled. Occurs when
> >>> you
> >>> place the cursor in a comment highlighted by jsdoc.
> >>> This is the error message:
> >>> 
> >>> "treesit-show-paren-data--categorize: peculiar error: ("Cannot find the
> >>> definition of the predicate in `treesit-thing-settings'" sexp-list)"
> >> 
> >> Recently I fixed bug#75198 and tested it on your mhtml-ts-mode
> >> where it works nicely, and (treesit-language-at (point))
> >> returns e.g. 'css' on embedded css.
> >> 
> >> However, now I discovered that (treesit-language-at (point))
> >> returns 'javascript' on embedded jsdoc parts of a js file.
> >> 
> >> I wonder is this intended?
> >> 
> >> Since 'treesit-node-match-p' uses node's parser, I could use
> >> (treesit-parser-language (treesit-node-parser (treesit-node-at (point))))
> >> that returns 'jsdoc'.
> >> 
> >> But first I'd like to know why treesit-language-at doesn't return the
> >> same?
> > 
> > Local parsers, like jsdoc or phpdoc, are "ignored" by several functions
> > used by treesit. But I don't know in detail how treesit works.
> > I tried to return local parser languages ​​in the past, but both
> > indentation and font-locking got messed up.
> > I just tried and the result is the same (maybe I did something wrong), and
> > then treesit-parser-list also returns jsdoc as if it were a global parser.
> > 
> > @Yuan can be of more help.
> > 
> > Thanks.
> > 
> > Vincenzo
> 
> If local parsers somehow doesn’t work, it’s a bug. What are the functions
> that ignore local parsers? And how exactly does indentation and font-lock
> mess up?
> 
> For indentation, there’s a special condition: if the largest node at point
> is a root node for the local parser, we don’t use it for matching indent
> rules, because it’s impossible to figure out how to indent it; instead,
> Emacs uses the host parser’s node at that point. (The logic is in
> treesit--indent-largest-node-at).
> 
> What do you mean by  treesit-parser-list also returns jsdoc as if it were a
> global parser? Does it return the jsdoc parser even you pass nil to the TAG
> parameter? If so, I think it’s because some treesit function accidentally
> created it when looking for a parser for jsdoc. I’ll try fix that.
> 
> Yuan
As I wrote I might have made some mistakes (I tried with the new version of 
mhtml-ts-mode which is more complicated than js-ts-mode). So I preferred to 
write a patch for js-ts-mode. I could not replicate the indentation problems 
but only the font-locking ones.
If you try with the attached javascript file (setting treesit-font-lock-level 
to 4) you will see the problem and if you invoke (treesit-parser-list) you 
will see that jsdoc also appears in the list.


Vincenzo

p.s. Gmail doesn't like my .js file so I wrote it below:
/**
 * Foo
 * @param {int} a blah blah
 */
var foo = function(a) {
    console.log(a); // blah blah
};


/**
 * Bar
 * @param {int} a blah blah
 */
var bar = function(a) {
    console.log(a); // blah blah
};

[0001-language-at-point-function-that-handles-local-parser.patch (text/x-patch, attachment)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#75456; Package emacs. (Sat, 18 Jan 2025 06:28:03 GMT) Full text and rfc822 format available.

Message #20 received at 75456 <at> debbugs.gnu.org (full text, mbox):

From: Yuan Fu <casouri <at> gmail.com>
To: Vincenzo Pupillo <v.pupillo <at> gmail.com>
Cc: 75456 <at> debbugs.gnu.org, Juri Linkov <juri <at> linkov.net>
Subject: Re: bug#75456: 31.0.50; Cannot find the definition of the predicate
 in `treesit-thing-settings'" sexp-list)
Date: Fri, 17 Jan 2025 22:27:32 -0800

> On Jan 10, 2025, at 5:50 AM, Vincenzo Pupillo <v.pupillo <at> gmail.com> wrote:
> 
> Ciao Yuan
> 
> In data venerdì 10 gennaio 2025 04:23:42 Ora standard dell’Europa centrale, 
> Yuan Fu ha scritto:
>>> On Jan 9, 2025, at 2:42 PM, Vincenzo Pupillo <v.pupillo <at> gmail.com> wrote:
>>> 
>>> Ciao Juri,
>>> 
>>> In data giovedì 9 gennaio 2025 19:10:28 Ora standard dell’Europa centrale,
>>> 
>>> Juri Linkov ha scritto:
>>>>> Ciao,
>>>>> this problem occurs with js-ts-mode when jsdoc is enabled. Occurs when
>>>>> you
>>>>> place the cursor in a comment highlighted by jsdoc.
>>>>> This is the error message:
>>>>> 
>>>>> "treesit-show-paren-data--categorize: peculiar error: ("Cannot find the
>>>>> definition of the predicate in `treesit-thing-settings'" sexp-list)"
>>>> 
>>>> Recently I fixed bug#75198 and tested it on your mhtml-ts-mode
>>>> where it works nicely, and (treesit-language-at (point))
>>>> returns e.g. 'css' on embedded css.
>>>> 
>>>> However, now I discovered that (treesit-language-at (point))
>>>> returns 'javascript' on embedded jsdoc parts of a js file.
>>>> 
>>>> I wonder is this intended?
>>>> 
>>>> Since 'treesit-node-match-p' uses node's parser, I could use
>>>> (treesit-parser-language (treesit-node-parser (treesit-node-at (point))))
>>>> that returns 'jsdoc'.
>>>> 
>>>> But first I'd like to know why treesit-language-at doesn't return the
>>>> same?
>>> 
>>> Local parsers, like jsdoc or phpdoc, are "ignored" by several functions
>>> used by treesit. But I don't know in detail how treesit works.
>>> I tried to return local parser languages ​​in the past, but both
>>> indentation and font-locking got messed up.
>>> I just tried and the result is the same (maybe I did something wrong), and
>>> then treesit-parser-list also returns jsdoc as if it were a global parser.
>>> 
>>> @Yuan can be of more help.
>>> 
>>> Thanks.
>>> 
>>> Vincenzo
>> 
>> If local parsers somehow doesn’t work, it’s a bug. What are the functions
>> that ignore local parsers? And how exactly does indentation and font-lock
>> mess up?
>> 
>> For indentation, there’s a special condition: if the largest node at point
>> is a root node for the local parser, we don’t use it for matching indent
>> rules, because it’s impossible to figure out how to indent it; instead,
>> Emacs uses the host parser’s node at that point. (The logic is in
>> treesit--indent-largest-node-at).
>> 
>> What do you mean by  treesit-parser-list also returns jsdoc as if it were a
>> global parser? Does it return the jsdoc parser even you pass nil to the TAG
>> parameter? If so, I think it’s because some treesit function accidentally
>> created it when looking for a parser for jsdoc. I’ll try fix that.
>> 
>> Yuan
> As I wrote I might have made some mistakes (I tried with the new version of 
> mhtml-ts-mode which is more complicated than js-ts-mode). So I preferred to 
> write a patch for js-ts-mode. I could not replicate the indentation problems 
> but only the font-locking ones.
> If you try with the attached javascript file (setting treesit-font-lock-level 
> to 4) you will see the problem and if you invoke (treesit-parser-list) you 
> will see that jsdoc also appears in the list.
> 
> 
> Vincenzo
> 
> p.s. Gmail doesn't like my .js file so I wrote it below:
> /**
> * Foo
> * @param {int} a blah blah
> */
> var foo = function(a) {
>    console.log(a); // blah blah
> };
> 
> 
> /**
> * Bar
> * @param {int} a blah blah
> */
> var bar = function(a) {
>    console.log(a); // blah blah
> };
> 
> <0001-language-at-point-function-that-handles-local-parser.patch>

I just pushed a fix, now you shouldn’t see jsdoc parsers anymore. Can you see if this fixes the problem you had?

Yuan



Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#75456; Package emacs. (Sat, 18 Jan 2025 16:54:01 GMT) Full text and rfc822 format available.

Message #23 received at 75456 <at> debbugs.gnu.org (full text, mbox):

From: Vincenzo Pupillo <v.pupillo <at> gmail.com>
To: Yuan Fu <casouri <at> gmail.com>
Cc: 75456 <at> debbugs.gnu.org, Juri Linkov <juri <at> linkov.net>
Subject: Re: bug#75456: 31.0.50;
 Cannot find the definition of the predicate in `treesit-thing-settings'"
 sexp-list)
Date: Sat, 18 Jan 2025 17:52:53 +0100
Ciao Yuan,

In data sabato 18 gennaio 2025 07:27:32 Ora standard dell’Europa centrale, 
Yuan Fu ha scritto:
> ....
> 
> I just pushed a fix, now you shouldn’t see jsdoc parsers anymore. Can you
> see if this fixes the problem you had?
> 
I only tested js.el with 0001-language-at-point-function-that-handles-local-
parser.patch
I tested only js.el with the 0001-language-at-point-function-that-handles-
local-parser.patch because it was less complex. The font-locking is ok but the 
indentation of jsdoc type comments breaks because there are no specific rules 
(for jsdoc) and also this message appears:

Error running timer 'show-paren-function': (treesit-no-parser jsdoc)

The comment:
;; 2. In most cases, a function shouldn't implicitly create a parser.
;; All parsers should be created explicitly by user.

Does this imply that we need to create local parsers as well?


> Yuan








Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#75456; Package emacs. (Mon, 20 Jan 2025 07:00:03 GMT) Full text and rfc822 format available.

Message #26 received at 75456 <at> debbugs.gnu.org (full text, mbox):

From: Yuan Fu <casouri <at> gmail.com>
To: Vincenzo Pupillo <v.pupillo <at> gmail.com>
Cc: 75456 <at> debbugs.gnu.org, Juri Linkov <juri <at> linkov.net>
Subject: Re: bug#75456: 31.0.50; Cannot find the definition of the predicate
 in `treesit-thing-settings'" sexp-list)
Date: Sun, 19 Jan 2025 22:59:34 -0800

> On Jan 18, 2025, at 8:52 AM, Vincenzo Pupillo <v.pupillo <at> gmail.com> wrote:
> 
> Ciao Yuan,
> 
> In data sabato 18 gennaio 2025 07:27:32 Ora standard dell’Europa centrale, 
> Yuan Fu ha scritto:
>> ....
>> 
>> I just pushed a fix, now you shouldn’t see jsdoc parsers anymore. Can you
>> see if this fixes the problem you had?
>> 
> I only tested js.el with 0001-language-at-point-function-that-handles-local-
> parser.patch
> I tested only js.el with the 0001-language-at-point-function-that-handles-
> local-parser.patch because it was less complex. The font-locking is ok but the 
> indentation of jsdoc type comments breaks because there are no specific rules 
> (for jsdoc) and also this message appears:
> 
> Error running timer 'show-paren-function': (treesit-no-parser jsdoc)
> 
> The comment:
> ;; 2. In most cases, a function shouldn't implicitly create a parser.
> ;; All parsers should be created explicitly by user.
> 
> Does this imply that we need to create local parsers as well?

No, that means treesit.el has a bug. I’ll fix it.

Yuan



Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#75456; Package emacs. (Tue, 28 Jan 2025 01:38:01 GMT) Full text and rfc822 format available.

Message #29 received at 75456 <at> debbugs.gnu.org (full text, mbox):

From: Yuan Fu <casouri <at> gmail.com>
To: Vincenzo Pupillo <v.pupillo <at> gmail.com>
Cc: 75456 <at> debbugs.gnu.org, Juri Linkov <juri <at> linkov.net>
Subject: Re: bug#75456: 31.0.50; Cannot find the definition of the predicate
 in `treesit-thing-settings'" sexp-list)
Date: Mon, 27 Jan 2025 17:37:32 -0800

> On Jan 19, 2025, at 10:59 PM, Yuan Fu <casouri <at> gmail.com> wrote:
> 
> 
> 
>> On Jan 18, 2025, at 8:52 AM, Vincenzo Pupillo <v.pupillo <at> gmail.com> wrote:
>> 
>> Ciao Yuan,
>> 
>> In data sabato 18 gennaio 2025 07:27:32 Ora standard dell’Europa centrale, 
>> Yuan Fu ha scritto:
>>> ....
>>> 
>>> I just pushed a fix, now you shouldn’t see jsdoc parsers anymore. Can you
>>> see if this fixes the problem you had?
>>> 
>> I only tested js.el with 0001-language-at-point-function-that-handles-local-
>> parser.patch
>> I tested only js.el with the 0001-language-at-point-function-that-handles-
>> local-parser.patch because it was less complex. The font-locking is ok but the 
>> indentation of jsdoc type comments breaks because there are no specific rules 
>> (for jsdoc) and also this message appears:
>> 
>> Error running timer 'show-paren-function': (treesit-no-parser jsdoc)
>> 
>> The comment:
>> ;; 2. In most cases, a function shouldn't implicitly create a parser.
>> ;; All parsers should be created explicitly by user.
>> 
>> Does this imply that we need to create local parsers as well?
> 
> No, that means treesit.el has a bug. I’ll fix it.
> 
> Yuan

Ok, so it’s two-fold. I fixed the problem that caused the treesit-no-parser error on emacs-30 a few days ago, it should be on master now.

As for jsdoc not having indentation rules, I think the right solution is to add comment indentation rules for jsdoc too. You can just copy the rules from js-ts-mode, js-ts-mode uses the canned rules from c-ts-common.el anyway.

Yuan



Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#75456; Package emacs. (Tue, 28 Jan 2025 01:59:02 GMT) Full text and rfc822 format available.

Message #32 received at 75456 <at> debbugs.gnu.org (full text, mbox):

From: Yuan Fu <casouri <at> gmail.com>
To: Vincenzo Pupillo <v.pupillo <at> gmail.com>
Cc: 75456 <at> debbugs.gnu.org, Juri Linkov <juri <at> linkov.net>
Subject: Re: bug#75456: 31.0.50; Cannot find the definition of the predicate
 in `treesit-thing-settings'" sexp-list)
Date: Mon, 27 Jan 2025 17:58:00 -0800

> On Jan 27, 2025, at 5:37 PM, Yuan Fu <casouri <at> gmail.com> wrote:
> 
> 
> 
>> On Jan 19, 2025, at 10:59 PM, Yuan Fu <casouri <at> gmail.com> wrote:
>> 
>> 
>> 
>>> On Jan 18, 2025, at 8:52 AM, Vincenzo Pupillo <v.pupillo <at> gmail.com> wrote:
>>> 
>>> Ciao Yuan,
>>> 
>>> In data sabato 18 gennaio 2025 07:27:32 Ora standard dell’Europa centrale, 
>>> Yuan Fu ha scritto:
>>>> ....
>>>> 
>>>> I just pushed a fix, now you shouldn’t see jsdoc parsers anymore. Can you
>>>> see if this fixes the problem you had?
>>>> 
>>> I only tested js.el with 0001-language-at-point-function-that-handles-local-
>>> parser.patch
>>> I tested only js.el with the 0001-language-at-point-function-that-handles-
>>> local-parser.patch because it was less complex. The font-locking is ok but the 
>>> indentation of jsdoc type comments breaks because there are no specific rules 
>>> (for jsdoc) and also this message appears:
>>> 
>>> Error running timer 'show-paren-function': (treesit-no-parser jsdoc)
>>> 
>>> The comment:
>>> ;; 2. In most cases, a function shouldn't implicitly create a parser.
>>> ;; All parsers should be created explicitly by user.
>>> 
>>> Does this imply that we need to create local parsers as well?
>> 
>> No, that means treesit.el has a bug. I’ll fix it.
>> 
>> Yuan
> 
> Ok, so it’s two-fold. I fixed the problem that caused the treesit-no-parser error on emacs-30 a few days ago, it should be on master now.
> 
> As for jsdoc not having indentation rules, I think the right solution is to add comment indentation rules for jsdoc too. You can just copy the rules from js-ts-mode, js-ts-mode uses the canned rules from c-ts-common.el anyway.

Sorry, I lied, turns out I haven’t pushed the patch to emacs-30 yet. I did that just now. It should be on master in a few days.

Yuan



Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#75456; Package emacs. (Fri, 31 Jan 2025 07:33:02 GMT) Full text and rfc822 format available.

Message #35 received at 75456 <at> debbugs.gnu.org (full text, mbox):

From: Juri Linkov <juri <at> linkov.net>
To: Yuan Fu <casouri <at> gmail.com>
Cc: 75456 <at> debbugs.gnu.org, Vincenzo Pupillo <v.pupillo <at> gmail.com>
Subject: Re: bug#75456: 31.0.50; Cannot find the definition of the predicate
 in `treesit-thing-settings'" sexp-list)
Date: Fri, 31 Jan 2025 09:30:37 +0200
>> Does this imply that we need to create local parsers as well?
>
> No, that means treesit.el has a bug. I’ll fix it.

bug#72388 revealed the same problem:

(treesit-parser-language (treesit-node-parser (treesit-node-at (point))))
returns 'doxygen'
but
(treesit-language-at (point))
returns 'c'




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#75456; Package emacs. (Mon, 03 Feb 2025 21:33:01 GMT) Full text and rfc822 format available.

Message #38 received at 75456 <at> debbugs.gnu.org (full text, mbox):

From: Vincenzo Pupillo <v.pupillo <at> gmail.com>
To: Yuan Fu <casouri <at> gmail.com>
Cc: 75456 <at> debbugs.gnu.org, Juri Linkov <juri <at> linkov.net>
Subject: Re: bug#75456: 31.0.50;
 Cannot find the definition of the predicate in `treesit-thing-settings'"
 sexp-list)
Date: Mon, 03 Feb 2025 22:32:07 +0100
[Message part 1 (text/plain, inline)]
Ciao Yuan, thank you!
The attached patch solves the problem. I will fix php-ts-mode and
mhtml-ts-mode in the next few days.

Vincenzo

In data martedì 28 gennaio 2025 02:58:00 Ora standard dell’Europa centrale, 
Yuan Fu ha scritto:
> > On Jan 27, 2025, at 5:37 PM, Yuan Fu <casouri <at> gmail.com> wrote:
> >> On Jan 19, 2025, at 10:59 PM, Yuan Fu <casouri <at> gmail.com> wrote:
> >>> On Jan 18, 2025, at 8:52 AM, Vincenzo Pupillo <v.pupillo <at> gmail.com>
> >>> wrote:
> >>> 
> >>> Ciao Yuan,
> >>> 
> >>> In data sabato 18 gennaio 2025 07:27:32 Ora standard dell’Europa
> >>> centrale,
> >>> 
> >>> Yuan Fu ha scritto:
> >>>> ....
> >>>> 
> >>>> I just pushed a fix, now you shouldn’t see jsdoc parsers anymore. Can
> >>>> you
> >>>> see if this fixes the problem you had?
> >>> 
> >>> I only tested js.el with
> >>> 0001-language-at-point-function-that-handles-local- parser.patch
> >>> I tested only js.el with the
> >>> 0001-language-at-point-function-that-handles-
> >>> local-parser.patch because it was less complex. The font-locking is ok
> >>> but the indentation of jsdoc type comments breaks because there are no
> >>> specific rules (for jsdoc) and also this message appears:
> >>> 
> >>> Error running timer 'show-paren-function': (treesit-no-parser jsdoc)
> >>> 
> >>> The comment:
> >>> ;; 2. In most cases, a function shouldn't implicitly create a parser.
> >>> ;; All parsers should be created explicitly by user.
> >>> 
> >>> Does this imply that we need to create local parsers as well?
> >> 
> >> No, that means treesit.el has a bug. I’ll fix it.
> >> 
> >> Yuan
> > 
> > Ok, so it’s two-fold. I fixed the problem that caused the
> > treesit-no-parser error on emacs-30 a few days ago, it should be on
> > master now.
> > 
> > As for jsdoc not having indentation rules, I think the right solution is
> > to add comment indentation rules for jsdoc too. You can just copy the
> > rules from js-ts-mode, js-ts-mode uses the canned rules from
> > c-ts-common.el anyway.
> Sorry, I lied, turns out I haven’t pushed the patch to emacs-30 yet. I did
> that just now. It should be on master in a few days.
> 
> Yuan

[0001-Correctly-handled-the-local-parser-for-jsdoc.patch (text/x-patch, attachment)]

Reply sent to Yuan Fu <casouri <at> gmail.com>:
You have taken responsibility. (Fri, 07 Feb 2025 01:59:02 GMT) Full text and rfc822 format available.

Notification sent to Vincenzo Pupillo <v.pupillo <at> gmail.com>:
bug acknowledged by developer. (Fri, 07 Feb 2025 01:59:02 GMT) Full text and rfc822 format available.

Message #43 received at 75456-done <at> debbugs.gnu.org (full text, mbox):

From: Yuan Fu <casouri <at> gmail.com>
To: Vincenzo Pupillo <v.pupillo <at> gmail.com>
Cc: 75456-done <at> debbugs.gnu.org, Juri Linkov <juri <at> linkov.net>
Subject: Re: bug#75456: 31.0.50; Cannot find the definition of the predicate
 in `treesit-thing-settings'" sexp-list)
Date: Thu, 6 Feb 2025 17:58:14 -0800

> On Feb 3, 2025, at 1:32 PM, Vincenzo Pupillo <v.pupillo <at> gmail.com> wrote:
> 
> Ciao Yuan, thank you!
> The attached patch solves the problem. I will fix php-ts-mode and
> mhtml-ts-mode in the next few days.

Thanks! Merged to master.

Yuan



bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Fri, 07 Mar 2025 12:24:13 GMT) Full text and rfc822 format available.

This bug report was last modified 107 days ago.

Previous Next


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