From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Bruce Stephens Newsgroups: gmane.emacs.bugs Subject: bug#59686: 30.0.50; tree-sitter indentation in some loops and conditional statements is wrong Date: Tue, 29 Nov 2022 18:41:27 +0000 Message-ID: Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="36809"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0) Gecko/20100101 Thunderbird/102.5.0 To: 59686@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Tue Nov 29 19:42:15 2022 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 1p05Yc-0009Lz-U5 for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 29 Nov 2022 19:42:15 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1p05YY-0007gC-A7; Tue, 29 Nov 2022 13:42:10 -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 1p05YT-0007g4-VH for bug-gnu-emacs@gnu.org; Tue, 29 Nov 2022 13:42:07 -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 1p05YR-00048r-4A for bug-gnu-emacs@gnu.org; Tue, 29 Nov 2022 13:42:05 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1p05YQ-0005Tg-01 for bug-gnu-emacs@gnu.org; Tue, 29 Nov 2022 13:42:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Bruce Stephens Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 29 Nov 2022 18:42:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 59686 X-GNU-PR-Package: emacs X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.166974730021048 (code B ref -1); Tue, 29 Nov 2022 18:42:01 +0000 Original-Received: (at submit) by debbugs.gnu.org; 29 Nov 2022 18:41:40 +0000 Original-Received: from localhost ([127.0.0.1]:55623 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1p05Y3-0005TQ-I6 for submit@debbugs.gnu.org; Tue, 29 Nov 2022 13:41:39 -0500 Original-Received: from lists.gnu.org ([209.51.188.17]:50858) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1p05Xz-0005TJ-9X for submit@debbugs.gnu.org; Tue, 29 Nov 2022 13:41:38 -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 1p05Xy-0007Qj-Im for bug-gnu-emacs@gnu.org; Tue, 29 Nov 2022 13:41:34 -0500 Original-Received: from statler.isode.com ([62.232.206.189]) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1p05Xw-0003rb-PY for bug-gnu-emacs@gnu.org; Tue, 29 Nov 2022 13:41:34 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; t=1669747288; d=isode.com; s=june2016; i=@isode.com; bh=OyaEOHNDpZw2XSAuwDq5IYT0ll4Z3ttKU76Olzwclm8=; h=From:Sender:Reply-To:Subject:Date:Message-ID:To:Cc:MIME-Version: In-Reply-To:References:Content-Type:Content-Transfer-Encoding: Content-ID:Content-Description; b=VZ9YLiKt/exqQHPzo6Vf1jvnI6tE9Kpuju/EsXjEuY3PzKCPZUb0XQMSNx26hlQfd1lIX/ LbdXGBhh67AFUOc3fWSmSxK16GIJl/gMMkhWgoPJGKvAA/BmZKb8ij7aQVAcobFUvGo8ap EMACIZ27m04fio9GK53X1cMAzJxCas4=; Original-Received: from [192.168.1.65] (84.230.200.146.dyn.plus.net [146.200.230.84]) by statler.isode.com (submission channel) via TCP with ESMTPSA id for ; Tue, 29 Nov 2022 18:41:28 +0000 Content-Language: en-GB Received-SPF: pass client-ip=62.232.206.189; envelope-from=bruce.stephens@isode.com; helo=statler.isode.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action 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:249422 Archived-At: With the following file I would expect foo(i) to be indented to just two indents (like the first one), but they are not. Similarly for many other compound statements where the opening spans more than one line. // -*- c-ts -*- int main() { =C2=A0=C2=A0 for (int i=3D0; i<10; ++i) { =C2=A0=C2=A0=C2=A0=C2=A0 foo(i); =C2=A0=C2=A0 } =C2=A0=C2=A0 for (int i=3D0; =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 i<10; =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 ++i) { =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 foo(i); =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 } } In GNU Emacs 30.0.50 (build 1, x86_64-apple-darwin21.6.0, NS appkit-2113.60 Version 12.6 (Build 21G115)) of 2022-11-29 built on Bruces-MacBook-Pro.local Repository revision: e90c21e6fb35d1c844c49d96f0b62c5fe55bb203 Repository branch: master Windowing system distributor 'Apple', version 10.3.2113 System Description: macOS 12.6 Configured using: 'configure --with-native-compilation=3Daot --with-tree-sitter' Configured features: ACL GIF GLIB GMP GNUTLS JPEG JSON LCMS2 LIBXML2 MODULES NATIVE_COMP NOTIFY KQUEUE NS PDUMPER PNG RSVG SQLITE3 THREADS TIFF TOOLKIT_SCROLL_BARS TREE_SITTER WEBP XIM ZLIB Important settings: value of $LANG: en_GB.UTF-8 locale-coding-system: utf-8-unix Major mode: C Minor modes in effect: tooltip-mode: t global-eldoc-mode: t show-paren-mode: t electric-indent-mode: t mouse-wheel-mode: t tool-bar-mode: t menu-bar-mode: t file-name-shadow-mode: t global-font-lock-mode: t font-lock-mode: t blink-cursor-mode: t line-number-mode: t indent-tabs-mode: t transient-mark-mode: t auto-composition-mode: t auto-encryption-mode: t auto-compression-mode: t Load-path shadows: None found. Features: (shadow sort mail-extr emacsbug message mailcap yank-media puny dired dired-loaddefs rfc822 mml mml-sec password-cache epa derived epg rfc6068 epg-config gnus-util text-property-search time-date mm-decode mm-bodies mm-encode mail-parse rfc2231 mailabbrev gmm-utils mailheader sendmail rfc2047 rfc2045 ietf-drums mm-util mail-prsvr mail-utils comp comp-cstr warnings icons subr-x rx cl-macs gv cl-extra help-mode bytecomp byte-compile c-ts-mode treesit cl-seq cl-loaddefs cl-lib rmc iso-transl tooltip cconv eldoc paren electric uniquify ediff-hook vc-hooks lisp-float-type elisp-mode mwheel term/ns-win ns-win ucs-normalize mule-util term/common-win tool-bar dnd fontset image regexp-opt fringe tabulated-list replace newcomment text-mode lisp-mode prog-mode register page tab-bar menu-bar rfn-eshadow isearch easymenu timer select scroll-bar mouse jit-lock font-lock syntax font-core term/tty-colors frame minibuffer nadvice seq simple cl-generic indonesian philippine cham georgian utf-8-lang misc-lang vietnamese tibetan thai tai-viet lao korean japanese eucjp-ms cp51932 hebrew greek romanian slovak czech european ethiopic indian cyrillic chinese composite emoji-zwj charscript charprop case-table epa-hook jka-cmpr-hook help abbrev obarray oclosure cl-preloaded button loaddefs theme-loaddefs faces cus-face macroexp files window text-properties overlay sha1 md5 base64 format env code-pages mule custom widget keymap hashtable-print-readable backquote threads kqueue cocoa ns lcms2 multi-tty make-network-process native-compile emacs) Memory information: ((conses 16 81423 9034) (symbols 48 7273 0) (strings 32 20423 1742) (string-bytes 1 634204) (vectors 16 17092) (vector-slots 8 341908 8957) (floats 8 32 58) (intervals 56 242 0) (buffers 992 12))