Sublime Forum

How make a new Syntax Definitions for comments

#1

i want make a new Syntax Definitions for new language name is curl.
so a make a tmlanguage file name is curl.tmlanguage . and also copy a comments language file. but i am not sure the the comments file is work ok?
my tmlanguage file:

	<key>fileTypes</key>
	<array>
		<string>scurl</string>
	</array>
	<key>name</key>
	<string>Curl</string>
	<key>patterns</key>
	<array>
		<dict>
			<key>include</key>
			<string>#comments</string>
		</dict>
	</array>
	<key>scopeName</key>
	<string>source.scurl</string>
	<key>uuid</key>
	<string>2d87578f-e2a0-4fb4-8592-42eeada4dc24</string>

the comments file:

	<key>name</key>
	<string>Comments</string>
	<key>scope</key>
	<string>source.surl</string>
	<key>settings</key>
	<dict>
		<key>shellVariables</key>
		<array>
			<dict>
				<key>name</key>
				<string>TM_COMMENT_START</string>
				<key>value</key>
				<string>|| </string>
			</dict>
			<dict>
				<key>name</key>
				<string>TM_COMMENT_START_2</string>
				<key>value</key>
				<string>|#</string>
			</dict>
			<dict>
				<key>name</key>
				<string>TM_COMMENT_END_2</string>
				<key>value</key>
				<string>#|</string>
			</dict>
		</array>
	</dict>
	<key>uuid</key>
	<string>FBA964F9-EA31-44D1-A5FD-AE8AB3FF8954</string>

so when i edit the curl file. i input ||] or|# #|].the code not change color. so i think my Syntax Definitions not work. but don’t no why.

0 Likes