unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#71760: 31.0.50; Filling jsdoc text doesn't work in js-ts-mode
@ 2024-06-24 20:23 Damien Cassou
  2024-07-29 19:36 ` bug#71760: [PATCH] js-ts-mode: Fix filling of jsdoc blocks Damien Cassou
  0 siblings, 1 reply; 11+ messages in thread
From: Damien Cassou @ 2024-06-24 20:23 UTC (permalink / raw)
  To: 71760

[-- Attachment #1: Type: text/plain, Size: 1050 bytes --]

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

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: test.js --]
[-- Type: text/javascript, Size: 227 bytes --]

/**
 * Test. rat art srs tr tr st rst artsar t arstienartsioenaroti eanrtsoi aerntso iaerst
 *
 * @param {string} bla - Some documentation of this parameter. ar tar star tsa rst arstar st arst art rs
 */
function f(bla) {
}




^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2024-08-04  3:05 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-06-24 20:23 bug#71760: 31.0.50; Filling jsdoc text doesn't work in js-ts-mode Damien Cassou
2024-07-29 19:36 ` bug#71760: [PATCH] js-ts-mode: Fix filling of jsdoc blocks Damien Cassou
2024-07-31  8:25   ` Damien Cassou
2024-08-01  1:00     ` Dmitry Gutov
2024-08-01  1:07       ` Yuan Fu
2024-08-01  7:36         ` Yuan Fu
2024-08-01 10:26           ` Damien Cassou
2024-08-01 21:26           ` Dmitry Gutov
2024-08-03  7:34             ` Yuan Fu
2024-08-03 15:14               ` Dmitry Gutov
2024-08-04  3:05                 ` Yuan Fu

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).