GNU bug report logs - #71550
[PATCH] Add jsdoc support to js-ts-mode

Previous Next

Package: emacs;

Reported by: Damien Cassou <damien <at> cassou.me>

Date: Fri, 14 Jun 2024 12:34:02 UTC

Severity: normal

Tags: patch

Done: Dmitry Gutov <dmitry <at> gutov.dev>

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 71550 in the body.
You can then email your comments to 71550 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#71550; Package emacs. (Fri, 14 Jun 2024 12:34:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Damien Cassou <damien <at> cassou.me>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Fri, 14 Jun 2024 12:34:02 GMT) Full text and rfc822 format available.

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

From: Damien Cassou <damien <at> cassou.me>
To: bug-gnu-emacs <at> gnu.org
Subject: [PATCH] Add jsdoc support to js-ts-mode
Date: Fri, 14 Jun 2024 14:33:25 +0200
[Message part 1 (text/plain, inline)]
Tags: patch

Hi,

jsdoc [1] is a special syntax to document JavaScript code. The attached
patch adds a jsdoc parser and font-lock settings to files using the
`js-ts-mode' major mode if the jsdoc grammar is available. Before/after
screenshots are attached to this email.

[1] jsdoc: https://jsdoc.app/

The new code does *not* make `js-ts-mode' dependent on the availability
of the jsdoc grammar: instead, `js-ts-mode' will keep working as it
works today if the jsdoc grammar is absent.

The support for paragraph filling currently in master is broken because
the prefix '*' isn't added at the beginning of lines when filling
documentation blocks. I tried changing the value of
`c-ts-common--comment-regexp' to include "description" (as this is what
the jsdoc parser uses for text) but the result is worse. I also tried
reusing `js-fill-paragraph' but that fails as well. The result of this
patch is that `M-q' doesn't change anything anymore in these blocks. I
will report a bug and seek assistance to fix it if this patch is merged.

Best,

-- 
Damien Cassou

"Success is the ability to go from one failure to another without
losing enthusiasm." --Winston Churchill
[0001-Add-jsdoc-support-to-js-ts-mode.patch (text/patch, attachment)]
[after.png (image/png, attachment)]
[before.png (image/png, attachment)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#71550; Package emacs. (Fri, 21 Jun 2024 21:54:01 GMT) Full text and rfc822 format available.

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

From: Dmitry Gutov <dmitry <at> gutov.dev>
To: Damien Cassou <damien <at> cassou.me>, 71550 <at> debbugs.gnu.org,
 Eli Zaretskii <eliz <at> gnu.org>
Subject: Re: bug#71550: [PATCH] Add jsdoc support to js-ts-mode
Date: Sat, 22 Jun 2024 00:53:43 +0300
Eli, is this okay for master (Emacs 30), or should it wait until the 
release branch is cut?

On 14/06/2024 15:33, Damien Cassou wrote:
> Tags: patch
> 
> Hi,
> 
> jsdoc [1] is a special syntax to document JavaScript code. The attached
> patch adds a jsdoc parser and font-lock settings to files using the
> `js-ts-mode' major mode if the jsdoc grammar is available. Before/after
> screenshots are attached to this email.
> 
> [1] jsdoc: https://jsdoc.app/
> 
> The new code does *not* make `js-ts-mode' dependent on the availability
> of the jsdoc grammar: instead, `js-ts-mode' will keep working as it
> works today if the jsdoc grammar is absent.
> 
> The support for paragraph filling currently in master is broken because
> the prefix '*' isn't added at the beginning of lines when filling
> documentation blocks. I tried changing the value of
> `c-ts-common--comment-regexp' to include "description" (as this is what
> the jsdoc parser uses for text) but the result is worse. I also tried
> reusing `js-fill-paragraph' but that fails as well. The result of this
> patch is that `M-q' doesn't change anything anymore in these blocks. I
> will report a bug and seek assistance to fix it if this patch is merged.





Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#71550; Package emacs. (Sat, 22 Jun 2024 07:09:02 GMT) Full text and rfc822 format available.

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

From: Eli Zaretskii <eliz <at> gnu.org>
To: Dmitry Gutov <dmitry <at> gutov.dev>
Cc: damien <at> cassou.me, 71550 <at> debbugs.gnu.org
Subject: Re: bug#71550: [PATCH] Add jsdoc support to js-ts-mode
Date: Sat, 22 Jun 2024 10:08:42 +0300
> Date: Sat, 22 Jun 2024 00:53:43 +0300
> From: Dmitry Gutov <dmitry <at> gutov.dev>
> 
> Eli, is this okay for master (Emacs 30), or should it wait until the 
> release branch is cut?

It's okay to install this now, thanks.




Reply sent to Dmitry Gutov <dmitry <at> gutov.dev>:
You have taken responsibility. (Sun, 23 Jun 2024 22:33:02 GMT) Full text and rfc822 format available.

Notification sent to Damien Cassou <damien <at> cassou.me>:
bug acknowledged by developer. (Sun, 23 Jun 2024 22:33:02 GMT) Full text and rfc822 format available.

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

From: Dmitry Gutov <dmitry <at> gutov.dev>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: damien <at> cassou.me, 71550-done <at> debbugs.gnu.org
Subject: Re: bug#71550: [PATCH] Add jsdoc support to js-ts-mode
Date: Mon, 24 Jun 2024 01:32:40 +0300
On 22/06/2024 10:08, Eli Zaretskii wrote:
>> Date: Sat, 22 Jun 2024 00:53:43 +0300
>> From: Dmitry Gutov<dmitry <at> gutov.dev>
>>
>> Eli, is this okay for master (Emacs 30), or should it wait until the
>> release branch is cut?
> It's okay to install this now, thanks.

Thank you, I've pushed it to emacs-30.

And thanks do Damien!

The follow-ups (filling-related?) will go to separate reports.




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Mon, 22 Jul 2024 11:24:20 GMT) Full text and rfc822 format available.

This bug report was last modified 1 year and 59 days ago.

Previous Next


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