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.bugs Subject: bug#61043: 30.0.50; `json-ts-mode': invalid font lock rule Date: Wed, 25 Jan 2023 15:00:16 +0200 Message-ID: <83v8kug467.fsf@gnu.org> References: <87lelrwv7f.fsf@masteringemacs.org> <87cz73vzpi.fsf@masteringemacs.org> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="2794"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 61043@debbugs.gnu.org, dgutov@yandex.ru To: Mickey Petersen Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Wed Jan 25 14:03:01 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 1pKfQa-0000UU-VR for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 25 Jan 2023 14:03:01 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pKfOt-0002eA-QK; Wed, 25 Jan 2023 08:01:15 -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 1pKfOl-0002YK-Hu for bug-gnu-emacs@gnu.org; Wed, 25 Jan 2023 08:01:08 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pKfOg-0007XL-8o for bug-gnu-emacs@gnu.org; Wed, 25 Jan 2023 08:01:07 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1pKfOg-00077L-4p for bug-gnu-emacs@gnu.org; Wed, 25 Jan 2023 08:01:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 25 Jan 2023 13:01:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 61043 X-GNU-PR-Package: emacs Original-Received: via spool by 61043-submit@debbugs.gnu.org id=B61043.167465164227320 (code B ref 61043); Wed, 25 Jan 2023 13:01:02 +0000 Original-Received: (at 61043) by debbugs.gnu.org; 25 Jan 2023 13:00:42 +0000 Original-Received: from localhost ([127.0.0.1]:58578 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pKfOL-00076Z-Ot for submit@debbugs.gnu.org; Wed, 25 Jan 2023 08:00:42 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:60672) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pKfOJ-00076K-7Q for 61043@debbugs.gnu.org; Wed, 25 Jan 2023 08:00:39 -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 1pKfOD-0007Q4-Db; Wed, 25 Jan 2023 08:00:33 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=Xm/9Lu1KTjBNodtqx11NF+MiKVGeDHtLmzGUuvAs0AY=; b=OK5z5zuFGV7Z EwjhOzk6IBepckDjIq8i00STlPQnqVADjiTa8TqjsO3kzVwHj1s9CuwBIBRYJeCICnhsawfontdVg E18B6oqz81j3HTJ47xRFIEXDvj4rNhLT0WL86b6+R5ld/dEzc8//2978a/qfY8HH0+6umVbfTT5KO nQzM9mRMv6Am2QfX9nupdit1pq+cgtZybtUAyLzXC+LjobGkzf9vaL36CzIyXAlzKo+c1MsF/RUQH anv14ajUNnDf5pNGd3LrURgZ06F2FZZuHbu4mOSJe5zAJEIO5NC9Xj81Bu3X0Zr1aCMS69/ElipxX VyYPyHy9nDn5foPbZRPBig==; 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 1pKfNj-000076-K7; Wed, 25 Jan 2023 08:00:19 -0500 In-Reply-To: <87cz73vzpi.fsf@masteringemacs.org> (message from Mickey Petersen on Wed, 25 Jan 2023 07:29:23 +0000) 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:254120 Archived-At: > Cc: 61043@debbugs.gnu.org > From: Mickey Petersen > Date: Wed, 25 Jan 2023 07:29:23 +0000 > > > Dmitry Gutov writes: > > > On 24/01/2023 22:09, Mickey Petersen wrote: > >> There's a comment font lock rule in `json-ts-mode'. However, that is > >> illegal and againt the JSON spec, and indeed the search query fails > >> because `comment' is not a valid node type. > > > > When you say it fails, how does that look to you? > > > > Here's an example of a JSON file (or, more accurately, a JSON-superset > > file) with comments: > > https://raw.githubusercontent.com/huytd/vscode-espresso-tutti/master/themes/Espresso%20Tutti-color-theme.json > > > > The JSON tree-sitter grammar seems to parse them correctly as comments > > ("comment" node type), and json-ts-mode highlights them as comments > > correctly as a result. > > It may well be my JSON grammar file that is different then. Which is > perhaps even worse: it is easy to find yourself with one of two > versions. For best results, always use the latest from their Git repository. Many of the grammar libraries are updated every few days, so they are not stable enough to rely on outdated versions. Unfortunately, there's no "grammar version" API in the tree-sitter-to-grammar protocol, so we cannot even implement version checking, and refuse to use outdated (and thus buggy) grammar libraries. Moreover, many grammar libraries don't even make releases and thus don't announce their version.