From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Jostein =?UTF-8?Q?Kj=C3=B8nigsen?= Newsgroups: gmane.emacs.bugs Subject: bug#59833: 29.0.60; json-ts-mode fontifies everything as string Date: Mon, 5 Dec 2022 15:52:17 +0100 Message-ID: <3b83163d-1add-bf14-1376-60e391370d1a@secure.kjonigsen.net> References: <87sfhudrfu.fsf@thornhill.no> <_KSXcXGtjgQ4mzy-Ml9kIV0QngRcfhNomsCAtEhd7ZAP6ih86_WavpD-qSNN-MnXBLi0VACZ57_Ig4MkuoD5FB5qk80Y7C-LYaZrZRvSdK8=@rjt.dev> <4pslNusoayXbQq867kk1hbmFpD9rInmrKFngvhWbFFEFg-V1SrZLqJ47TyJDGrFal86hf7cLAGAD_KiCUyCEh52J45_tu4wAQ9HXpkIiFzI=@rjt.dev> <87sfhuvt0h.fsf@thornhill.no> Reply-To: jostein@kjonigsen.net Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="28157"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.5.1 Cc: Yuan Fu , 59833@debbugs.gnu.org, jostein@kjonigsen.net To: Randy Taylor , Theodor Thornhill Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Mon Dec 05 15:53:27 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 1p2CqS-0006z3-CC for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 05 Dec 2022 15:53:27 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1p2CqA-0001tM-Jw; Mon, 05 Dec 2022 09:53:06 -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 1p2Cq6-0001rB-UZ for bug-gnu-emacs@gnu.org; Mon, 05 Dec 2022 09:53:03 -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 1p2Cq6-0002hD-Lb for bug-gnu-emacs@gnu.org; Mon, 05 Dec 2022 09:53:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1p2Cq6-00040V-28 for bug-gnu-emacs@gnu.org; Mon, 05 Dec 2022 09:53:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Jostein =?UTF-8?Q?Kj=C3=B8nigsen?= Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 05 Dec 2022 14:53:02 +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.167025195115394 (code B ref 59833); Mon, 05 Dec 2022 14:53:02 +0000 Original-Received: (at 59833) by debbugs.gnu.org; 5 Dec 2022 14:52:31 +0000 Original-Received: from localhost ([127.0.0.1]:36450 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1p2Cpb-00040E-0L for submit@debbugs.gnu.org; Mon, 05 Dec 2022 09:52:31 -0500 Original-Received: from out3-smtp.messagingengine.com ([66.111.4.27]:36193) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1p2CpX-000407-F5 for 59833@debbugs.gnu.org; Mon, 05 Dec 2022 09:52:28 -0500 Original-Received: from compute5.internal (compute5.nyi.internal [10.202.2.45]) by mailout.nyi.internal (Postfix) with ESMTP id 66A465C00E7; Mon, 5 Dec 2022 09:52:21 -0500 (EST) Original-Received: from mailfrontend2 ([10.202.2.163]) by compute5.internal (MEProxy); Mon, 05 Dec 2022 09:52:21 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= secure.kjonigsen.net; h=cc:cc:content-transfer-encoding :content-type:date:date:from:from:in-reply-to:in-reply-to :message-id:mime-version:references:reply-to:reply-to:sender :subject:subject:to:to; s=fm3; t=1670251941; x=1670338341; bh=3l 7/DlN/ZyKwj0erqZT2xAiiKsg28TOZhwCM2ky1LLY=; b=Koj69dzUgP6uE/rwWl vJ6uPam0+tPsQVQyz1mdKXyi3DiXtMiNU7ZWHibGJXtPGFbuXTIhyvsymFmOgIe2 5MhegEEBH+OzwdwPaQvesCYVXkmVOK1rCQw+U0EbT/XLfEio9SMZ8pQYItutNQev 1RkayyM3kDB4R5mB7D+VF6iTuKmjaRF4b6ZGt1bhv/Ql+veP5U8I76Ng7OuZ1R/Z 8mEEZ3P4lyW+wmS9E7HWi5H2TNvQqfkexMz/8HcMMBXi2onoYa2jSbXpXkN0GkRx COl9vEH44ctwqWmhmxUEwovjyCW+9H9D45eTRF/IrH6QRAWu1kCZ53ZDCIpGAfmE /Dbw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:date:date:feedback-id:feedback-id:from:from :in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:reply-to:sender:subject:subject:to:to:x-me-proxy :x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm1; t= 1670251941; x=1670338341; bh=3l7/DlN/ZyKwj0erqZT2xAiiKsg28TOZhwC M2ky1LLY=; b=RvHWZGurApk0/KQpF7q1J5TYEBUkufuWg4vJ5dMHVOJ/00dbwK7 MHZhh2pN9PqiaHALbVldM8i2y99Sdgzh3vS8qp8gRlL5yURG3kCYI/pDI6N6D+mW I0Aq/8eyf4CeUj9BawVDUVbdDsv7dTUx6FjtikIH00b6LIXKRgBPunSi/hamHIW/ Jj4mV/LrcpV2nbJJ7OVSZezL+vnZHhIc24cO/D4yv1CiL8a7n3awqc26KkSfeii5 TT+wVGaxm7U/sqrmpQHlk2A4pMsUG28+j31BkT3om6R/N9r6MUNmMDHfCeGziFaL PCKbNon/ZQ9UTJ8qyFQyzdHA13cJpErl/nw== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvhedrudeggdeilecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpefkffggfghruffvvehfhfgjtgfgsehtjeertddtfeejnecuhfhrohhmpeflohhs thgvihhnucfmjhppnhhighhsvghnuceojhhoshhtvghinhesshgvtghurhgvrdhkjhhonh highhsvghnrdhnvghtqeenucggtffrrghtthgvrhhnpefhgeevvefhfeeffedtvdfhvdei ieffheeiheegheegtddtkeevffelteetgedvjeenucevlhhushhtvghrufhiiigvpedtne curfgrrhgrmhepmhgrihhlfhhrohhmpehjohhsthgvihhnsehsvggtuhhrvgdrkhhjohhn ihhgshgvnhdrnhgvth X-ME-Proxy: Feedback-ID: ib2f84088:Fastmail Original-Received: by mail.messagingengine.com (Postfix) with ESMTPA; Mon, 5 Dec 2022 09:52:20 -0500 (EST) Content-Language: nb-NO, en-GB In-Reply-To: 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:250033 Archived-At: On 05.12.2022 15:42, Randy Taylor wrote: > > Thanks, I meant just the treesit-font-lock-feature-list variable :) (so moving pair before string). > > 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 highlighted as error when an error occurs. > > Try: > { > "test": 2 > } > > and remove the colon. Before your patch, the entire line is red. After, only "test" is red. > > 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 and below alphabetized, but separately, which is how I organized json-ts-mode. Good observation. Agreed. > > Are you guys talking about the json-mode package? Jostein mentioned "Emacs 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. 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. 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. 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. 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. (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 ;) ) -- Jostein