-
Notifications
You must be signed in to change notification settings - Fork 24
/
tmlanguage.json
285 lines (285 loc) · 12.1 KB
/
tmlanguage.json
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
{
"$schema": "http://json-schema.org/schema#",
"id": "https://raw.githubusercontent.com/martinring/tmlanguage/master/tmlanguage.json",
"$ref": "#/definitions/root",
"definitions": {
"root": {
"allOf": [
{ "$ref": "#/definitions/grammar" },
{
"type": "object",
"properties": {
"name": { "type": "string" },
"scopeName": {
"description": "this should be a unique name for the grammar, following the convention of being a dot-separated name where each new (left-most) part specializes the name. Normally it would be a two-part name where the first is either text or source and the second is the name of the language or document type. But if you are specializing an existing type, you probably want to derive the name from the type you are specializing. For example Markdown is text.html.markdown and Ruby on Rails (rhtml files) is text.html.rails. The advantage of deriving it from (in this case) text.html is that everything which works in the text.html scope will also work in the text.html.«something» scope (but with a lower precedence than something specifically targeting text.html.«something»).",
"type": "string",
"pattern": "^(text|source)(\\.[\\w0-9-]+)+$"
},
"foldingStartMarker": {
"description": "regular expressions that lines (in the document) are matched against. If a line matches one of the patterns (but not both), it becomes a folding marker (see the foldings section for more info).",
"type": "string"
},
"foldingStopMarker": {
"description": "regular expressions that lines (in the document) are matched against. If a line matches one of the patterns (but not both), it becomes a folding marker (see the foldings section for more info).",
"type": "string"
},
"fileTypes": {
"description": "this is an array of file type extensions that the grammar should (by default) be used with. This is referenced when TextMate does not know what grammar to use for a file the user opens. If however the user selects a grammar from the language pop-up in the status bar, TextMate will remember that choice.",
"type": "array",
"items": { "type": "string" }
},
"uuid": { "type": "string" },
"firstLineMatch": { "type": "string" }
},
"required": [ "scopeName" ]
}
]
},
"grammar": {
"type": "object",
"properties": {
"patterns": {
"type": "array",
"items": { "$ref": "#/definitions/pattern" },
"default": [ ]
},
"repository": {
"description": "a dictionary (i.e. key/value pairs) of rules which can be included from other places in the grammar. The key is the name of the rule and the value is the actual rule. Further explanation (and example) follow with the description of the include rule key.",
"type": "object",
"additionalProperties": {
"$ref": "#/definitions/pattern"
}
}
},
"required": [
"patterns"
]
},
"captures": {
"type": "object",
"patternProperties": {
"^[0-9]+$": {
"type": "object",
"properties": {
"name": { "$ref": "#/definitions/name" },
"patterns": {
"type": "array",
"items": { "$ref": "#/definitions/pattern" },
"default": [ ]
}
},
"additionalProperties": false
}
},
"additionalProperties": false
},
"pattern": {
"type": "object",
"properties": {
"comment": { "type": "string" },
"disabled": { "type": "integer", "minimum": 0, "maximum": 1, "description": "set this property to 1 to disable the current pattern" },
"include": {
"description": "this allows you to reference a different language, recursively reference the grammar itself or a rule declared in this file’s repository.",
"type": "string"
},
"match": {
"description": "a regular expression which is used to identify the portion of text to which the name should be assigned. Example: '\\b(true|false)\\b'.",
"type": "string"
},
"name": {
"description": "the name which gets assigned to the portion matched. This is used for styling and scope-specific settings and actions, which means it should generally be derived from one of the standard names.",
"$ref": "#/definitions/name"
},
"contentName": {
"description": "this key is similar to the name key but only assigns the name to the text between what is matched by the begin/end patterns.",
"$ref": "#/definitions/name"
},
"begin": {
"description": "these keys allow matches which span several lines and must both be mutually exclusive with the match key. Each is a regular expression pattern. begin is the pattern that starts the block and end is the pattern which ends the block. Captures from the begin pattern can be referenced in the end pattern by using normal regular expression back-references. This is often used with here-docs. A begin/end rule can have nested patterns using the patterns key.",
"type": "string"
},
"end": {
"description": "these keys allow matches which span several lines and must both be mutually exclusive with the match key. Each is a regular expression pattern. begin is the pattern that starts the block and end is the pattern which ends the block. Captures from the begin pattern can be referenced in the end pattern by using normal regular expression back-references. This is often used with here-docs. A begin/end rule can have nested patterns using the patterns key.",
"type": "string"
},
"while": {
"description": "these keys allow matches which span several lines and must both be mutually exclusive with the match key. Each is a regular expression pattern. begin is the pattern that starts the block and while continues it.",
"type": "string"
},
"captures": {
"description": "allows you to assign attributes to the captures of the match pattern. Using the captures key for a begin/end rule is short-hand for giving both beginCaptures and endCaptures with same values.",
"$ref": "#/definitions/captures"
},
"beginCaptures": {
"description": "allows you to assign attributes to the captures of the begin pattern. Using the captures key for a begin/end rule is short-hand for giving both beginCaptures and endCaptures with same values.",
"$ref": "#/definitions/captures"
},
"endCaptures": {
"description": "allows you to assign attributes to the captures of the end pattern. Using the captures key for a begin/end rule is short-hand for giving both beginCaptures and endCaptures with same values.",
"$ref": "#/definitions/captures"
},
"whileCaptures": {
"description": "allows you to assign attributes to the captures of the while pattern. Using the captures key for a begin/while rule is short-hand for giving both beginCaptures and whileCaptures with same values.",
"$ref": "#/definitions/captures"
},
"patterns": {
"description": "applies to the region between the begin and end matches",
"type": "array",
"items": { "$ref": "#/definitions/pattern" },
"default": [ ]
},
"applyEndPatternLast": {
"type": "integer",
"minimum": 0,
"maximum": 1
}
},
"dependencies": {
"begin": {
"anyOf": [{ "required": [ "end" ] }, { "required": [ "while" ] }]
},
"end": [ "begin" ],
"while": [ "begin" ],
"contentName": {
"anyOf": [
{ "required": [ "begin", "end" ] },
{ "required": [ "begin", "while" ] }
]
},
"beginCaptures": {
"anyOf": [
{ "required": [ "begin", "end" ] },
{ "required": [ "begin", "while" ] }
]
},
"whileCaptures": [ "begin", "while" ],
"endCaptures": [ "begin", "end" ],
"applyEndPatternLast": [ "end" ]
}
},
"name": {
"anyOf": [
{
"type": "string"
},
{
"type": "string",
"enum": [
"comment",
"comment.block",
"comment.block.documentation",
"comment.line",
"comment.line.double-dash",
"comment.line.double-slash",
"comment.line.number-sign",
"comment.line.percentage",
"constant",
"constant.character",
"constant.character.escape",
"constant.language",
"constant.numeric",
"constant.other",
"constant.regexp",
"constant.rgb-value",
"constant.sha.git-rebase",
"emphasis",
"entity",
"entity.name",
"entity.name.class",
"entity.name.function",
"entity.name.method",
"entity.name.section",
"entity.name.selector",
"entity.name.tag",
"entity.name.type",
"entity.other",
"entity.other.attribute-name",
"entity.other.inherited-class",
"header",
"invalid",
"invalid.deprecated",
"invalid.illegal",
"keyword",
"keyword.control",
"keyword.control.less",
"keyword.operator",
"keyword.operator.new",
"keyword.other",
"keyword.other.unit",
"markup",
"markup.bold",
"markup.changed",
"markup.deleted",
"markup.heading",
"markup.inline.raw",
"markup.inserted",
"markup.italic",
"markup.list",
"markup.list.numbered",
"markup.list.unnumbered",
"markup.other",
"markup.punctuation.list.beginning",
"markup.punctuation.quote.beginning",
"markup.quote",
"markup.raw",
"markup.underline",
"markup.underline.link",
"meta",
"meta.cast",
"meta.parameter.type.variable",
"meta.preprocessor",
"meta.preprocessor.numeric",
"meta.preprocessor.string",
"meta.return-type",
"meta.selector",
"meta.structure.dictionary.key.python",
"meta.tag",
"meta.type.annotation",
"meta.type.name",
"metatag.php",
"storage",
"storage.modifier",
"storage.modifier.import.java",
"storage.modifier.package.java",
"storage.type",
"storage.type.cs",
"storage.type.java",
"string",
"string.html",
"string.interpolated",
"string.jade",
"string.other",
"string.quoted",
"string.quoted.double",
"string.quoted.other",
"string.quoted.single",
"string.quoted.triple",
"string.regexp",
"string.unquoted",
"string.xml",
"string.yaml",
"strong",
"support",
"support.class",
"support.constant",
"support.function",
"support.function.git-rebase",
"support.other",
"support.property-value",
"support.type",
"support.type.property-name",
"support.type.property-name.css",
"support.type.property-name.less",
"support.type.property-name.scss",
"support.variable",
"variable",
"variable.language",
"variable.name",
"variable.other",
"variable.parameter"
]
}
]
}
}
}