Sublime Forum

Trying to add a scope selector to language file

#1

I have been using the excellent new “kit language” supported by CodeKit. Basically, there are special comments that are treated as includes in regular HTML files, like

<!-- @include _header.kit -->

So I’d like to add a scope so I can color these differently from other comments.

I tried copying the code from the ASP tmLanguage file, since it was close, and pasted it into the HTML.tmLanguage file like below, but so far that scope is not showing up in the document with scope hunter:

<dict>
			<key>begin</key>
			<string>&lt;!-- @</string>
			<key>beginCaptures</key>
			<dict>
				<key>0</key>
				<dict>
					<key>name</key>
					<string>punctuation.section.embedded.begin.asp</string>
				</dict>
			</dict>
			<key>end</key>
			<string>&gt;</string>
			<key>endCaptures</key>
			<dict>
				<key>0</key>
				<dict>
					<key>name</key>
					<string>punctuation.section.embedded.end.asp</string>
				</dict>
			</dict>
			<key>name</key>
			<string>source.asp.embedded.html</string>
			<key>patterns</key>
			<array>
				<dict>
					<key>captures</key>
					<dict>
						<key>1</key>
						<dict>
							<key>name</key>
							<string>punctuation.definition.comment.asp</string>
						</dict>
					</dict>
					<key>match</key>
					<string>(').*?(?=%&gt;)</string>
					<key>name</key>
					<string>comment.line.apostrophe.asp</string>
				</dict>
				<dict>
					<key>include</key>
					<string>#embedded-code</string>
				</dict>
			</array>
		</dict>

Since my color scheme already has a color for punctuation.section.embedded.begin.asp etc. I figured this would be simpler.

Anyone ever do this? What am I missing?

0 Likes