0
votes

I am building an extension for VSCode that adds support for multiple languages. I have finished the first one, and am now working on the second one. However, the second language's grammar doesn't load when I open the corresponding file, even though visual studio recognizes it.

I have tried removing the first language I made, but the second one still refuses to load.

package.json:

"contributes": {
        "languages": [
            {
                "id": "ti-basic",
                "aliases": [
                    "Ti-BASIC",
                    "ti-basic"
                ],
                "extensions": [
                    ".tibasic"
                ],
                "configuration": "./tibasic-language-configuration.json"
            },
            {
                "id": "ez80-asm",
                "aliases": [
                    "ez80-Assembler"
                ],
                "extensions": [
                    ".asm",
                    ".ez80",
                    ".inc"
                ],
                "configuration": "./ez80-language-configuration.json"
            }
        ],
        "grammars": [
            {
                "language": "ti-basic",
                "scopeName": "source.tibasic",
                "path": "./syntaxes/ti-basic.tmLanguage.json"
            },
            {
                "language": "ez80-asm",
                "scopeName": "source.asm",
                "path": "./syntaxes/ez80-asm.tmLanguage.json"
            }
        ]
    }

/syntaxes/ez80-asm.tmLanguage.json:

{
    "$schema": "https://raw.githubusercontent.com/martinring/tmlanguage/master/tmlanguage.json",
    "name": "ez80-Assembler",
    "patterns": [
        {
            "include": "#comments"
        },
        {
            "include": "#constants"
        },
        {
            "include": "#supports"
        }
    ],
    "repository": {
        "comments": {
            "patterns": [{
                "name": "comment.line.semicolon.ez80-asm",
                "match": "^;"
            },
            {
                "name": "comment.block.ez80-asm",
                "begin": "#comment",
                "end": "#endcomment"
            }]
        },
        "constants": {
            "patterns": [{
                "name": "constant.numeric.ez80-asm",
                "match": "(\\d)|($[0-9A-Fa-f]|(%[0-1])"
            }]
        },
        "supports": {
            "patterns": [{
                "name": "support.function.ez80-asm",
                "match": "adc|add|and|bit|call|ccf|cp|cpd|cpdr|cpi|cpir|cpl|daa|dec|di|djnz|ei|ex|exx|halt|im|inc|jp|jr|ld|ldd|lddr|ldi|ldir|lea|mlt|neg|nop|or|pea|pop|push|res|ret|reti|retn|rl|rla|rlc|rlca|rld|rr|rra|rrc|rrca|rrd|rsmix|rst|sbc|scf|set|sla|slp|sra|srl|stmix|sub|tst|xor|in|in0|ind|ind2|ind2r|indm|indmr|indr|indrx|ini|ini2|ini2r|inim|inimr|inir|inirx|otdm|otdmr|otdrx|otim|otimr|otirx|out|out0|outd|outd2|outd2r|outdr|outi|outi2|outi2r|outir|tstio"
            },
            {
                "name": "support.variable.ez80-asm",
                "match": "a|af|b|bc|c|d|de|e|h|hl|i|ix|iy|l|r|hx|hy|ixh|ixl|sll|iyh|iyl|lx|l"
            }]
        }
    },
    "scopeName": "source.asm"
}

Whenever I load up a file with a matching filetype, VSCode recognizes my language exists: example 1 Notice the ez80-Assembler in the bottom right. But if i use the scope inspector to view scopes: example 2

The error is probably something really small I'm overlooking. Help to find it is greatly appreciated.

1
There might be some error in the dev console? - Gama11
Yes, that was it. Missing parenthesis somewhere. - Adam S.

1 Answers

0
votes

Error was my bad. I had a incomplete parenthesis somewhere. If this happens to you, hit ctrl-shift-i to open up the debug menu and check the errors.