GNU bug report logs - #61142
29.0.60; java-ts-mode - Wrong indentation for the body of multiple lines conditions

Previous Next

Package: emacs;

Reported by: 太阳 <zjyzhaojiyang <at> hotmail.com>

Date: Sun, 29 Jan 2023 08:33:03 UTC

Severity: normal

Found in version 29.0.60

Fixed in version 29.1

Done: Theodor Thornhill <theo <at> thornhill.no>

Bug is archived. No further changes may be made.

Full log


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

From: Theodor Thornhill <theo <at> thornhill.no>
To: 太阳 <zjyzhaojiyang <at> hotmail.com>
Cc: 61142 <at> debbugs.gnu.org
Subject: Re: bug#61142: 29.0.60; java-ts-mode - Wrong indentation for the
 body of multiple lines conditions
Date: Sat, 04 Feb 2023 11:45:31 +0100
太阳 <zjyzhaojiyang <at> hotmail.com> writes:

> After reading treesit's manual, I found that we can use `n-p-gp` as the matcher
> and `grand-parent` as the anchor to match the body of `if` (and `while`, which
> has a similar issue).
>
> I mean a rule looks like the following:
>
> ```
> ((n-p-gp nil "block" "if_statement") grand-parent java-ts-mode-indent-offset)
> ```
>
>


Thanks!  We have a mechanism in place for this, see
'c-ts-common-statement-offset' in 'c-ts-common.el'.  I didn't get to it
yet, but I'll try to look at it this evening, unless you want to?  See
c-ts-mode for examples of how to use it, if you're interested!

Theo




This bug report was last modified 2 years and 112 days ago.

Previous Next


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