GNU bug report logs - #77727
tsx-ts-mode: fill-paragraph doesn't work for doc-comments

Previous Next

Package: emacs;

Reported by: Konstantin Kharlamov <Hi-Angel <at> yandex.ru>

Date: Fri, 11 Apr 2025 08:12:02 UTC

Severity: normal

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: Konstantin Kharlamov <Hi-Angel <at> yandex.ru>
To: 77727 <at> debbugs.gnu.org, casouri <at> gmail.com
Subject: bug#77727: [PATCH] Limit rust-ts-specific comment-start check to rust-ts (bug#77727)
Date: Fri, 11 Apr 2025 14:51:44 +0300
[Message part 1 (text/plain, inline)]
On Fri, 2025-04-11 at 11:34 +0300, Konstantin Kharlamov wrote:
> CC: Yuan Fu as the author of the code in question.
> 
> What happens in the code makes sense: since the comment resides at
> top-
> level, the parent of any top-level statement (returned by (treesit-
> node-parent node)) is, well, beginning of a buffer.
> 
> So the question is, why the check works that way.

Please see the attached patch, it'd seem this is exactly the fix that's
expected here. Basically, the problematic check is specific to Rust
treesitter mode, so shouldn't be executed in other languages. The patch
factors out the entire check to a separate function and adds additional
condition of (eq major-mode 'rust-ts-mode).

Tested in tsx-ts-mode, it fixes the problem.
[1.patch (text/x-patch, attachment)]

This bug report was last modified 31 days ago.

Previous Next


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