microsoft / microsoft/vscode-textmate

JSON grammar without `filePath` parsed incorrectly as PList

Open
#214 0 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
TypeScript
Stars
678
Forks
135
Avg merge
1d 14h
Merged PRs (30d)
2

Description

  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

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with test/api/tokenInformation.test.ts and the failing getScopeRangeAtPosition() path in src/api.ts, then compare the JSON handling described in the linked parseRawGrammar.ts reference. Confirm that JSON grammar content without a filePath is parsed correctly and that the token information test passes.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
tooling
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.