GNU bug report logs - #71760
31.0.50; Filling jsdoc text doesn't work in js-ts-mode

Previous Next

Package: emacs;

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

Date: Mon, 24 Jun 2024 20:24:02 UTC

Severity: normal

Merged with 71768

Found in version 31.0.50

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

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: help-debbugs <at> gnu.org (GNU bug Tracking System)
To: Yuan Fu <casouri <at> gmail.com>
Cc: tracker <at> debbugs.gnu.org
Subject: bug#71768: closed (31.0.50; Filling jsdoc text doesn't work in
 js-ts-mode)
Date: Sun, 04 Aug 2024 03:08:02 +0000
[Message part 1 (text/plain, inline)]
Your message dated Sat, 3 Aug 2024 20:05:30 -0700
with message-id <65638F2B-0895-4560-B41F-C22C0A7ADA4E <at> gmail.com>
and subject line Re: bug#71760: [PATCH] js-ts-mode: Fix filling of jsdoc blocks
has caused the debbugs.gnu.org bug report #71760,
regarding 31.0.50; Filling jsdoc text doesn't work in js-ts-mode
to be marked as done.

(If you believe you have received this mail in error, please contact
help-debbugs <at> gnu.org.)


-- 
71760: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=71760
GNU Bug Tracking System
Contact help-debbugs <at> gnu.org with problems
[Message part 2 (message/rfc822, inline)]
From: Damien Cassou <cassou <at> luz5.mail-host-address-is-not-set>
To: bug-gnu-emacs <at> gnu.org
Subject: 31.0.50; Filling jsdoc text doesn't work in js-ts-mode
Date: Mon, 24 Jun 2024 21:28:28 +0200
[Message part 3 (text/plain, inline)]
Hi,

in a commit recently merged in master (0edacf2aa7e53), js-ts-mode has
been improved to use the jsdoc treesitter grammar on documentation. Font
lock works great but M-q doesn't fill long lines.

To reproduce, make sure your Emacs contains the above-mentioned commit
and make sure you have the jsdoc treesitter grammar available. Then,
save the attached JavaScript file to your disk and execute:

$ emacs -Q --eval "(progn (find-file \"/home/cassou/tmp/test.js\") (js-ts-mode))"

Move point to the middle of line 2 (or line 4) and press M-q.

Expected: The paragraph is filled.

Actual: Nothing changes.

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.

I would be happy to implement something and send a patch but I have no
idea were to start.

-- 
Damien Cassou

"Success is the ability to go from one failure to another without
losing enthusiasm." --Winston Churchill
[test.js (text/javascript, attachment)]
[Message part 5 (message/rfc822, inline)]
From: Yuan Fu <casouri <at> gmail.com>
To: Dmitry Gutov <dmitry <at> gutov.dev>
Cc: Damien Cassou <damien <at> cassou.me>, 71760-done <at> debbugs.gnu.org
Subject: Re: bug#71760: [PATCH] js-ts-mode: Fix filling of jsdoc blocks
Date: Sat, 3 Aug 2024 20:05:30 -0700

> On Aug 3, 2024, at 8:14 AM, Dmitry Gutov <dmitry <at> gutov.dev> wrote:
> 
> On 03/08/2024 10:34, Yuan Fu wrote:
>>> I think Damien is saying that patch#2 from his submission is not necessary with your fix (commit 74bb1e5897f, IIUC).
>>> 
>>> So do you think it's a good idea to backport it to emacs-30?
>> I’d rather apply Damien’s patch to emacs-30, that’s a simple fix and doesn’t change the filling behavior. The change I applied to master is more substantial, and apparently introduced another regression that I now need to fix 🙁
> 
> Makes sense.
> 
> It would be great if you could do the applying - while I understand the tree-sitter part, I'm not quite familiar with the filling code, so not equipped to give it a "stamp of approval" myself.
> 
> Also, I would probably have to ask whether this patch if a replacement for that's been added to master, an addition, or a suitable alternative.

Of course. I applied the patch. And I think this report can be closed, so closing :-)

Yuan

This bug report was last modified 352 days ago.

Previous Next


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