0

I am writing a logic gate simulator and have decided to make a VSCode extension for the language it uses. So far, I have a folder named lgc that contains the extension. Inside that folder there are the following:

package.json:

{
    "name": "Lgc",
    "version": "0.1.0",
    "engines": {
        "vscode": ">=0.9.0-pre.1"
    },
    "publisher": "AwesomeCronk",
    "contributes": {
        "languages": [{
            "id": "lgc",
            "aliases": ["lgc", "Lgc", "LGC"],
            "extensions": [".lgc",".ttb"]
        }],
        "grammars": [{
            "language": "lgc",
            "scopeName": "source.lgc",
            "path": "./syntaxes/lgc.tmLanguage.json"
        }]
    }
}

syntaxes/lgc.tmLanguage.json:

{
    "$schema": "https://raw.githubusercontent.com/martinring/tmlanguage/master/tmlanguage.json",
    "name": "Lgc",
    "patterns": [
        {
            "include": "#keywords"
        }
    ],
    "repository":
    {
        "keywords":
        {
            "paterns":
            [
                {
                    "name:": "keyword.gate.lgc",
                    "match": "a"
                }
            ]
        }
    },
    "scopeName": "source.lgc"
}

This is a test that should highlight any instance of the letter a as keywords. When I copy this folder to $Home/.vscode/extensions/, and restart VSCode with a .lgc file open, it is not highlighted at all. All the text is white. The status bar shows lgc as the language, so I know VSCode is detecting the language properly. Why doesn't it highlight?

AwesomeCronk
  • 421
  • 6
  • 16

1 Answers1

0

I think you have a typo in your syntaxes/lgc.tmLanguage.json file:

        "paterns":

Should be:

        "patterns":
carlfriedrich
  • 2,919
  • 1
  • 15
  • 29