From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Theodor Thornhill via "Bug reports for GNU Emacs, the Swiss army knife of text editors" Newsgroups: gmane.emacs.bugs Subject: 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 Message-ID: <87wn4x7lpw.fsf_-_@thornhill.no> References: Reply-To: Theodor Thornhill Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="27590"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 61142@debbugs.gnu.org To: =?UTF-8?Q?=E5=A4=AA=E9=98=B3?= Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sat Feb 04 11:46:27 2023 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pOG3u-0006zt-Sd for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 04 Feb 2023 11:46:27 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pOG3Y-0008Vn-87; Sat, 04 Feb 2023 05:46:04 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pOG3W-0008VT-UI for bug-gnu-emacs@gnu.org; Sat, 04 Feb 2023 05:46:02 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pOG3W-0005J0-Lu for bug-gnu-emacs@gnu.org; Sat, 04 Feb 2023 05:46:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1pOG3W-0001T9-7E for bug-gnu-emacs@gnu.org; Sat, 04 Feb 2023 05:46:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Theodor Thornhill Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 04 Feb 2023 10:46:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 61142 X-GNU-PR-Package: emacs Original-Received: via spool by 61142-submit@debbugs.gnu.org id=B61142.16755075375615 (code B ref 61142); Sat, 04 Feb 2023 10:46:02 +0000 Original-Received: (at 61142) by debbugs.gnu.org; 4 Feb 2023 10:45:37 +0000 Original-Received: from localhost ([127.0.0.1]:40757 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pOG36-0001SV-QU for submit@debbugs.gnu.org; Sat, 04 Feb 2023 05:45:37 -0500 Original-Received: from out-36.mta0.migadu.com ([91.218.175.36]:50415) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pOG34-0001SN-SI for 61142@debbugs.gnu.org; Sat, 04 Feb 2023 05:45:35 -0500 X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=thornhill.no; s=key1; t=1675507533; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=acKdWCjHgIMAshk7hOAD5c0QDLXzKqpj4b/SGSmTyDw=; b=YvORqm+u3Rjc0OEE86Q6JWOpA6xapkzHwu6WewL12W1eP3phn+7FBxDn9GsANdNnpmEwZc cbUUOa+PzX1rrfuzq2TUDgOfbHCfkJ/1zYPlPBxgkNMkxiQ+Gg6RuLIvFAtCIA0aYyTFbl rBiqVCubLvAlcwkNYPa6fiJyDz5TTj751U6CMKUVIDop25WoNOpHCcAO6CLHGNpGC4MDbF 1nkFOH0ZfDx7I1AMpgVRDUi8F+ETZ1DLnkDBX4Fexl+Bgj5LtJraw0PwIwYrucXZwh5c5D 2Ul61L/w5ncUGDBzydEB99JZq/RetF5OeBD3ncyYeXrVOVOhTZPNRAq0jd4JpQ== In-Reply-To: ("=?UTF-8?Q?=E5=A4=AA=E9=98=B3?="'s message of "Wed, 01 Feb 2023 08:46:28 +0000") X-Migadu-Flow: FLOW_OUT X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:254767 Archived-At: =E5=A4=AA=E9=98=B3 writes: > After reading treesit's manual, I found that we can use `n-p-gp` as the m= atcher > 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-off= set) > ``` > > 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