From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: J M Newsgroups: gmane.emacs.bugs Subject: bug#65113: Emacs-29 and master csharp-mode with broken treesit Date: Thu, 10 Aug 2023 23:42:22 +0100 Message-ID: <42C29EBD-86EA-4F55-AD84-CBA7F9AE6A60@tbm.email> References: <83fs4wp4hc.fsf@gnu.org> <834jl7jmhc.fsf@gnu.org> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="Apple-Mail=_C0C44D38-A232-4AD9-AC2A-FE9CA349144D" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="12370"; mail-complaints-to="usenet@ciao.gmane.io" Cc: casouri@gmail.com, 65113@debbugs.gnu.org, Theodor Thornhill To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Fri Aug 11 00:43:22 2023 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 1qUENF-00034L-0A for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 11 Aug 2023 00:43:21 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qUEMx-0004Pt-Al; Thu, 10 Aug 2023 18:43:03 -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 1qUEMw-0004Pl-1u for bug-gnu-emacs@gnu.org; Thu, 10 Aug 2023 18:43:02 -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 1qUEMv-0005vi-Pb for bug-gnu-emacs@gnu.org; Thu, 10 Aug 2023 18:43:01 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1qUEMv-0003am-Lc for bug-gnu-emacs@gnu.org; Thu, 10 Aug 2023 18:43:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: J M Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 10 Aug 2023 22:43:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 65113 X-GNU-PR-Package: emacs Original-Received: via spool by 65113-submit@debbugs.gnu.org id=B65113.169170735813773 (code B ref 65113); Thu, 10 Aug 2023 22:43:01 +0000 Original-Received: (at 65113) by debbugs.gnu.org; 10 Aug 2023 22:42:38 +0000 Original-Received: from localhost ([127.0.0.1]:44234 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qUEMY-0003a5-Ab for submit@debbugs.gnu.org; Thu, 10 Aug 2023 18:42:38 -0400 Original-Received: from mx2.tbm.email ([51.38.32.223]:58758 helo=mx2.tbmatrix.net) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qUEMV-0003Zt-32 for 65113@debbugs.gnu.org; Thu, 10 Aug 2023 18:42:37 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=tbm.email; s=mail; t=1691707353; bh=+U5ztPyP7WqOtwxyBJaQzAnZyEGh0x5nH4hMNNSqvO8=; h=From:Subject:In-Reply-To:Cc:To:References; b=EqhsCcEnmcS6LdeZd5Jx8pHfcSzwoPx23vmF1pkZ1+voW1lfwB70+byWTAHm6bwQc g6qHJKATIgHC2mxKj8033O8CNqwhtRpB7JK8z5wRalQPwASvZmult6joGpz3nnP5vT U5wT8Djp12KkqdgnLq7QnanlZ30k/K/xey5Ik4rAlTgmpRnWD/o4ZOeJrBVpTAwQQJ YEONgMcgTpKXqF0mRVOUBoaMMFb1cA88wfACzJ1ZLXge6HZN7GP59nrUfv9YJAjKz0 ruPfLoqYHhKBeeHXDfFPDXRjiZkdzxIIJrv+/g1viah+oL4j1b86m+vE6/cJg3gFFJ 16BEgO/Kv1zAnN2HBYshXe5xAvVWImRfGtZxrtrAK1xYHMCCfiaK1GgHWd4yvspIA7 jfdl0uuQ4X1V9bM998jxKSYdpiSIvRVWm5tEl0VnxqH8A18hpKXh8+b6F1lpgaEu4J wNmfI9GLkM1cKv+CiPto4os9AdIMA7Vd3hUKY34sc+Bk45NQ/auGwFpiUuxP7p/hBr EijrvSya7Eswt5clZNIRZYqf6y0pXzv+j8pBXdeQwR/d1lEzD8WyqxQ7XbjYWjkB6T UQUaztI9oNRa77b2zqAWSSK5xZpdyxAvxCF6XEp9109xWyKlRTiuSaIJLVf4o0H2Jx 9wDyvcZ+iKpdDWO597fObjVc= In-Reply-To: <834jl7jmhc.fsf@gnu.org> 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:267164 Archived-At: --Apple-Mail=_C0C44D38-A232-4AD9-AC2A-FE9CA349144D Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=us-ascii Hi Eli See attached the requested backward-compatible change. --Apple-Mail=_C0C44D38-A232-4AD9-AC2A-FE9CA349144D Content-Disposition: attachment; filename=0001-Update-csharp-treesit-support-due-to-upstream-change.patch Content-Type: application/octet-stream; x-unix-mode=0644; name="0001-Update-csharp-treesit-support-due-to-upstream-change.patch" Content-Transfer-Encoding: quoted-printable =46rom=20ca9ad7d0738e71775bdc1d83f7aa5a2849ba5a8b=20Mon=20Sep=2017=20= 00:00:00=202001=0AFrom:=20J=20M=20=0ADate:=20Thu,=2010=20= Aug=202023=2023:23:20=20+0100=0ASubject:=20[PATCH]=20Update=20csharp=20= treesit=20support=20due=20to=20upstream=20changes=0A=20(bug#65113)=0A=0A= A=20change=20in=20tree-sitter-c-sharp=20grammar=20for=20csharp=20(commit=0A= 18a531),=20has=20removed=20the=20keyword=20void_keyword=20and=20advised=0A= we=20should=20use=20predefined_type=0A---=0A=20= lisp/progmodes/csharp-mode.el=20|=2011=20++++++++---=0A=201=20file=20= changed,=208=20insertions(+),=203=20deletions(-)=0A=0Adiff=20--git=20= a/lisp/progmodes/csharp-mode.el=20b/lisp/progmodes/csharp-mode.el=0A= index=2000587a8a515..74968f3a06a=20100644=0A---=20= a/lisp/progmodes/csharp-mode.el=0A+++=20b/lisp/progmodes/csharp-mode.el=0A= @@=20-816,7=20+816,7=20@@=20csharp-ts-mode--font-lock-settings=0A=20=20=20= =20:language=20'c-sharp=0A=20=20=20=20:feature=20'definition=0A=20=20=20=20= :override=20t=0A-=20=20=20'((qualified_name=20(identifier)=20= @font-lock-type-face)=0A+=20=20=20`((qualified_name=20(identifier)=20= @font-lock-type-face)=0A=20=20=20=20=20=20(using_directive=20= (identifier)=20@font-lock-type-face)=0A=20=20=20=20=20=20= (using_directive=20(name_equals=0A=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20(identifier)=20@font-lock-type-face))=0A= @@=20-843,8=20+843,13=20@@=20csharp-ts-mode--font-lock-settings=0A=20=20=20= =20=20=20(class_declaration=20(identifier)=20@font-lock-type-face)=0A=20=0A= =20=20=20=20=20=20(constructor_declaration=20name:=20(_)=20= @font-lock-type-face)=0A-=0A-=20=20=20=20=20(method_declaration=20type:=20= [(identifier)=20(void_keyword)]=20@font-lock-type-face)=0A+=20=20=20=20=20= ;;;=20Handle=20different=20releases=20of=20tree-sitter-c-sharp.=0A+=20=20= =20=20=20;;;=20Check=20if=20keyword=20void_keyword=20is=20available,=20= then=20return=20the=20correct=20rule."=0A+=20=20=20=20=20= ,@(condition-case=20nil=0A+=20=20=20=20=20=20=20=20=20=20=20(progn=20= (treesit-query-capture=20'csharp=20'((void_keyword)=20@capture))=0A+=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20`((method_declaration=20= type:=20[(identifier)=20(void_keyword)]=20@font-lock-type-face)))=0A+=20=20= =20=20=20=20=20=20=20(error=0A+=20=20=20=20=20=20=20=20=20=20= `((method_declaration=20type:=20[(identifier)=20(predefined_type)]=20= @font-lock-type-face))))=0A=20=20=20=20=20=20(method_declaration=20type:=20= (generic_name=20(identifier)=20@font-lock-type-face))=0A=20=20=20=20=20=20= (method_declaration=20name:=20(_)=20@font-lock-function-name-face)=0A=20=0A= --=20=0A=0A= --Apple-Mail=_C0C44D38-A232-4AD9-AC2A-FE9CA349144D Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=utf-8 > On 10 Aug 2023, at 10:05, Eli Zaretskii wrote: >=20 >> Date: Mon, 07 Aug 2023 07:46:05 +0200 >> From: Theodor Thornhill >> CC: 65113@debbugs.gnu.org >=20 > Ping! Can we please have a patch that is backward-compatible? >=20 >> On 6 August 2023 17:36:47 CEST, Eli Zaretskii wrote: >>>> From: J M >>>> Date: Sun, 6 Aug 2023 16:03:45 +0100 >>>>=20 >>>> Treesit is broken for csharp-mode in the latest version in master = and emacs-29 and therefore does not provide syntax highlighting. =EF=BF=BC= >>>>=20 >>>> The latest grammar repository = (https://github.com/tree-sitter/tree-sitter-c-sharp) has removed the = keyword void_keyword. >>>>=20 >>>> Please see attached the patch to resolve the issue. >>>=20 >>> Thanks, but your patch will not work with the older version of the >>> grammar library, right? Is it possible to make a patch that will = work >>> with both? Wed cannot rely on users having the latest grammar >>> versions, so a backward-compatible change is much more preferable. >>=20 >> We've had some similar patches lately that you can use for = inspiration. >>=20 >> Thanks, >> Theo >>=20 --Apple-Mail=_C0C44D38-A232-4AD9-AC2A-FE9CA349144D--