├── LICENSE
├── Protocol Buffers.tmbundle
├── Commands
│ ├── New Constant With Name.tmCommand
│ ├── New Field.tmCommand
│ ├── New Message.tmCommand
│ └── New RPC Method With Name.tmCommand
├── Preferences
│ └── Comments.tmPreferences
├── Snippets
│ ├── Extend Block.tmSnippet
│ ├── Field.tmSnippet
│ ├── RPC Message.tmSnippet
│ ├── Service.tmSnippet
│ ├── enum ___.tmSnippet
│ ├── method option ___.tmSnippet
│ └── option ___.tmSnippet
├── Syntaxes
│ └── Protocol Buffer.tmLanguage
└── info.plist
└── README.md
/LICENSE:
--------------------------------------------------------------------------------
1 | Copyright (c) 2009 Michael Edgar
2 |
3 | Permission is hereby granted, free of charge, to any person obtaining
4 | a copy of this software and associated documentation files (the
5 | "Software"), to deal in the Software without restriction, including
6 | without limitation the rights to use, copy, modify, merge, publish,
7 | distribute, sublicense, and/or sell copies of the Software, and to
8 | permit persons to whom the Software is furnished to do so, subject to
9 | the following conditions:
10 |
11 | The above copyright notice and this permission notice shall be
12 | included in all copies or substantial portions of the Software.
13 |
14 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
15 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
17 | NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
18 | LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
19 | OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
20 | WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
--------------------------------------------------------------------------------
/Protocol Buffers.tmbundle/Commands/New Constant With Name.tmCommand:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | beforeRunningCommand
6 | nop
7 | command
8 | #!/usr/bin/env ruby -wKU
9 |
10 | require "#{ENV['TM_SUPPORT_PATH']}/lib/exit_codes"
11 | require "#{ENV['TM_SUPPORT_PATH']}/lib/escape"
12 |
13 | method_name = ENV["TM_SELECTED_TEXT"] || ENV["TM_CURRENT_WORD"] or
14 | TextMate.exit_show_tool_tip(
15 | "Please type the new function's name or use the def⇥ snippet."
16 | )
17 |
18 | print <<END_SNIPPET
19 | #{e_sn(method_name).gsub(/[a-z][A-Z]/) {|x| x.split(//).join('_')}.upcase} = ${2:0};
20 | END_SNIPPET
21 |
22 | fallbackInput
23 | word
24 | input
25 | selection
26 | keyEquivalent
27 | $
28 | name
29 | New Constant With Name
30 | output
31 | insertAsSnippet
32 | scope
33 | meta.enum-declaration.protobuf
34 | uuid
35 | 3524E447-B4A9-4EBA-A2D0-FC3593755AC9
36 |
37 |
38 |
--------------------------------------------------------------------------------
/Protocol Buffers.tmbundle/Commands/New Field.tmCommand:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | beforeRunningCommand
6 | nop
7 | command
8 | #!/usr/bin/env ruby -wKU
9 |
10 | require "#{ENV['TM_SUPPORT_PATH']}/lib/exit_codes"
11 | require "#{ENV['TM_SUPPORT_PATH']}/lib/escape"
12 |
13 | method_name = ENV["TM_SELECTED_TEXT"] || ENV["TM_CURRENT_WORD"] or
14 | TextMate.exit_show_tool_tip(
15 | "Please type the new function's name or use the def⇥ snippet."
16 | )
17 |
18 | print <<END_SNIPPET
19 | ${0:optional} ${1:type} #{e_sn method_name} = ${2:-1};
20 | END_SNIPPET
21 |
22 | fallbackInput
23 | word
24 | input
25 | selection
26 | keyEquivalent
27 | $
28 | name
29 | New Field With Name
30 | output
31 | insertAsSnippet
32 | scope
33 | meta.message-declaration.protobuf
34 | uuid
35 | AD99D1DA-0A8C-47FF-AD80-681F3F4E5537
36 |
37 |
38 |
--------------------------------------------------------------------------------
/Protocol Buffers.tmbundle/Commands/New Message.tmCommand:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | beforeRunningCommand
6 | nop
7 | command
8 | #!/usr/bin/env ruby -wKU
9 |
10 | require "#{ENV['TM_SUPPORT_PATH']}/lib/exit_codes"
11 | require "#{ENV['TM_SUPPORT_PATH']}/lib/escape"
12 |
13 | method_name = ENV["TM_SELECTED_TEXT"] || ENV["TM_CURRENT_WORD"] or
14 | TextMate.exit_show_tool_tip(
15 | "Please type the new function's name or use the def⇥ snippet."
16 | )
17 |
18 | print <<END_SNIPPET
19 | message #{e_sn method_name} {
20 | $0
21 | }
22 | END_SNIPPET
23 |
24 | fallbackInput
25 | word
26 | input
27 | selection
28 | keyEquivalent
29 | $
30 | name
31 | New Message With Name
32 | output
33 | insertAsSnippet
34 | scope
35 | source.protobuf
36 | uuid
37 | 5D795123-5FBB-40CC-A068-93B5352F100F
38 |
39 |
40 |
--------------------------------------------------------------------------------
/Protocol Buffers.tmbundle/Commands/New RPC Method With Name.tmCommand:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | beforeRunningCommand
6 | nop
7 | command
8 | #!/usr/bin/env ruby -wKU
9 |
10 | require "#{ENV['TM_SUPPORT_PATH']}/lib/exit_codes"
11 | require "#{ENV['TM_SUPPORT_PATH']}/lib/escape"
12 |
13 | method_name = ENV["TM_SELECTED_TEXT"] || ENV["TM_CURRENT_WORD"] or
14 | TextMate.exit_show_tool_tip(
15 | "Please type the new function's name or use the def⇥ snippet."
16 | )
17 |
18 | print <<END_SNIPPET
19 | rpc #{e_sn(method_name)} (${1:RequestType}) returns (${2:ResponseType});
20 | END_SNIPPET
21 |
22 | fallbackInput
23 | word
24 | input
25 | selection
26 | keyEquivalent
27 | $
28 | name
29 | New RPC Method With Name
30 | output
31 | insertAsSnippet
32 | scope
33 | meta.service-declaration.protobuf
34 | uuid
35 | B6FF17FE-9A75-4BDE-8B49-A11803C8F22E
36 |
37 |
38 |
--------------------------------------------------------------------------------
/Protocol Buffers.tmbundle/Preferences/Comments.tmPreferences:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | name
6 | Comments
7 | scope
8 | source.protobuf
9 | settings
10 |
11 | shellVariables
12 |
13 |
14 | name
15 | TM_COMMENT_START
16 | value
17 | //
18 |
19 |
20 |
21 | uuid
22 | 3374EB01-B984-4B0B-B2B9-03AB22317F0C
23 |
24 |
25 |
--------------------------------------------------------------------------------
/Protocol Buffers.tmbundle/Snippets/Extend Block.tmSnippet:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | content
6 | extend ${1:MessageToExtend} {
7 | $2
8 | }
9 | name
10 | extend ...
11 | scope
12 | source.protobuf
13 | tabTrigger
14 | extend
15 | uuid
16 | 25F279E7-CAC8-4498-ACA7-36C1F2458739
17 |
18 |
19 |
--------------------------------------------------------------------------------
/Protocol Buffers.tmbundle/Snippets/Field.tmSnippet:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | content
6 | ${1:optional} ${2:type} ${3:field_name} = ${4:0};$5
7 | name
8 | field
9 | scope
10 | meta.message-declaration.protobuf
11 | tabTrigger
12 | field
13 | uuid
14 | B0341631-FC60-46C4-BEE9-F674C06273C2
15 |
16 |
17 |
--------------------------------------------------------------------------------
/Protocol Buffers.tmbundle/Snippets/RPC Message.tmSnippet:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | content
6 | rpc ${1:MethodName} (${2:RequestType}) returns (${3:ResponseType});
7 | name
8 | rpc ... (...) returns (...);
9 | scope
10 | meta.service-declaration.protobuf
11 | tabTrigger
12 | rpc
13 | uuid
14 | BBEFB63C-5ED0-4019-BF8E-E9B3669BAED8
15 |
16 |
17 |
--------------------------------------------------------------------------------
/Protocol Buffers.tmbundle/Snippets/Service.tmSnippet:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | content
6 | service ${1:ServiceName} {
7 | $2
8 | }
9 | name
10 | service ...
11 | scope
12 | source.protobuf
13 | tabTrigger
14 | service
15 | uuid
16 | 536422CB-6606-427B-A6C3-61C0A6BBD2FD
17 |
18 |
19 |
--------------------------------------------------------------------------------
/Protocol Buffers.tmbundle/Snippets/enum ___.tmSnippet:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | content
6 | enum ${1:EnumName} {
7 | $2
8 | }
9 | name
10 | enum ...
11 | scope
12 | source.protobuf
13 | tabTrigger
14 | enum
15 | uuid
16 | FE73E00A-2790-471F-8FEF-43DB603589B2
17 |
18 |
19 |
--------------------------------------------------------------------------------
/Protocol Buffers.tmbundle/Snippets/method option ___.tmSnippet:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | content
6 | option ${1:option_name}.${2:option_field} = ${3:value};
7 | name
8 | method option ...
9 | scope
10 | meta.method-mofification.protobuf
11 | tabTrigger
12 | opt
13 | uuid
14 | 7921C92E-B106-43A9-96CF-0528BFA8FD51
15 |
16 |
17 |
--------------------------------------------------------------------------------
/Protocol Buffers.tmbundle/Snippets/option ___.tmSnippet:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | content
6 | option ${1:option_name} = ${2:value};
7 | name
8 | option ...
9 | scope
10 | source.protobuf
11 | tabTrigger
12 | opt
13 | uuid
14 | B6717D98-6653-47AB-8BC5-56BEB0902D16
15 |
16 |
17 |
--------------------------------------------------------------------------------
/Protocol Buffers.tmbundle/Syntaxes/Protocol Buffer.tmLanguage:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | fileTypes
6 |
7 | proto
8 |
9 | foldingStartMarker
10 | /\*\*|\{\s*$
11 | foldingStopMarker
12 | \*\*/|^\s*\}
13 | name
14 | Protocol Buffer
15 | patterns
16 |
17 |
18 | captures
19 |
20 | 1
21 |
22 | name
23 | keyword.other.import.protobuf
24 |
25 | 2
26 |
27 | name
28 | string.quoted.double.import.protobuf
29 |
30 |
31 | match
32 | (import) (".*")
33 | name
34 | meta.import.declaration.protobuf
35 |
36 |
37 | captures
38 |
39 | 1
40 |
41 | name
42 | keyword.other.syntax.protobuf
43 |
44 | 2
45 |
46 | name
47 | string.quoted.double.syntax.protobuf
48 |
49 |
50 | match
51 | (syntax)\s*=\s*(".*")
52 | name
53 | meta.syntax.declaration.protobuf
54 |
55 |
56 | begin
57 | \b(message)\s+([A-Za-z0-9_]+)\s*\{
58 | captures
59 |
60 | 1
61 |
62 | name
63 | storage.type.message.protobuf
64 |
65 | 2
66 |
67 | name
68 | entity.name.type.message.protobuf
69 |
70 |
71 | end
72 | }
73 | name
74 | meta.message-declaration.protobuf
75 | patterns
76 |
77 |
78 | include
79 | $self
80 |
81 |
82 | include
83 | #any_field
84 |
85 |
86 | include
87 | #comments
88 |
89 |
90 | include
91 | #multiline_comments
92 |
93 |
94 |
95 |
96 | begin
97 | \b(enum)\s+([A-Za-z0-9_]+)\s*\{
98 | beginCaptures
99 |
100 | 1
101 |
102 | name
103 | storage.type.enum.protobuf
104 |
105 | 2
106 |
107 | name
108 | entity.name.type.enum.protobuf
109 |
110 |
111 | end
112 | }
113 | name
114 | meta.enum-declaration.protobuf
115 | patterns
116 |
117 |
118 | captures
119 |
120 | 1
121 |
122 | name
123 | constant.other.user-defined.protobuf
124 |
125 | 2
126 |
127 | name
128 | constant.numeric.protobuf
129 |
130 |
131 | match
132 | \b([A-Za-z0-9_]+)\s*=\s*(\d+)\b
133 | name
134 | meta.individual-enum-definition.protobuf
135 |
136 |
137 | include
138 | #anywhere_option
139 |
140 |
141 | include
142 | #bracketed_option
143 |
144 |
145 | include
146 | #comments
147 |
148 |
149 | include
150 | #multiline_comments
151 |
152 |
153 |
154 |
155 | begin
156 | \b(oneof)\s+([A-Za-z0-9_]+)\s*\{
157 | beginCaptures
158 |
159 | 1
160 |
161 | name
162 | storage.type.oneof.protobuf
163 |
164 | 2
165 |
166 | name
167 | entity.name.type.oneof.protobuf
168 |
169 |
170 | end
171 | }
172 | name
173 | meta.oneof-declaration.protobuf
174 | patterns
175 |
176 |
177 | captures
178 |
179 | 1
180 |
181 | name
182 | constant.other.user-defined.protobuf
183 |
184 | 2
185 |
186 | name
187 | constant.numeric.protobuf
188 |
189 |
190 | match
191 | \b([A-Za-z0-9_]+)\s*=\s*(\d+)\b
192 | name
193 | meta.individual-oneof-definition.protobuf
194 |
195 |
196 | include
197 | $self
198 |
199 |
200 | include
201 | #any_field
202 |
203 |
204 | include
205 | #comments
206 |
207 |
208 | include
209 | #multiline_comments
210 |
211 |
212 |
213 |
214 | begin
215 | \b(service)\s+([A-Za-z0-9_]+)\s*\{
216 | beginCaptures
217 |
218 | 1
219 |
220 | name
221 | storage.type.enum.protobuf
222 |
223 | 2
224 |
225 | name
226 | entity.name.type.enum.protobuf
227 |
228 |
229 | end
230 | }
231 | name
232 | meta.service-declaration.protobuf
233 | patterns
234 |
235 |
236 | captures
237 |
238 | 1
239 |
240 | name
241 | keyword.other.rpc-definition.protobuf
242 |
243 | 2
244 |
245 | name
246 | entity.name.function.service-rpc.protobuf
247 |
248 | 3
249 |
250 | name
251 | variable.parameter.request-type.protobuf
252 |
253 | 4
254 |
255 | name
256 | keyword.operator.returns.protobuf
257 |
258 | 5
259 |
260 | name
261 | variable.parameter.response-type.protobuf
262 |
263 |
264 | match
265 | \b(rpc)\s+([A-Za-z0-9_]+)\s+\(([A-Za-z0-9_.]+)\)\s*(returns)\s*\(([A-Za-z0-9_.]+)\)\s*;
266 | name
267 | meta.individual-rpc-call.protobuf
268 |
269 |
270 | begin
271 | \b(method)\s+([A-Za-z0-9_]+)\s*\(\s*\)\s*{
272 | captures
273 |
274 | 1
275 |
276 | name
277 | keyword.other.method-modification.protobuf
278 |
279 | 2
280 |
281 | name
282 | entity.name.function.protobuf
283 |
284 |
285 | end
286 | }
287 | name
288 | meta.method-mofification.protobuf
289 | patterns
290 |
291 |
292 | include
293 | #comments
294 |
295 |
296 | include
297 | #rpc_string_attribute
298 |
299 |
300 | include
301 | #rpc_primitive_attribute
302 |
303 |
304 |
305 |
306 | include
307 | #anywhere_option
308 |
309 |
310 | include
311 | #comments
312 |
313 |
314 | include
315 | #multiline_comments
316 |
317 |
318 |
319 |
320 | captures
321 |
322 | 1
323 |
324 | name
325 | keyword.other.package-definition.protobuf
326 |
327 | 2
328 |
329 | name
330 | entity.name.section.protobuf
331 |
332 |
333 | match
334 | \b(package)\s+([A-Za-z0-9._]+)\s*;
335 | name
336 | meta.package.protobuf
337 |
338 |
339 | captures
340 |
341 | 1
342 |
343 | name
344 | storage.modifier.extensions.protobuf
345 |
346 | 2
347 |
348 | name
349 | constant.numeric.protobufs
350 |
351 | 3
352 |
353 | name
354 | keyword.operator.to.protobufs
355 |
356 | 4
357 |
358 | name
359 | constant.numeric.protobufs
360 |
361 |
362 | match
363 | (extensions)\s+(\d+)\s+(to)\s+(max|\d+);
364 | name
365 | meta.extension-specification.protobuf
366 |
367 |
368 | include
369 | #anywhere_option
370 |
371 |
372 | include
373 | #bracketed_option
374 |
375 |
376 | include
377 | #extend_block
378 |
379 |
380 | include
381 | #comments
382 |
383 |
384 | include
385 | #multiline_comments
386 |
387 |
388 | repository
389 |
390 | any_field
391 |
392 | patterns
393 |
394 |
395 | include
396 | #primitive_field
397 |
398 |
399 | include
400 | #group_field
401 |
402 |
403 | include
404 | #user_defined_message_field
405 |
406 |
407 | include
408 | #reserved_field
409 |
410 |
411 |
412 | anywhere_option
413 |
414 | begin
415 | (option)\s+
416 | beginCaptures
417 |
418 | 1
419 |
420 | name
421 | keyword.other.option.protobuf
422 |
423 |
424 | end
425 | ;
426 | patterns
427 |
428 |
429 | include
430 | #attribute
431 |
432 |
433 |
434 | attribute
435 |
436 | patterns
437 |
438 |
439 | include
440 | #indiv_attribute
441 |
442 |
443 | include
444 | #string_attribute
445 |
446 |
447 |
448 | bracketed_option
449 |
450 | begin
451 | \[
452 | end
453 | ;
454 | patterns
455 |
456 |
457 | include
458 | #attribute
459 |
460 |
461 |
462 | comments
463 |
464 | begin
465 | //
466 | end
467 | \n
468 | name
469 | comment.line.double-slash.protobuf
470 |
471 | extend_block
472 |
473 | begin
474 | \b(extend)\s+([A-Za-z0-9_]+)\s*\{
475 | captures
476 |
477 | 1
478 |
479 | name
480 | storage.type.extend.protobuf
481 |
482 | 2
483 |
484 | name
485 | entity.name.type.message.protobuf
486 |
487 |
488 | end
489 | }
490 | patterns
491 |
492 |
493 | include
494 | #any_field
495 |
496 |
497 | include
498 | #comments
499 |
500 |
501 |
502 | group_field
503 |
504 | begin
505 | (required|optional|repeated)?\s+?(group)\s+([A-Za-z0-9_]+)\s*=\s*(\d+)\s*{
506 | captures
507 |
508 | 1
509 |
510 | name
511 | keyword.control.occurrences.protobuf
512 |
513 | 2
514 |
515 | name
516 | invalid.deprecated.groups.protobuf
517 |
518 | 3
519 |
520 | name
521 | variable.other.primitive-field.protobuf
522 |
523 | 4
524 |
525 | name
526 | constant.numeric.field-tag.protobuf
527 |
528 |
529 | end
530 | }
531 | patterns
532 |
533 |
534 | include
535 | #any_field
536 |
537 |
538 | include
539 | #comments
540 |
541 |
542 |
543 | indiv_attribute
544 |
545 | captures
546 |
547 | 1
548 |
549 | name
550 | entity.other.attribute-name.protobuf
551 |
552 | 2
553 |
554 | name
555 | constant.language.field-option-values.protobuf
556 |
557 |
558 | match
559 | \(?([A-Za-z0-9_.]+)\)?\s*=\s*(true|false|\d+|([A-Z_]+))\b
560 |
561 | multiline_comments
562 |
563 | begin
564 | /\*
565 | end
566 | \*/
567 | name
568 | comment.block.protobuf
569 |
570 | primitive_field
571 |
572 | captures
573 |
574 | 1
575 |
576 | name
577 | keyword.control.occurrences.protobuf
578 |
579 | 2
580 |
581 | name
582 | storage.type.built-in.protobuf
583 |
584 | 6
585 |
586 | name
587 | variable.other.primitive-field.protobuf
588 |
589 | 7
590 |
591 | name
592 | constant.numeric.field-tag.protobuf
593 |
594 |
595 | match
596 | (required|optional|repeated)?\s+?(((s|u)?int|s?fixed)(32|64)|string|bytes|bool)\s+(\S+)\s*=\s*(\d+)
597 |
598 | reserved_field
599 |
600 | captures
601 |
602 | 1
603 |
604 | name
605 | keyword.control.occurrences.protobuf
606 |
607 | 2
608 |
609 | name
610 | constant.numeric.field-tag.protobuf
611 |
612 |
613 | match
614 | (reserved)\s+(\d+)
615 |
616 | rpc_primitive_attribute
617 |
618 | beginCaptures
619 |
620 | 1
621 |
622 | name
623 | keyword.other.option.protobuf
624 |
625 | 2
626 |
627 | name
628 | entity.other.attribute-name.protobuf
629 |
630 | 3
631 |
632 | name
633 | entity.other.attribute-name.protobuf
634 |
635 | 4
636 |
637 | name
638 | constant.numeric.protobuf
639 |
640 |
641 | match
642 | (option)\s+\(?([A-Za-z0-9_.]+)\)?\.([A-Za-z0-9.]+)\s*=\s*(true|false|\d+|([A-Z_]+))\b
643 |
644 | rpc_string_attribute
645 |
646 | begin
647 | (option)\s+\(?([A-Za-z0-9_.]+)\)?\.([A-Za-z0-9.]+)\s*=\s*(")
648 | beginCaptures
649 |
650 | 1
651 |
652 | name
653 | keyword.other.option.protobuf
654 |
655 | 2
656 |
657 | name
658 | entity.other.attribute-name.protobuf
659 |
660 | 3
661 |
662 | name
663 | entity.other.attribute-name.protobuf
664 |
665 | 4
666 |
667 | name
668 | string.quoted.double.protobuf
669 |
670 |
671 | contentName
672 | string.quoted.double.protobuf
673 | end
674 | (")
675 | endCaptures
676 |
677 | 1
678 |
679 | name
680 | string.quoted.double.protobuf
681 |
682 |
683 |
684 | string_attribute
685 |
686 | begin
687 | \(?([A-Za-z0-9_.]+)\)?\s*=\s*(")
688 | beginCaptures
689 |
690 | 1
691 |
692 | name
693 | entity.other.attribute-name.protobuf
694 |
695 | 2
696 |
697 | name
698 | string.quoted.double.protobuf
699 |
700 |
701 | contentName
702 | string.quoted.double.protobuf
703 | end
704 | (")
705 | endCaptures
706 |
707 | 1
708 |
709 | name
710 | string.quoted.double.protobuf
711 |
712 |
713 |
714 | user_defined_message_field
715 |
716 | captures
717 |
718 | 1
719 |
720 | name
721 | keyword.control.occurrences.protobuf
722 |
723 | 2
724 |
725 | name
726 | support.class.user-defined-type.protobuf
727 |
728 | 3
729 |
730 | name
731 | variable.other.primitive-field.protobuf
732 |
733 | 4
734 |
735 | name
736 | constant.numeric.field-tag.protobuf
737 |
738 |
739 | match
740 | (required|optional|repeated)?\s+?([A-Za-z._]*)\s+(\S+)\s*=\s*(\d+)
741 |
742 |
743 | scopeName
744 | source.protobuf
745 | uuid
746 | D1D0E31F-1807-408E-A184-00F4D0A2619F
747 |
748 |
749 |
--------------------------------------------------------------------------------
/Protocol Buffers.tmbundle/info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | mainMenu
6 |
7 | excludedItems
8 |
9 | 3524E447-B4A9-4EBA-A2D0-FC3593755AC9
10 | B6FF17FE-9A75-4BDE-8B49-A11803C8F22E
11 | AD99D1DA-0A8C-47FF-AD80-681F3F4E5537
12 | 5D795123-5FBB-40CC-A068-93B5352F100F
13 |
14 | items
15 |
16 | B0341631-FC60-46C4-BEE9-F674C06273C2
17 | BBEFB63C-5ED0-4019-BF8E-E9B3669BAED8
18 | 536422CB-6606-427B-A6C3-61C0A6BBD2FD
19 | 25F279E7-CAC8-4498-ACA7-36C1F2458739
20 | FE73E00A-2790-471F-8FEF-43DB603589B2
21 | 7921C92E-B106-43A9-96CF-0528BFA8FD51
22 | B6717D98-6653-47AB-8BC5-56BEB0902D16
23 |
24 | submenus
25 |
26 |
27 | name
28 | Protocol Buffers
29 | ordering
30 |
31 | D1D0E31F-1807-408E-A184-00F4D0A2619F
32 | 3374EB01-B984-4B0B-B2B9-03AB22317F0C
33 | 5D795123-5FBB-40CC-A068-93B5352F100F
34 | 3524E447-B4A9-4EBA-A2D0-FC3593755AC9
35 | B6FF17FE-9A75-4BDE-8B49-A11803C8F22E
36 | AD99D1DA-0A8C-47FF-AD80-681F3F4E5537
37 | B0341631-FC60-46C4-BEE9-F674C06273C2
38 | FE73E00A-2790-471F-8FEF-43DB603589B2
39 | 25F279E7-CAC8-4498-ACA7-36C1F2458739
40 | 7921C92E-B106-43A9-96CF-0528BFA8FD51
41 | B6717D98-6653-47AB-8BC5-56BEB0902D16
42 | 536422CB-6606-427B-A6C3-61C0A6BBD2FD
43 | BBEFB63C-5ED0-4019-BF8E-E9B3669BAED8
44 |
45 | uuid
46 | 2B328B48-DB8E-4925-BCCC-5C13984FB676
47 |
48 |
49 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # protobuf.tmbundle
2 |
3 | Adds syntax highlighting and a few useful commands/snippets for Google's protocol buffer description language.
4 |
5 | ## Is that it?
6 |
7 | For the most part. Though one neat feature is that - unlike most TextMate language descriptions - this one doesn't just look for keywords and highlight them. It actually builds up a mini-ADT that it highlights, and it *only* highlights things that fit its notion of a .proto file's structure. If you put this:
8 |
9 | optional int64 timestamp = 3;
10 |
11 | outside of a message (or group, or extend...) declaration, it won't highlight. For the most part, this will be true: an rpc method declaration won't highlight except in a `Service` declaration.
12 |
13 | Snippets are location-aware, so the `field` snippet (which generates a new message field) won't work except in a message. so using the `opt` snippet to generate an option will help you generate this in a message:
14 |
15 | message Foo {
16 | option message_set_wire_format = true;
17 | }
18 |
19 | but in an RPC method, it will help you generate this:
20 |
21 | service FooService {
22 | method MyMethod() {
23 | option (method_option).timestamp = 123;
24 | }
25 | }
26 |
27 | Notice how method options are structured slightly differently.
28 |
29 | Also, TextMate has a shift-enter idiom for creating new functions/methods. At the top-level, this bundle will generate a new Message. Inside a message, this command will generate a new field. Inside an enum, it will generate a new enum value declaration (and automatically `UPCASE_AND_UNDERSCORE` the enum value name). Inside a Service declaration, it will generate a new rpc method.
30 |
31 | These things are possible because this bundle actually understands the structure of the entire message, which is easy due to the intentionally-simple structure of .proto files.
32 |
33 | ## Installation
34 |
35 | If only there were a straightforward way to install Bundles. Well, this always works:
36 |
37 | mkdir -p ~/"Library/Application Support/TextMate/Bundles/"
38 | cd ~/"Library/Application Support/TextMate/Bundles/"
39 | git clone git://github.com/michaeledgar/protobuf-tmbundle "Protocol Buffers.tmbundle"
40 | osascript -e 'tell app "TextMate" to reload bundles'
41 |
42 | Pretty much all there is to it. All `.proto` files will be picked up by the bundle.
43 |
44 | ## Copyright
45 |
46 | Copyright (c) 2010 Michael Edgar. See LICENSE for details.
--------------------------------------------------------------------------------