0

I followed this post to add a custom extension to vs code:

package.json:

{
  "name": "test",
  "displayName":  "Test test",
  "version": "0.0.1",
  "engines": {
    "vscode": ">=0.9.0-pre.1"
  },  
  "contributes": {
    "languages": [
      {
        "id": "test",
        "extensions": [".test"]
      }
    ],
    "grammars": [
      {
        "language": "test",
        "scopeName": "source.test",
        "path": "./syntaxes/test.tmLanguage.json"
      }
    ]    
  }
}

test.tmLanguage.json

{
    "name": "test",
    "scopeName": "source.test",
    "fileTypes": [
        "test"
    ],
    "patterns": [
        {
            "name": "comment.line.semicolon.test",
            "match": ";.*"
        }
    ]
}

and I manually edited the extensions.json file to

[
    {
      "identifier": {
        "id": "test"
      },
      "version": "0.0.1",
      "location": {
        "$mid": 1,
        "fsPath": "c:\\Users\\infinitezero\\.vscode\\extensions\\test",
        "_sep": 1,
        "external": "file:///c:/Users/infinitezero/.vscode/extensions/test",
        "path": "/c:/Users/infinitezero/.vscode/extensions/test",
        "scheme": "file"
      },
      "relativeLocation": "test"
    }
  ]

But when I open a *.test file and inspect the scopes, it tells me the grammar is unknown.

infinitezero
  • 1,610
  • 3
  • 14
  • 29

0 Answers0