-
Notifications
You must be signed in to change notification settings - Fork 115
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Repository works only when it defined at top level of grammar file #140
Comments
I have used sub |
+1! This was a tough one to debug! 😬 I believe I am running into the same issue. As a reduced test case I defined this simple grammar: patterns:
- include: "#aaaaaa"
repository:
aaaaaa:
name: meta.definition.operator.swift
begin: abc
end: $
beginCaptures:
0: { name: storage.modifier.swift }
patterns:
- include: "#xxx"
repository:
xxx:
match: def
captures:
0: { name: entity.name.function.operator.swift } In TextMate this renders as expected: In VS Code, somehow even the If I change it to: patterns:
- include: "#aaaaaa"
repository:
aaaaaa:
...
xxx:
... then it seems to work. Would you agree this looks like the same issue, or do you think it's a different one? I would disagree somewhat with the original issue title. Like @msftrncs said, I've had nested |
@jtbandes looks like the very same issue. Rule stops working when you define repository in this rule and include it |
@jtbandes also keep in mind another bug an empty |
Thanks for the info. I've also noticed another bug which is causing some grief: a 2nd match of a group (e.g. via - match: (AAA)\g<1>
captures:
1: { name: keyword.control } This seems related to #164 but I'm not sure it's the same issue. |
it is also the same as #208
I think there was a work around |
I found the problem to be; if theres a workaround is to nest everything except the <?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>fileTypes</key>
<array>
<string>qwe</string>
</array>
<key>name</key>
<string>Qwe</string>
<key>patterns</key>
<array>
<dict>
<key>patterns</key>
<array>
<dict>
<key>begin</key>
<string>begin</string>
<key>beginCaptures</key>
<dict>
<key>0</key>
<dict>
<key>name</key>
<string>keyword.control.begin.qwe</string>
</dict>
</dict>
<key>end</key>
<string>end</string>
<key>endCaptures</key>
<dict>
<key>0</key>
<dict>
<key>name</key>
<string>keyword.control.end.qwe</string>
</dict>
</dict>
<key>name</key>
<string>meta.begin-end.qwe</string>
<key>patterns</key>
<array>
<dict>
<key>include</key>
<string>#foo</string>
</dict>
</array>
</dict>
</array>
<key>repository</key>
<dict>
<key>foo</key>
<dict>
<key>match</key>
<string>foo</string>
<key>name</key>
<string>keyword.control.foo.qwe</string>
</dict>
</dict>
</dict>
</array>
<key>scopeName</key>
<string>source.qwe</string>
<key>uuid</key>
<string>06AD8311-7342-4086-843E-BFB83EBC2377</string>
</dict>
</plist> |
In textmate you can define repositroy within a specific rule and it works fine.
I created this grammar file for test
result in textmate:
result in vscode:
In vscode whole rule stopped working without any error
The text was updated successfully, but these errors were encountered: