PluginProbe
Code Block Pro – Beautiful Syntax Highlighting / 1.27.4
Code Block Pro – Beautiful Syntax Highlighting v1.27.4
1.27.1 1.27.2 1.27.3 1.27.4 1.27.5 1.27.6 1.27.7 1.28.0 1.3.0 1.4.0 1.5.0 1.5.1 1.5.2 1.6.0 1.7.0 1.8.0 1.9.0 1.9.1 1.9.2 1.9.3 trunk 1.1.0 1.10.0 1.11.0 1.11.1 All 63 releases
code-block-pro / build / shiki / languages / proto.tmLanguage.json

proto.tmLanguage.json in Code Block Pro – Beautiful Syntax Highlighting 1.27.4, at build/shiki/languages/proto.tmLanguage.json

505 lines 10.6 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 {
2 "name": "proto",
3 "scopeName": "source.proto",
4 "fileTypes": ["proto"],
5 "patterns": [
6 {
7 "include": "#comments"
8 },
9 {
10 "include": "#syntax"
11 },
12 {
13 "include": "#package"
14 },
15 {
16 "include": "#import"
17 },
18 {
19 "include": "#optionStmt"
20 },
21 {
22 "include": "#message"
23 },
24 {
25 "include": "#enum"
26 },
27 {
28 "include": "#service"
29 }
30 ],
31 "repository": {
32 "comments": {
33 "patterns": [
34 {
35 "name": "comment.block.proto",
36 "begin": "/\\*",
37 "end": "\\*/"
38 },
39 {
40 "name": "comment.line.double-slash.proto",
41 "begin": "//",
42 "end": "$\\n?"
43 }
44 ]
45 },
46 "syntax": {
47 "match": "\\s*(syntax)\\s*(=)\\s*(\"proto[23]\")\\s*(;)",
48 "captures": {
49 "1": {
50 "name": "keyword.other.proto"
51 },
52 "2": {
53 "name": "keyword.operator.assignment.proto"
54 },
55 "3": {
56 "name": "string.quoted.double.proto.syntax"
57 },
58 "4": {
59 "name": "punctuation.terminator.proto"
60 }
61 }
62 },
63 "package": {
64 "match": "\\s*(package)\\s+([\\w.]+)\\s*(;)",
65 "captures": {
66 "1": {
67 "name": "keyword.other.proto"
68 },
69 "2": {
70 "name": "string.unquoted.proto.package"
71 },
72 "3": {
73 "name": "punctuation.terminator.proto"
74 }
75 }
76 },
77 "import": {
78 "match": "\\s*(import)\\s+(weak|public)?\\s*(\"[^\"]+\")\\s*(;)",
79 "captures": {
80 "1": {
81 "name": "keyword.other.proto"
82 },
83 "2": {
84 "name": "keyword.other.proto"
85 },
86 "3": {
87 "name": "string.quoted.double.proto.import"
88 },
89 "4": {
90 "name": "punctuation.terminator.proto"
91 }
92 }
93 },
94 "optionStmt": {
95 "begin": "(option)\\s+(\\w+|\\(\\w+(\\.\\w+)*\\))(\\.\\w+)*\\s*(=)",
96 "beginCaptures": {
97 "1": {
98 "name": "keyword.other.proto"
99 },
100 "2": {
101 "name": "support.other.proto"
102 },
103 "3": {
104 "name": "support.other.proto"
105 },
106 "4": {
107 "name": "support.other.proto"
108 },
109 "5": {
110 "name": "keyword.operator.assignment.proto"
111 }
112 },
113 "end": "(;)",
114 "endCaptures": {
115 "1": {
116 "name": "punctuation.terminator.proto"
117 }
118 },
119 "patterns": [
120 {
121 "include": "#constants"
122 },
123 {
124 "include": "#number"
125 },
126 {
127 "include": "#string"
128 },
129 {
130 "include": "#subMsgOption"
131 }
132 ]
133 },
134 "subMsgOption": {
135 "begin": "\\{",
136 "end": "\\}",
137 "patterns": [
138 {
139 "include": "#kv"
140 },
141 {
142 "include": "#comments"
143 }
144 ]
145 },
146 "kv": {
147 "begin": "(\\w+)\\s*(:)",
148 "beginCaptures": {
149 "1": {
150 "name": "keyword.other.proto"
151 },
152 "2": {
153 "name": "punctuation.separator.key-value.proto"
154 }
155 },
156 "end": "(;)|,|(?=[}/_a-zA-Z])",
157 "endCaptures": {
158 "1": {
159 "name": "punctuation.terminator.proto"
160 }
161 },
162 "patterns": [
163 {
164 "include": "#constants"
165 },
166 {
167 "include": "#number"
168 },
169 {
170 "include": "#string"
171 },
172 {
173 "include": "#subMsgOption"
174 }
175 ]
176 },
177 "fieldOptions": {
178 "begin": "\\[",
179 "end": "\\]",
180 "patterns": [
181 {
182 "include": "#constants"
183 },
184 {
185 "include": "#number"
186 },
187 {
188 "include": "#string"
189 },
190 {
191 "include": "#subMsgOption"
192 },
193 {
194 "include": "#optionName"
195 }
196 ]
197 },
198 "optionName": {
199 "match": "(\\w+|\\(\\w+(\\.\\w+)*\\))(\\.\\w+)*",
200 "captures": {
201 "1": {
202 "name": "support.other.proto"
203 },
204 "2": {
205 "name": "support.other.proto"
206 },
207 "3": {
208 "name": "support.other.proto"
209 }
210 }
211 },
212 "message": {
213 "begin": "(message|extend)(\\s+)([A-Za-z_][A-Za-z0-9_.]*)(\\s*)(\\{)?",
214 "beginCaptures": {
215 "1": {
216 "name": "keyword.other.proto"
217 },
218 "3": {
219 "name": "entity.name.class.message.proto"
220 }
221 },
222 "end": "\\}",
223 "patterns": [
224 {
225 "include": "#reserved"
226 },
227 {
228 "include": "$self"
229 },
230 {
231 "include": "#enum"
232 },
233 {
234 "include": "#optionStmt"
235 },
236 {
237 "include": "#comments"
238 },
239 {
240 "include": "#oneof"
241 },
242 {
243 "include": "#field"
244 },
245 {
246 "include": "#mapfield"
247 }
248 ]
249 },
250 "reserved": {
251 "begin": "(reserved)\\s+",
252 "beginCaptures": {
253 "1": {
254 "name": "keyword.other.proto"
255 }
256 },
257 "end": "(;)",
258 "endCaptures": {
259 "1": {
260 "name": "punctuation.terminator.proto"
261 }
262 },
263 "patterns": [
264 {
265 "match": "(\\d+)(\\s+(to)\\s+(\\d+))?",
266 "captures": {
267 "1": {
268 "name": "constant.numeric.proto"
269 },
270 "3": {
271 "name": "keyword.other.proto"
272 },
273 "4": {
274 "name": "constant.numeric.proto"
275 }
276 }
277 },
278 {
279 "include": "#string"
280 }
281 ]
282 },
283 "field": {
284 "begin": "\\s*(optional|repeated|required)?\\s*\\b([\\w.]+)\\s+(\\w+)\\s*(=)\\s*(0[xX][0-9a-fA-F]+|[0-9]+)",
285 "beginCaptures": {
286 "1": {
287 "name": "storage.modifier.proto"
288 },
289 "2": {
290 "name": "storage.type.proto"
291 },
292 "3": {
293 "name": "variable.other.proto"
294 },
295 "4": {
296 "name": "keyword.operator.assignment.proto"
297 },
298 "5": {
299 "name": "constant.numeric.proto"
300 }
301 },
302 "end": "(;)",
303 "endCaptures": {
304 "1": {
305 "name": "punctuation.terminator.proto"
306 }
307 },
308 "patterns": [
309 {
310 "include": "#fieldOptions"
311 }
312 ]
313 },
314 "mapfield": {
315 "begin": "\\s*(map)\\s*(<)\\s*([\\w.]+)\\s*,\\s*([\\w.]+)\\s*(>)\\s+(\\w+)\\s*(=)\\s*(\\d+)",
316 "beginCaptures": {
317 "1": {
318 "name": "storage.type.proto"
319 },
320 "2": {
321 "name": "punctuation.definition.typeparameters.begin.proto"
322 },
323 "3": {
324 "name": "storage.type.proto"
325 },
326 "4": {
327 "name": "storage.type.proto"
328 },
329 "5": {
330 "name": "punctuation.definition.typeparameters.end.proto"
331 },
332 "6": {
333 "name": "variable.other.proto"
334 },
335 "7": {
336 "name": "keyword.operator.assignment.proto"
337 },
338 "8": {
339 "name": "constant.numeric.proto"
340 }
341 },
342 "end": "(;)",
343 "endCaptures": {
344 "1": {
345 "name": "punctuation.terminator.proto"
346 }
347 },
348 "patterns": [
349 {
350 "include": "#fieldOptions"
351 }
352 ]
353 },
354 "oneof": {
355 "begin": "(oneof)\\s+([A-Za-z][A-Za-z0-9_]*)\\s*\\{?",
356 "beginCaptures": {
357 "1": {
358 "name": "keyword.other.proto"
359 },
360 "2": {
361 "name": "variable.other.proto"
362 }
363 },
364 "end": "\\}",
365 "patterns": [
366 {
367 "include": "#optionStmt"
368 },
369 {
370 "include": "#comments"
371 },
372 {
373 "include": "#field"
374 }
375 ]
376 },
377 "enum": {
378 "begin": "(enum)(\\s+)([A-Za-z][A-Za-z0-9_]*)(\\s*)(\\{)?",
379 "beginCaptures": {
380 "1": {
381 "name": "keyword.other.proto"
382 },
383 "3": {
384 "name": "entity.name.class.proto"
385 }
386 },
387 "end": "\\}",
388 "patterns": [
389 {
390 "include": "#reserved"
391 },
392 {
393 "include": "#optionStmt"
394 },
395 {
396 "include": "#comments"
397 },
398 {
399 "begin": "([A-Za-z][A-Za-z0-9_]*)\\s*(=)\\s*(0[xX][0-9a-fA-F]+|[0-9]+)",
400 "beginCaptures": {
401 "1": {
402 "name": "variable.other.proto"
403 },
404 "2": {
405 "name": "keyword.operator.assignment.proto"
406 },
407 "3": {
408 "name": "constant.numeric.proto"
409 }
410 },
411 "end": "(;)",
412 "endCaptures": {
413 "1": {
414 "name": "punctuation.terminator.proto"
415 }
416 },
417 "patterns": [
418 {
419 "include": "#fieldOptions"
420 }
421 ]
422 }
423 ]
424 },
425 "service": {
426 "begin": "(service)\\s+([A-Za-z][A-Za-z0-9_.]*)\\s*\\{?",
427 "beginCaptures": {
428 "1": {
429 "name": "keyword.other.proto"
430 },
431 "2": {
432 "name": "entity.name.class.message.proto"
433 }
434 },
435 "end": "\\}",
436 "patterns": [
437 {
438 "include": "#comments"
439 },
440 {
441 "include": "#optionStmt"
442 },
443 {
444 "include": "#method"
445 }
446 ]
447 },
448 "method": {
449 "begin": "(rpc)\\s+([A-Za-z][A-Za-z0-9_]*)",
450 "beginCaptures": {
451 "1": {
452 "name": "keyword.other.proto"
453 },
454 "2": {
455 "name": "entity.name.function"
456 }
457 },
458 "end": "\\}|(;)",
459 "endCaptures": {
460 "1": {
461 "name": "punctuation.terminator.proto"
462 }
463 },
464 "patterns": [
465 {
466 "include": "#comments"
467 },
468 {
469 "include": "#optionStmt"
470 },
471 {
472 "include": "#rpcKeywords"
473 },
474 {
475 "include": "#ident"
476 }
477 ]
478 },
479 "rpcKeywords": {
480 "match": "\\b(stream|returns)\\b",
481 "name": "keyword.other.proto"
482 },
483 "ident": {
484 "match": "[A-Za-z][A-Za-z0-9_]*",
485 "name": "entity.name.class.proto"
486 },
487 "constants": {
488 "match": "\\b(true|false|max|[A-Z_]+)\\b",
489 "name": "constant.language.proto"
490 },
491 "storagetypes": {
492 "match": "\\b(double|float|int32|int64|uint32|uint64|sint32|sint64|fixed32|fixed64|sfixed32|sfixed64|bool|string|bytes)\\b",
493 "name": "storage.type.proto"
494 },
495 "string": {
496 "match": "('([^']|\\')*')|(\"([^\"]|\\\")*\")",
497 "name": "string.quoted.double.proto"
498 },
499 "number": {
500 "name": "constant.numeric.proto",
501 "match": "\\b((0(x|X)[0-9a-fA-F]*)|(([0-9]+\\.?[0-9]*)|(\\.[0-9]+))((e|E)(\\+|-)?[0-9]+)?)\\b"
502 }
503 }
504 }
505