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: Sat, 21 Sep 2024 23:35:50 -0700 Message-ID: <14EDC741-DDDC-45D1-B76E-7BA240373176@gmail.com> References: <8734lustbc.fsf@gmail.com> <8AD9587C-1C21-41A0-93EF-84B227C24A72@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="26933"; 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 Sun Sep 22 08:38:05 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 1ssGEP-0006nu-A7 for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 22 Sep 2024 08:38:05 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ssGE3-0002Ud-06; Sun, 22 Sep 2024 02:37:43 -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 1ssGE1-0002U7-Dm for bug-gnu-emacs@gnu.org; Sun, 22 Sep 2024 02:37:41 -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 1ssGE1-0002ly-5C for bug-gnu-emacs@gnu.org; Sun, 22 Sep 2024 02:37:41 -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=pP5OnuW4N01NGD/49AmDsb+3niadN2j42Pg6HNKs9cY=; b=EqCHxUGktL2BtYzs/c2F5Ot/Y81bLwq7jjZ1XgqEokHJl9K6O+fEQC0B4BVNAjaWWemtJieoO/JtBX0p9kMlxty3wAJ/TsmPsI+62yhS45aK1wt2X9gtiQfmBBKzFid/NTYcfnJOPgEUFhzAKW6Bs57MQWMqLD5DpUVcrerAnJaIwV1U4RGMYar5mx9AMxgLk3IJj02GXhgwosPOl92XztotwrmO8r35L9YR8Ohal3tjI5T+rgQkJt3/rc9PgCK3emROtTcV8Vot8qHf6Mn67ByCuRDKQxzL/d/L3CGhuYBAPgWZ0S8Ij9mOBcQ/+nXOwVU+juKWubLhKeUqMYdHeA==; Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1ssGEM-0005XI-9h for bug-gnu-emacs@gnu.org; Sun, 22 Sep 2024 02:38: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: Sun, 22 Sep 2024 06:38: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.172698705221216 (code B ref 73376); Sun, 22 Sep 2024 06:38:02 +0000 Original-Received: (at 73376) by debbugs.gnu.org; 22 Sep 2024 06:37:32 +0000 Original-Received: from localhost ([127.0.0.1]:40709 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ssGDr-0005W7-SG for submit@debbugs.gnu.org; Sun, 22 Sep 2024 02:37:32 -0400 Original-Received: from mail-pl1-f182.google.com ([209.85.214.182]:53650) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ssGDp-0005Vr-PM for 73376@debbugs.gnu.org; Sun, 22 Sep 2024 02:37:30 -0400 Original-Received: by mail-pl1-f182.google.com with SMTP id d9443c01a7336-206bd1c6ccdso32567885ad.3 for <73376@debbugs.gnu.org>; Sat, 21 Sep 2024 23:37:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1726986963; x=1727591763; 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=pP5OnuW4N01NGD/49AmDsb+3niadN2j42Pg6HNKs9cY=; b=ORcZ/RFAPHcGhjJlHVDzBFBH7Kysh+4mqtO9wKU+5av523hZiQEc3GvykY6mwkqsMs tdbkRIx8dJdC52JPx/AJf0ZmEWeX4b7W1XL00b5dI8ViGAunBwLwuBXIXbv2HAcI7XF9 8xcChnoyoH1LlaqmoQaWCpAOdmtcfq1s3oCCEcglNJCl2TdhPcRpVML6/4fV0+qPaYYA ++KQ3CKXreS1Vfk/JuyV/5/IjKURz4SOEUIctSMuPaIpAvLgffFap0/C3t4gVeAilrVT yx1YACUyBJR7LnQK6z6/GJZYjrFZ0cFCE4oUKywqUsvnu+2d0FOxqKkhnZNrIS9SRzAC RPtg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1726986963; x=1727591763; 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=pP5OnuW4N01NGD/49AmDsb+3niadN2j42Pg6HNKs9cY=; b=ZIBSJm7QSz/b7L1YGjzAvncn/QIquMTP/85DC3S9R2PRZfITyJeLFxd0QafAi5y3nX rRjLaR7qKcxfPXdniux5BT8c5S8Br11EsmJ1g7xHQtymoAPCdi+YPzLNxLkBCJuLglTv NpNwiP4fXpmf8VWqKTxL/2kcDMBXU81ssFjFYuEVUydLjM3sHJTE1ovnrJbwoZpdZjQK qGkdd4Itq/0Mc4PJc8MFKb3fzvtprDNQFhNMWlVMEgSc1iYutpkETH4rhDLDEbNH2+f2 PTI0JTwq/7iIQwUWhHiZ/Xewm43R46eyEOQr8WmXX+LydJl7utNGmveikJ34IZZD4Xa4 glaA== X-Gm-Message-State: AOJu0YxpV0bqUTdK9eK/MI/Tpw0rwmWAnoJ1Y3eqplYxwmVdB/YmWPaO +qxsqlNLcSXYEIBo8grAufiXXye2c2sQkug5gR+E0xEhK5L42Nsx+FyrNQ== X-Google-Smtp-Source: AGHT+IGrvnSamq6SfG5KdmD0wx/mM/OKZje7snxZhPjyDP3Ydz442nNnGhCmf946RjX7KTEsslkBXw== X-Received: by 2002:a17:902:f542:b0:206:b250:1e1 with SMTP id d9443c01a7336-208d8441a73mr127736725ad.45.1726986962704; Sat, 21 Sep 2024 23:36:02 -0700 (PDT) Original-Received: from smtpclient.apple ([2601:646:8f81:6120:b925:297e:910c:4115]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-20794767097sm116472665ad.303.2024.09.21.23.36.01 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Sat, 21 Sep 2024 23:36:02 -0700 (PDT) In-Reply-To: <8AD9587C-1C21-41A0-93EF-84B227C24A72@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:292218 Archived-At: > On Sep 20, 2024, at 9:20=E2=80=AFPM, Yuan Fu = wrote: >=20 >=20 >=20 >> 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 >=20 > Hi Pranshu, >=20 > Thanks for the report. I can reproduce it. Let me see what=E2=80=99s = going on here. >=20 > Yuan Seems to be a tree-sitter or tree-sitter-haskell bug, reported here: = https://github.com/tree-sitter/tree-sitter-haskell/issues/129 Yuan=