microsoft / vscode-textmate

A library that helps tokenize text using Text Mate grammars.
MIT License
580 stars 114 forks source link

JSON grammar without `filePath` parsed incorrectly as PList #214

Open zm-cttae opened 11 months ago

zm-cttae commented 11 months ago
  2) test/api/tokenInformation.test.ts (src/api.ts)
       getScopeRangeAtPosition(): Promise<TextmateToken>:
     Error: Near offset 1: expected < ~~~"name":"Plain Text","scopeName":"text","patterns":~~~

This is happening because JSON support is hacked in for JSON file URIs, but not JSON content values:

https://github.com/microsoft/vscode-textmate/blob/8b07a3c2be6fe4674f9ce6bba6d5c962a7f50df5/src/parseRawGrammar.ts#L11-L13