From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.devel Subject: Re: Tree sitter support for C-like languages Date: Mon, 14 Nov 2022 07:46:55 -0500 Message-ID: References: <87tu36em9t.fsf@thornhill.no> <45FD2F78-F15B-488B-9348-A8E298D8AD35@gmail.com> <87v8nmyqqp.fsf@thornhill.no> <834jv4nz2g.fsf@gnu.org> <871qq8hsj1.fsf@thornhill.no> <83iljklzmo.fsf@gnu.org> <87v8nkgcqj.fsf@thornhill.no> <87sfiogcbm.fsf@thornhill.no> <83pmdrkyj7.fsf@gnu.org> <87v8njw5th.fsf@thornhill.no> <83leofkwjm.fsf@gnu.org> <9E9244D3-2EFB-4621-91E0-FC8B8C1C2D52@gmail.com> <186915C1-1C47-43DC-A386-B447A2E7528D@gmail.com> 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="3248"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Cc: Eli Zaretskii , Theodor Thornhill , emacs-devel To: Yuan Fu Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Tue Nov 15 00:54:38 2022 Return-path: Envelope-to: ged-emacs-devel@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 1oujHi-0000fM-Er for ged-emacs-devel@m.gmane-mx.org; Tue, 15 Nov 2022 00:54:38 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ouinR-0007ge-9r; Mon, 14 Nov 2022 18:23:21 -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 1ouifT-0005zE-Ra for emacs-devel@gnu.org; Mon, 14 Nov 2022 18:15:09 -0500 Original-Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ouYrf-0004YG-9H; Mon, 14 Nov 2022 07:47:04 -0500 Original-Received: from pmg1.iro.umontreal.ca (localhost.localdomain [127.0.0.1]) by pmg1.iro.umontreal.ca (Proxmox) with ESMTP id 3674310011A; Mon, 14 Nov 2022 07:46:59 -0500 (EST) Original-Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1]) by pmg1.iro.umontreal.ca (Proxmox) with ESMTP id BC263100091; Mon, 14 Nov 2022 07:46:57 -0500 (EST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca; s=mail; t=1668430017; bh=Pj8ljFecE/ehUbrNo76va7+zD+kmOZrk5Jh5sOWJ5P4=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From; b=F12gF1lgXS4nCe9c/qAXIVJvI0wLrCQbsb0k6v4f9OD4omJFEbQ2QdxVnGmcOHvDH of2QFb968+IsBcOrpO7QpvondbjfUenZhXjFvMxDBHuqthCf8Lwe8bxP2PGlQQQGyc fz9F4Xej+88GYm6cBwKdxAmyUs5dvuXbESZTaERyIQ5VbZqVI1+sUe+aQBfgixrVr3 H8JxE2VJJO4xNenpr968ETW8orfW5JbxZoMU5wFmH9yz6Wb49smR9MsByLqrzlyJYM IZWzh/1JJzAsBtz/Dg8Ml3mORy1MJtSQ/rW6bZPShFNRKU9FLQAO2XOR4LdsWqLS0C CeJFdShsIGq0g== Original-Received: from pastel (unknown [104.247.241.157]) by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id 57C4E1208F8; Mon, 14 Nov 2022 07:46:57 -0500 (EST) In-Reply-To: <186915C1-1C47-43DC-A386-B447A2E7528D@gmail.com> (Yuan Fu's message of "Mon, 14 Nov 2022 00:23:20 -0800") Received-SPF: pass client-ip=132.204.25.50; envelope-from=monnier@iro.umontreal.ca; helo=mailscanner.iro.umontreal.ca X-Spam_score_int: -42 X-Spam_score: -4.3 X-Spam_bar: ---- X-Spam_report: (-4.3 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.devel:299778 Archived-At: >> On Nov 13, 2022, at 7:48 PM, Stefan Monnier w= rote: >>=20 >>> The parse tree has errors and it fontifies int in warning face. >>>=20 >>> Then when you insert the closing bracket, the parse tree is complete >>>=20 >>> int >>> foo (void) >>> { >>> int bar =3D 0; >>> } >>>=20 >>> Int is still in warning face because jit-lock doesn=E2=80=99t know it n= eeds to be >>> refontified. >>=20 >> Doesn't tree-sitter tell us that the node for `int` has changed? > > Yes and no, but mostly no. Tree-sitter can tell if a node =E2=80=9Chas ch= anges=E2=80=9D. I mean: when we send to tree-sitter a new version of the buffer text (i.e. we ask it to perform an incremental reparse), it tells us which parts of the tree have changed, right? If so, does this include the part containing the "int" node in the above case? Stefan