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: A few questions about c++-ts-mode. Date: Thu, 09 May 2024 08:03:12 +0300 Message-ID: <86jzk38tm7.fsf@gnu.org> References: <865xvoa0jr.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="11807"; mail-complaints-to="usenet@ciao.gmane.io" Cc: emacs-devel@gnu.org, casouri@gmail.com To: Ergus Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Thu May 09 07:04:01 2024 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 1s4vwn-00031v-FP for ged-emacs-devel@m.gmane-mx.org; Thu, 09 May 2024 07:04:01 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1s4vw4-0008CZ-FY; Thu, 09 May 2024 01:03:16 -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 1s4vw2-0008CH-D7 for emacs-devel@gnu.org; Thu, 09 May 2024 01:03:14 -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 1s4vw2-0007cl-2l; Thu, 09 May 2024 01:03:14 -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=Ti8BWBtcSim1yiqiofTSNjeLLeP3UDcFEEyu+LGr2Nw=; b=LD2hYrdOymmx6VOWb/ka lvHGzQIxMjCFKlWREiLYFsPrr9uUl557lyRjkiYT+/tzhDtNTTtUNxBQJ27D4CQvLDfeEMOWan1ol K+3BioXQaOEbL5DA6C8J0oQfFeZlmyIoWIhXdQWuNjHnBFf2ogLaWTXurKGY1BXaEhN/UyhoY1Olg rlydjyQhiz62WSz+hSbJsHACHwuj+DAI6ROSjiCf1jmOP0IUH+Wix7Zigl5ew2exKdVKLRZzWX8ra 3Tiqlpni4sKxx8qBlHwaMxXd454Vkyo23FGkJnyx8c67lxq4ljEITKpdfDXC+7I2ranRL+Xfq5URp +1kKTSYhE98/kw==; In-Reply-To: (message from Ergus on Wed, 08 May 2024 23:05:10 +0200) 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:319038 Archived-At: > Date: Wed, 08 May 2024 23:05:10 +0200 > From: Ergus > > >> > 2. Doc string comments are fontified like normal comments. It looks like > >> > treesiter does not recognize them at all. Is this something we need to > >> > report to treesitter or we need to workaround it in emacs side? > >> > >> I’m working on that. I think the best way is to workaround it in Emacs. > > > >Please note that some of those specially-formatted comments are > >explicitly supported by the grammar. > > > > It looks like tree sitter already supports this using language injection: > > > > I am not sure if we can handle this same way in emacs. Or if it is a better or worst approach than using a made in home workaround. If the only solution is language injection, then doing that our usual way (with regexps etc.) is easier and more flexible. I thought I saw some commits in the C++ grammar that actually support that in the grammar itself. If there is such support, we should use it, IMO.