bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#61043: 30.0.50; `json-ts-mode': invalid font lock rule


From: Eli Zaretskii
Subject: bug#61043: 30.0.50; `json-ts-mode': invalid font lock rule
Date: Wed, 25 Jan 2023 15:00:16 +0200

> Cc: 61043@debbugs.gnu.org
> From: Mickey Petersen <mickey@masteringemacs.org>
> Date: Wed, 25 Jan 2023 07:29:23 +0000
> 
> 
> Dmitry Gutov <dgutov@yandex.ru> 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.





reply via email to

[Prev in Thread] Current Thread [Next in Thread]