Skip to content

Repository works only when it defined at top level of grammar file #140

@graceful-potato

Description

@graceful-potato

In textmate you can define repositroy within a specific rule and it works fine.

I created this grammar file for test

<?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>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>
			<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>

result in textmate:
Screen Shot 2020-10-05 at 10 30 28
result in vscode:
Screenshot from 2020-10-06 22-50-26

In vscode whole rule stopped working without any error

Metadata

Metadata

Assignees

No one assigned

    Labels

    feature-requestRequest for new features or functionality

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions