unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Randy Taylor <dev@rjt.dev>
To: jostein@kjonigsen.net
Cc: Yuan Fu <casouri@gmail.com>,
	59833@debbugs.gnu.org, Theodor Thornhill <theo@thornhill.no>
Subject: bug#59833: 29.0.60; json-ts-mode fontifies everything as string
Date: Mon, 05 Dec 2022 15:01:27 +0000	[thread overview]
Message-ID: <ffegOjwY_mUuYxLmS3IyNKlqk-GPOIjy0j1QOOEvNf8s8pQUZBLgmnuqvaunWHcX05yiX7rH9gP5Yhdu-aJQTVyjlXVwn_k7rCnqg5bfq9Y=@rjt.dev> (raw)
In-Reply-To: <3b83163d-1add-bf14-1376-60e391370d1a@secure.kjonigsen.net>

On Monday, December 5th, 2022 at 09:52, Jostein Kjønigsen <jostein@secure.kjonigsen.net> wrote:


> 
> 
> 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

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-default JSON mode, unless I'm missing something.

Regardless, I think your proposal (and Theo's patch) is great, and a definite improvement. I can't believe I've tolerated everything in JSON files as a string face for so long ;).





  parent reply	other threads:[~2022-12-05 15:01 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-12-05 10:40 bug#59833: 29.0.60; json-ts-mode fontifies everything as string Jostein Kjønigsen
2022-12-05 11:24 ` Theodor Thornhill via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-12-05 11:35   ` Theodor Thornhill via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-12-05 11:53     ` Jostein Kjønigsen
2022-12-05 12:06       ` Theodor Thornhill via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-12-05 13:52   ` Randy Taylor
2022-12-05 13:58     ` Randy Taylor
2022-12-05 14:12       ` Theodor Thornhill via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-12-05 14:42         ` Randy Taylor
2022-12-05 14:52           ` Jostein Kjønigsen
2022-12-05 15:00             ` Eli Zaretskii
2022-12-05 15:01             ` Randy Taylor [this message]
2022-12-05 15:03             ` Theodor Thornhill via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-12-05 15:35               ` Randy Taylor
2022-12-05 15:37                 ` Theodor Thornhill via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-12-05 19:57                   ` Yuan Fu
2022-12-05 20:14                     ` Theodor Thornhill via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-12-05 20:19                       ` Randy Taylor
2022-12-05 20:22                         ` Yuan Fu
2022-12-05 20:38                           ` Theodor Thornhill via Bug reports for GNU Emacs, the Swiss army knife of text editors

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='ffegOjwY_mUuYxLmS3IyNKlqk-GPOIjy0j1QOOEvNf8s8pQUZBLgmnuqvaunWHcX05yiX7rH9gP5Yhdu-aJQTVyjlXVwn_k7rCnqg5bfq9Y=@rjt.dev' \
    --to=dev@rjt.dev \
    --cc=59833@debbugs.gnu.org \
    --cc=casouri@gmail.com \
    --cc=jostein@kjonigsen.net \
    --cc=theo@thornhill.no \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).