From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Randy Taylor Newsgroups: gmane.emacs.bugs Subject: bug#59833: 29.0.60; json-ts-mode fontifies everything as string Date: Mon, 05 Dec 2022 15:01:27 +0000 Message-ID: References: <87sfhudrfu.fsf@thornhill.no> <_KSXcXGtjgQ4mzy-Ml9kIV0QngRcfhNomsCAtEhd7ZAP6ih86_WavpD-qSNN-MnXBLi0VACZ57_Ig4MkuoD5FB5qk80Y7C-LYaZrZRvSdK8=@rjt.dev> <4pslNusoayXbQq867kk1hbmFpD9rInmrKFngvhWbFFEFg-V1SrZLqJ47TyJDGrFal86hf7cLAGAD_KiCUyCEh52J45_tu4wAQ9HXpkIiFzI=@rjt.dev> <87sfhuvt0h.fsf@thornhill.no> <3b83163d-1add-bf14-1376-60e391370d1a@secure.kjonigsen.net> 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="33719"; mail-complaints-to="usenet@ciao.gmane.io" Cc: Yuan Fu , 59833@debbugs.gnu.org, Theodor Thornhill To: jostein@kjonigsen.net Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Mon Dec 05 16:02:24 2022 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 1p2Cz9-0008bQ-Vn for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 05 Dec 2022 16:02:24 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1p2Cyy-00066S-Nx; Mon, 05 Dec 2022 10:02:12 -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 1p2Cyp-0005zW-H4 for bug-gnu-emacs@gnu.org; Mon, 05 Dec 2022 10:02:05 -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 1p2Cyp-0004mM-8u for bug-gnu-emacs@gnu.org; Mon, 05 Dec 2022 10:02:03 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1p2Cyp-0004A0-3p for bug-gnu-emacs@gnu.org; Mon, 05 Dec 2022 10:02:03 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Randy Taylor Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 05 Dec 2022 15:02:03 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 59833 X-GNU-PR-Package: emacs Original-Received: via spool by 59833-submit@debbugs.gnu.org id=B59833.167025250215975 (code B ref 59833); Mon, 05 Dec 2022 15:02:03 +0000 Original-Received: (at 59833) by debbugs.gnu.org; 5 Dec 2022 15:01:42 +0000 Original-Received: from localhost ([127.0.0.1]:36544 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1p2CyT-00049b-Lb for submit@debbugs.gnu.org; Mon, 05 Dec 2022 10:01:41 -0500 Original-Received: from mail-4018.proton.ch ([185.70.40.18]:20241) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1p2CyQ-00049V-Oi for 59833@debbugs.gnu.org; Mon, 05 Dec 2022 10:01:40 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rjt.dev; s=protonmail2; t=1670252491; x=1670511691; bh=gKR0HYWQyKVUBDhEb+QEbkJKqAGQoD/SOKXf+uxBnYA=; h=Date:To:From:Cc:Subject:Message-ID:In-Reply-To:References: Feedback-ID:From:To:Cc:Date:Subject:Reply-To:Feedback-ID: Message-ID:BIMI-Selector; b=T53JBRBwsfXEMEvwfTCb+X4UpBjAfxV07Xb2f8tb36QEGfqRSXL5czQnFK1qvLoeN G8SE0KhNeBikx7hy5jD++wrRM+1aVjaGwPXD24Q67zv0OXI8IRZ6apFc5mJOmvy1X6 Ah3xJnS0TtnEZThBW8gMBJPWYKkZCqIgqs2FEDA+rPAsqLsYohvGX798CT0+XGeUhi P3pwdmTUHEy5V0t3Q9Jt+O2aJIWfF4LmMBv1Ouar1sFQ5fgQq6iMANlx4/TxmK6qNb jl+UDPl6w+3PLrPOqxGo9FdRZ8gxL5Y9wjArogKnbJKJA+g6+FtlfAqp4vNnxbqCcW WtVcFE4TYhpAg== In-Reply-To: <3b83163d-1add-bf14-1376-60e391370d1a@secure.kjonigsen.net> Feedback-ID: 44397038:user:proton 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:250038 Archived-At: On Monday, December 5th, 2022 at 09:52, Jostein Kj=C3=B8nigsen wrote: >=20 >=20 > On 05.12.2022 15:42, Randy Taylor wrote: >=20 > > Thanks, I meant just the treesit-font-lock-feature-list variable :) (so= moving pair before string). > >=20 > > Having the font-lock settings alphabetized too is great, but I remember= running into some highlighting issues depending on the order of things. > > For example, since error is above number, the number face will not be h= ighlighted as error when an error occurs. > >=20 > > Try: > > { > > "test": 2 > > } > >=20 > > and remove the colon. Before your patch, the entire line is red. After,= only "test" is red. > >=20 > > So in general, I think we should stick all :overrides at the bottom of = that list (with error being the ultimate one), and keep everything above an= d below alphabetized, but separately, which is how I organized json-ts-mode= . >=20 > Good observation. Agreed. >=20 > > Are you guys talking about the json-mode package? Jostein mentioned "Em= acs still defaults to json-mode", but when I open a JSON file I get js-json= -mode, which is what I assumed he meant. js-json-mode is what I was trying = to match in json-ts-mode. >=20 >=20 > I've never heard of js-json-mode until today. I always use json-mode > (which AFAIK) is still the default for json-files, unless overridden in > your own .emacs setup. >=20 > I can see that in Emacs git right now, json-ts-mode behaves closely to > js-json-mode. I honestly expected it to match the Emacs-default > json-mode though, and found the current highlighting ... somewhat > unexpected. >=20 > IMO, yes the keys are technically speaking strings, but the are > predominantly and semantically keys, and IMO should be highlighted as > such. Just like json-mode does. >=20 > I realise this is somewhat subjective and preferential, but as far as my > preference goes, I clearly prefer json-mode over js-json-mode, and as > such also prefer the current patch-sets for json-ts-mode which Theo has > submitted. >=20 > (On my part we can avoid side-tracking related to why there are multiple > json-modes, unless has a deep need to contextualize these changes > related to those ;) ) >=20 > -- > Jostein You say "Emacs-default json-mode" but I don't see that anywhere. If you run= emacs -Q and visit a JSON file, you get js-json-mode, which is the Emacs-d= efault JSON mode, unless I'm missing something. Regardless, I think your proposal (and Theo's patch) is great, and a defini= te improvement. I can't believe I've tolerated everything in JSON files as = a string face for so long ;).