From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: =?utf-8?Q?Daniel_Mart=C3=ADn?= Newsgroups: gmane.emacs.devel Subject: Re: Initial fontification in sh-mode with tree-sittter Date: Tue, 01 Nov 2022 01:09:00 +0100 Message-ID: References: <6C8B0F8E-DF61-4BC3-B0D0-56DBB66BE637@gmail.com> <7AE71CCA-6F18-4DE6-8608-7D9B3E9E52FB@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="27079"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.2 (darwin) Cc: =?utf-8?Q?Jo=C3=A3o?= Paulo Labegalini de Carvalho , emacs-devel@gnu.org To: Yuan Fu Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org+ged-emacs-devel=m.gmane-mx.org@gnu.org Tue Nov 01 01:10:13 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 1oper6-0006rp-6B for ged-emacs-devel@m.gmane-mx.org; Tue, 01 Nov 2022 01:10:12 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1opeqM-0002GW-P9; Mon, 31 Oct 2022 20:09:26 -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 1opeqC-0002E5-TL for emacs-devel@gnu.org; Mon, 31 Oct 2022 20:09:18 -0400 Original-Received: from sonic303-21.consmr.mail.ir2.yahoo.com ([77.238.178.202]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1opeq8-0005He-I6 for emacs-devel@gnu.org; Mon, 31 Oct 2022 20:09:14 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.es; s=s2048; t=1667261344; bh=Vh3S36pGIpwNCUEjjKtWuv+jVsno5D7vG8FaLQ9veLc=; h=From:To:Cc:Subject:References:Date:In-Reply-To:From:Subject:Reply-To; b=o243bbyFHcP8sQDjT0gDg+iczhJKAptDGL78+1ZhFG8BOWJoYhsfRI4AkU0o6QgIer9BIuYlMRJi18SXNeeR5CTE0BgPDXUwM/bU5RxdJmPn4fzqiPZqxM599ca1pZoPA3qhHej+nIBs5/2J/6PFYWjZBSDaRZG23gXnMR78qx3Yqyq5JUgoEipswIue1FpUEn4UHelWzzqc7Vvp67XySFmdtpVs2Itc9aF3tpbV1BMZ8aza8cY9CgslB1age2h7NcbICs9j+UY6J0DQ7Y0IlqwBatTFc0jDKCGjPKPmtdHsNEZBtKlyPKeZa+lsOkw8JV/HqS4NRC4EnnlCgpFjCg== X-SONIC-DKIM-SIGN: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1667261344; bh=VNR/gbx37eJyxkhNBSzbBtZAYHR/g9ntVnsEWXkFcCL=; h=X-Sonic-MF:From:To:Subject:Date:From:Subject; b=RQ5p6jgjWa0tJ3fHnqz8ei5aeBJusf7mtoJVSj6XIhk/ZKHnmMt9KCkzjjXcq9FxvQIAwNXd98ZBi2MM1Ha0+XxmbEdt/OEk7xCu/m+/avx+QgoB2dLNVuVZXJlzLml2bTourXgTJeTj3qLzNzV4yYKL5QlGjrUmlYezvFo64brPZogQgGbMUIRG33VcjZRmjLt91uZJld3bFKGHbakuHfq5HCVWmIbBzmdoXonBQ2rxeyxtJaSOA6POI/OXDzdViPr4We3r+vntthD0fKqc6B8nhfEYdffz2Lwgw0vRHjNaAf2hRgmdiDDzEsA5+ZNFaqRtQWxinG7c8IZPX8F0Lg== X-YMail-OSG: AkcSRtcVM1kt74XPnPN56upEJJZ5NkTNmM8Rx2f4RbZsGlo3aK8hhFHASAtnFTt c9mLUwo6_TzZc6OXHg1Pheh0jVpAAwqgRvaWsodsrGxloCPlyE5aWSvrLE1Zzor3YgRUgwQtnbJ3 Q.jL8GUl.Vqt3b5KFqkpQLEqc.9IEVa.m1ORepRr_RjjE5LtNweE4yHnEqRHwfHq1jwOG3J0WNWa 66HvaB8SLyhEz7qKOb4.J0rDlkKL1GQQoPnA2HaFSyTX2O6u4uHj1QqMKjr4ppVdeWBTHPvnAA.u HmJNs7a_gIB.uMmnDyEiQ.GC7YgBnM5ajOGsPsi1v7rnP_kytc90xQRwR3exTPMW9OQA.Tz9u..Y op0DmugEyjv76bw_8ZtjtdlS2iBLacn0cA7dz8eh9E3QUcQcwDdCNrbLDs38GbnlmoTL4Mm9.qI4 qNY3JMQ3W0rhDENxUsU5H2xciVBkyrwx_zG0CiC6d0R_Tf0LPIzqdwMxsDQl278Wc3eRuH2UvF.r bDqNMkW_3E2i6aIOXJNUDgcT94TYgGeyDjmaRFgOKME5b7h_yLYGpvn0gPp76D3Cear5hKVm8.vi mTkLbhDNiAnCdh.S6m.5nIzdkryOMC_M86grovu3PLoDqODUKgICs6LYANkUHSdMHiEVfayAjnSl kjcnLIoG0IeXuUe35.GStfN7q.jTMQKrM1wbdHz8if_3Fb.2CvZf0PZNIm3EgSEb5sErL8MtoxV6 7KLI.kpth93AbRl22.SMYTr8RNSFM1I9941Tmc.lwgZo9gpzbhHRjZKBbH8.RFku6mM9VNMSqIln mwi.ddSUZKSrvdh79VYHVemmZ2Eq27rqNpSxXmQh45 X-Sonic-MF: Original-Received: from sonic.gate.mail.ne1.yahoo.com by sonic303.consmr.mail.ir2.yahoo.com with HTTP; Tue, 1 Nov 2022 00:09:04 +0000 Original-Received: by hermes--production-ir2-96dfb7869-4fp8c (Yahoo Inc. Hermes SMTP Server) with ESMTPA ID 765391abbf5c6222d853211353fc1492; Tue, 01 Nov 2022 00:09:01 +0000 (UTC) In-Reply-To: <7AE71CCA-6F18-4DE6-8608-7D9B3E9E52FB@gmail.com> (Yuan Fu's message of "Mon, 31 Oct 2022 14:56:02 -0700") X-Mailer: WebService/1.1.20783 mail.backend.jedi.jws.acl:role.jedi.acl.token.atz.jws.hermes.yahoo Received-SPF: pass client-ip=77.238.178.202; envelope-from=mardani29@yahoo.es; helo=sonic303-21.consmr.mail.ir2.yahoo.com X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 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, FREEMAIL_ENVFROM_END_DIGIT=0.25, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.001, 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: , Original-Sender: "Emacs-devel" Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org+ged-emacs-devel=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.devel:298897 Archived-At: Yuan Fu writes: > > I think I=E2=80=99ve fixed this problem. It is mainly due to how the > fortifications rule is written. When the starting quotes are inserted, > normal syntactic font-lock will mark everything behind it in > string-face, but for tree-sitter, since the source is incomplete, the > quotes are in an error node in the parse tree and there is no string > node, so tree-sitter rules can=E2=80=99t capture any string node, so no s= tring > face is applied. And when the ending quotes are inserted, the only > region jit-lock wants tree-sitter to fontify is that three quote, so > again the whole string is not captured. I changed the font-lock rule > to match the ending quote rather than the whole string, and now it=E2=80= =99s > working fine. > > Now it is actually better than before: If you insert an open quote, > the rest of the buffer will not be marked in string face, instead, and > when you insert the ending quote, the string is fontified correctly. > I can still reproduce the problem, with same reproduction steps that I mentioned before. Curiously, as soon as I press C-l, the text gets fontified with the string face.