From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.devel Subject: Re: Initial fontification in sh-mode with tree-sittter Date: Wed, 02 Nov 2022 21:17:52 +0200 Message-ID: <8335b19ndr.fsf@gnu.org> References: <6C8B0F8E-DF61-4BC3-B0D0-56DBB66BE637@gmail.com> <7AE71CCA-6F18-4DE6-8608-7D9B3E9E52FB@gmail.com> <9BA853EA-8B7F-41A0-A174-D86DF5CE7788@gmail.com> <83sfj3cfl0.fsf@gnu.org> <03309451-1AEB-458C-88FD-9715CECC27A2@gmail.com> <83mt9bc9ke.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="8154"; mail-complaints-to="usenet@ciao.gmane.io" Cc: emacs-devel@gnu.org To: =?utf-8?Q?Jo=C3=A3o?= Paulo Labegalini de Carvalho , Yuan Fu Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Wed Nov 02 20:18:47 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 1oqJGA-0001wo-Hp for ged-emacs-devel@m.gmane-mx.org; Wed, 02 Nov 2022 20:18:46 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oqJFV-00021h-PI; Wed, 02 Nov 2022 15:18:05 -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 1oqJFU-000218-G7 for emacs-devel@gnu.org; Wed, 02 Nov 2022 15:18:04 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oqJFT-0000ld-Th; Wed, 02 Nov 2022 15:18:03 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-version:References:Subject:In-Reply-To:To:From: Date; bh=x+1UWcPjlfemtg8ayvTEgthQajdqyK84N3wxueWiQhc=; b=a4pjiYr2vtkywbVF4TPv QqmZflGOja+EGubctEAJnnyikM50VZlJRJc1a0xpLyvdqgGtA3H8zMctR58JisznjhpkGI2X4UYB+ yUiu3FluSk/6LTQ29cx4HWr4oz0vc32sHMF0RWLzfXNQF0rG27qkPSqa/GPlF+l/LmuZE/VREw2Ef 4Yy4kg9Q1xuNr8M2FJFFEE+rM0mPPfwzmwjnGhMPGiPIk5HXz8GXVwnDFHIKiwmjtE+QAYuX+Hw9r 3RGn4A/0zpHtsKlV+7GoJTQaO7HxbaQQ4C4HPQxjDC+Grpw67MvcQ+EPoCnIaNITecuBxRirymUUa XRu+c8FW7gRNfg==; Original-Received: from [87.69.77.57] (helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oqJFT-00067v-BF; Wed, 02 Nov 2022 15:18:03 -0400 In-Reply-To: (message from =?utf-8?Q?Jo=C3=A3o?= Paulo Labegalini de Carvalho on Wed, 2 Nov 2022 12:34:56 -0600) 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: , Original-Sender: "Emacs-devel" Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.devel:299037 Archived-At: > From: João Paulo Labegalini de Carvalho > Date: Wed, 2 Nov 2022 12:34:56 -0600 > > Yes, the fontification in the buffer is still not updated correctly. > > With the step below, the definition of function foo is not re-fontified and remains with string-face until C-x x f is > executed. > > emacs -Q from top of the feature/tree-sitter branch > M-: (require 'treesit) > M-x customize-variable treesit-settings RET > Set "Activate" to "Yes" and apply the change. > C-x b sample.py RET > M-x python-mode > Write the following program: > > def main(): > return 0 > > M-< > """ > M-> > """ (at this point everything is in string-face, as expected) > C-a > C-k (everything is still fontified as string) > C-x x f (leading """ is not fontified and definition of foo is correctly fontified) > > I am interested in understanding what is causing this as a similar thing happens with heredocs in sh-mode & > tree-sitter. Yuan, can you look into this? It sounds like some general problem with integration of tree-sitter with jit-lock. Or maybe something is missing from the way tree-sitter nodes are mapped into face text properties. Are the faces actually being put on the relevant text, for starters?