From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Yuan Fu Newsgroups: gmane.emacs.bugs Subject: bug#73376: Treesitter does not rescan after indentation Date: Fri, 20 Sep 2024 21:20:49 -0700 Message-ID: <8AD9587C-1C21-41A0-93EF-84B227C24A72@gmail.com> References: <8734lustbc.fsf@gmail.com> Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3776.700.51\)) 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="5338"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 73376@debbugs.gnu.org To: pranshu sharma Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sat Sep 21 06:23:00 2024 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 1srre7-0001Fo-Jc for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 21 Sep 2024 06:23:00 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1srrdt-0003dm-2a; Sat, 21 Sep 2024 00:22:45 -0400 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 1srrdr-0003db-QW for bug-gnu-emacs@gnu.org; Sat, 21 Sep 2024 00:22:43 -0400 Original-Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1srrdr-0003J7-I2 for bug-gnu-emacs@gnu.org; Sat, 21 Sep 2024 00:22:43 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=debbugs.gnu.org; s=debbugs-gnu-org; h=References:Date:In-Reply-To:From:Mime-Version:To:Subject; bh=puX+nz+WwpKouJSPf8vwWqmvzEQpYE5i7xBH5Hrwes8=; b=S7CMndWfLCPw1K1+ECEmKMR32iSAzvChIsuroBz4SzSAPUoI4Kxr5LQ0nYIP0M+d2f0hlCzVvRpzP7eyPXL5NwD99lA2khr6aSm4BE/9M6BWXNcDngJS64QDZ//gBVNrCzC3fm81G/LoUhKvljDf80Rn5sIFuLpbVzXy11j5IoP2PnnTcViCHuyvMsu8rxeBlmZZPa+SMGBKe2fPI18yw1y1mRS8H6C1LIADdeVxe6fb4A5UDMQC4t+LkTPS7ijOTj6FH8ZIEbKrSyh+dUOrrTmjMYlML70u4zVe0eeD3itOFlBaFV+qANGOEUgskWmyDnc46YL0n4CIxXkF8RefFQ==; Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1srreA-0002cc-Ka for bug-gnu-emacs@gnu.org; Sat, 21 Sep 2024 00:23:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Yuan Fu Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 21 Sep 2024 04:23:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 73376 X-GNU-PR-Package: emacs Original-Received: via spool by 73376-submit@debbugs.gnu.org id=B73376.172689254810036 (code B ref 73376); Sat, 21 Sep 2024 04:23:02 +0000 Original-Received: (at 73376) by debbugs.gnu.org; 21 Sep 2024 04:22:28 +0000 Original-Received: from localhost ([127.0.0.1]:36883 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1srrdc-0002bo-Gk for submit@debbugs.gnu.org; Sat, 21 Sep 2024 00:22:28 -0400 Original-Received: from mail-pl1-f175.google.com ([209.85.214.175]:52229) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1srrda-0002bY-H6 for 73376@debbugs.gnu.org; Sat, 21 Sep 2024 00:22:26 -0400 Original-Received: by mail-pl1-f175.google.com with SMTP id d9443c01a7336-2053525bd90so26701065ad.0 for <73376@debbugs.gnu.org>; Fri, 20 Sep 2024 21:22:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1726892461; x=1727497261; darn=debbugs.gnu.org; h=to:references:message-id:content-transfer-encoding:cc:date :in-reply-to:from:subject:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=puX+nz+WwpKouJSPf8vwWqmvzEQpYE5i7xBH5Hrwes8=; b=FqbkPSDqTEdDESJweax9nc0cmX5oEwXh4cUuPcBmAQgFZD+5I4uYVQ/Uw+9FCPfR26 gNLrhreRHqQ9tegXIagcEzLVv2vy2G3AqAshhjEccIPk6Ep6edPtIIJ4EXGpDR+9yqUX aoLaVfNffCxUp7CEu+O6MIrZBPyXt2U7IqMv0q4HXHg4jNvDWO3jhBpOimzS/yiqYF0V OcDAMv9deWesxDeOavebaIDIIf1ph+/q6/0Wk7jyteizQGW4PFXX2UO87dQ2pfsTxbZt yRvqlFEuwjpU6QsFIuauSGPPI9n5epfobF+GDqGgI8w72l4y5jCU6/mYG1SwSfuOZMMU /c6Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1726892461; x=1727497261; h=to:references:message-id:content-transfer-encoding:cc:date :in-reply-to:from:subject:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=puX+nz+WwpKouJSPf8vwWqmvzEQpYE5i7xBH5Hrwes8=; b=cr4N1SRQOWzLukdxwyTSo9xaukQKUDAfHfpHaMBHg6LtTBFDryyoyFkQcgKscQyPf7 OP7lpX7Jl2hBBoydBh3eXrgWZ7+zRBOxB19OEU55kSyt6OQFfnrf+BslcEwdJPOoXWcR Kb6cvOpOJAqU5a9pMWYeql+9H4NVn6ZYveYi0rgE2LfldHmzGglJw9++TC/iMgjplBx0 xwPdE1Wjx+LKWe9nzsViszn4LecvyZBMmjPvNejqvKxf0HhvZnRamL5VtZun3kJh1GjW 8A2vVhzTr1m4fiZtuS5+Cx8a0vKzviCX4RHsykVq8YclH2VtlBAFW/WWeFTOQOC1lQzJ hK5g== X-Gm-Message-State: AOJu0YyLTEHFtmqE3lW2O5JRxxAm817WypsJrexr8Q73BzQufhsaIQTK RTsWVNqp8XPbcXyXa33SAvqluFPXZsrcMDfHh2DTlXWnbuw+YsgXPmSJUA== X-Google-Smtp-Source: AGHT+IGIRNDinVooKhRsE02nBlBxJYiallFLia81TPF0HI5WN1KURmOe2/m8u7A3NkYTYSFEGlitHw== X-Received: by 2002:a17:902:db0d:b0:1fb:7c7f:6458 with SMTP id d9443c01a7336-208d83d5714mr72879905ad.32.1726892460990; Fri, 20 Sep 2024 21:21:00 -0700 (PDT) Original-Received: from smtpclient.apple ([2601:646:8f81:6120:b925:297e:910c:4115]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-2079473f7a7sm101674835ad.291.2024.09.20.21.21.00 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Fri, 20 Sep 2024 21:21:00 -0700 (PDT) In-Reply-To: <8734lustbc.fsf@gmail.com> X-Mailer: Apple Mail (2.3776.700.51) 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:292145 Archived-At: > On Sep 20, 2024, at 12:00=E2=80=AFAM, pranshu sharma = wrote: >=20 >=20 > After indenting, treesitter does not rescan the region. This causes > errors in the concrete syntax tree, which mess up indentation and = syntax > colouring. >=20 > The issue I'm having is kind of hard to explain, but in a summary I = have > the poorly indented code, where what's between '_'(which is not in the > code itself) is coloured: > --------------- > f x =3D > let _a_ =3D 2 > _c_ =3D 1 > in a > -------------- > Then when I indent it with haskell-ts-mode, I get: > --------------- > f x =3D > let _a_ =3D 2 > c =3D 1 > in a > -------------- > When the 2 snippets of code have the exact same meaning. If I revert > the buffer then the 'c' becomes coloured again. >=20 > This is not just problem with syntax highlighting, but if I was to > indent the 2nd snippet it would mess it up, as it has the wrong CST. >=20 Hi Pranshu, Thanks for the report. I can reproduce it. Let me see what=E2=80=99s = going on here. Yuan=