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: Tree sitter support for C-like languages Date: Mon, 14 Nov 2022 15:24:00 +0200 Message-ID: <83fselk6tr.fsf@gnu.org> 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> <09869DDB-2C3D-4064-81B0-0E6902C46396@gmail.com> 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="38356"; mail-complaints-to="usenet@ciao.gmane.io" Cc: dgutov@yandex.ru, theo@thornhill.no, emacs-devel@gnu.org, monnier@iro.umontreal.ca To: Yuan Fu Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Tue Nov 15 01:16:05 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 1oujcR-0009j5-RH for ged-emacs-devel@m.gmane-mx.org; Tue, 15 Nov 2022 01:16:03 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ouin9-00077e-BO; Mon, 14 Nov 2022 18:23:03 -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 1ouifP-0003Da-HX for emacs-devel@gnu.org; Mon, 14 Nov 2022 18:15:04 -0500 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 1ouZRF-0003NI-Oj; Mon, 14 Nov 2022 08:23:49 -0500 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=MSTpaxqY9ubzhDkNEeOkQBqcYnbVXuo2Saly8Duvmeo=; b=mRo3V3lH3/J86biA1Wp7 iYX1iw2DR/2SrXf8nuXnqcRpbkuwO0gizXOIfhQ6fS6+NM/rc8KyRL+rTvDKqbb9lmtP+xd/BSFyU tot8Z0ux//67SHfvcN6ts0/YoxpPjeHCEO7Ffe+ahRYILyMpodiEJm7unjRm6qeyi22ivEywgvBhB rR50kqILnDzMUStqRfcHq6K4O0USOm5awYJsUFWWDIXdJYPHM51Lh49t3OqdcXHngo4ytxF9mVd3O JmC9QeaxfHBNV0xE1qeauN/2ZpK44cjIsJu7Hb3Nt80r9+0uI8JLhkLHJbEGuIeifZ/x8n8QfZ7+7 p+psrN4f38qoVg==; 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 1ouZRF-0004Eo-7m; Mon, 14 Nov 2022 08:23:49 -0500 In-Reply-To: <09869DDB-2C3D-4064-81B0-0E6902C46396@gmail.com> (message from Yuan Fu on Mon, 14 Nov 2022 00:35:47 -0800) 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:299792 Archived-At: > From: Yuan Fu > Date: Mon, 14 Nov 2022 00:35:47 -0800 > Cc: Eli Zaretskii , > Theodor Thornhill , > emacs-devel , > monnier@iro.umontreal.ca > > That’s a good perspective. But from what I see I think it’s best not to fontify these “errors”, at least for C and C++. Because a lot of things could be marked “error” in a C file, like stuff around macros. And in extreme cases the whole file is marked “error”, even though if we ignore the error everything is parsed fine. I guess tree-sitter isn’t happy about some tiny thing in that file but never the less can parse everything correctly. I attached that file below. If these false positives happen frequently, it could be a user option; some users will prefer false positives to false negatives. But I definitely think that the warning face can be a valuable feature in some use cases, so flatly dismissing it is probably not the best alternative.