microsoft / microsoft/vscode-textmate

ModernPerl syntax error

Open
#64 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

Hi,
I tried importing to VS Code a syntax from Sublime's ModernPerl.
Syntax is in .plist file, attached here: Perl.commented-bad.txt (as .txt becouse of GitHub...).
There are 3 problematic scopes in this file. They are commented out and VS Code works and colorize the Perl code, but if I uncomment them, then I get:

ERR empty range in char class: Error: empty range in char class
    at createOnigScanner (/Applications/Visual Studio Code.app/Contents/Resources/app/node_modules.asar/vscode-textmate/release/main.js:1346:12)
    at RegExpSourceList.compile (/Applications/Visual Studio Code.app/Contents/Resources/app/node_modules.asar/vscode-textmate/release/main.js:1399:30)
    at IncludeOnlyRule.compile (/Applications/Visual Studio Code.app/Contents/Resources/app/node_modules.asar/vscode-textmate/release/main.js:1492:45)
    at matchRule (/Applications/Visual Studio Code.app/Contents/Resources/app/node_modules.asar/vscode-textmate/release/main.js:2240:28)
    at matchRuleOrInjections (/Applications/Visual Studio Code.app/Contents/Resources/app/node_modules.asar/vscode-textmate/release/main.js:2256:23)
    at scanNext (/Applications/Visual Studio Code.app/Contents/Resources/app/node_modules.asar/vscode-textmate/release/main.js:2346:17)
    at _tokenizeString (/Applications/Visual Studio Code.app/Contents/Resources/app/node_modules.asar/vscode-textmate/release/main.js:2339:9)
    at Grammar._tokenize (/Applications/Visual Studio Code.app/Contents/Resources/app/node_modules.asar/vscode-textmate/release/main.js:2107:25)
    at Grammar.tokenizeLine2 (/Applications/Visual Studio Code.app/Contents/Resources/app/node_modules.asar/vscode-textmate/release/main.js:2077:22)
    at e.tokenize2 (file:///Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/workbench.main.js:3254:428)

Same file worked in Sublime perfectly.
Any ideas what is causing the problem?

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 the attached Perl.commented-bad.txt grammar and reproduce the reported error in the tokenizer, comparing its behavior with Sublime's ModernPerl syntax. Identify the three commented scopes involved and verify that the grammar loads and colorizes Perl code without the empty-range error.

Written by the indexing model from the issue text.

Assessment

Tech stack
perl, typescript
Domain
tooling
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.