Skip to content

Best strategy for broken, archived grammars? Fork? Fixup? Schema? #141

@si14

Description

@si14

Hey folks!

I'm (very slowly) working on a rust version of textmate-based highlighting, and your collection of grammars is hugely helpful. However, since my parser is a bit more strict than vscode's, I found a few grammars that have issues in them. Here's an example from xml.json:

        {
          "begin": "<%--",
          "captures": {
            "0": {
              "name": "punctuation.definition.comment.xml"
            },
            "end": "--%>",
            "name": "comment.block.xml"
          }
        },

It's obviously a typo, end and name should be one level up.

information_for_contributors (taken from https://github.com/microsoft/vscode/blob/main/extensions/xml/syntaxes/xml.tmLanguage.json I presume) suggests upstreaming fixes, but the original grammar https://github.com/atom/language-xml/blob/master/grammars/xml.cson is now archived, so it can't be fixed.

I found similar issues in wikitext.json, stata.json, and racket.json. Additionally, jinja.json uses arrays for captures, which is a bit funny. I get why it works in JS, but stronger typed languages fail on that.

It'd be lovely to fix those grammars, so what would be your preferred strategy?

  • should I submit a fix in vscode for them?
  • should I fork archived grammars, introduce fixes, and propose new upstream here (and maybe in vscode)?
  • should I submit a PR with "fixups" for those grammars (maybe using patch)?
  • would you like to have some form of validation for grammars, maybe a JSON schema?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions