├── Comments.YAML-tmPreferences
├── Comments.tmPreferences
├── Protocol.sublime-snippet
├── README.md
├── SprotoType.sublime-snippet
├── Symbol List.YAML-tmPreferences
├── Symbol List.tmPreferences
├── sproto.YAML-tmLanguage
└── sproto.tmLanguage
/Comments.YAML-tmPreferences:
--------------------------------------------------------------------------------
1 | # [PackageDev] target_format: plist, ext: tmPreferences
2 |
3 | name: Comments
4 | scope: source.sproto
5 | uuid: 3cab9ed8-9205-4f22-b1fb-cc20617037e8
6 |
7 | settings:
8 | shellVariables:
9 | - name: TM_COMMENT_START
10 | value: '# '
--------------------------------------------------------------------------------
/Comments.tmPreferences:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | name
6 | Comments
7 | scope
8 | source.sproto
9 | settings
10 |
11 | shellVariables
12 |
13 |
14 | name
15 | TM_COMMENT_START
16 | value
17 | #
18 |
19 |
20 |
21 | uuid
22 | 3cab9ed8-9205-4f22-b1fb-cc20617037e8
23 |
24 |
25 |
--------------------------------------------------------------------------------
/Protocol.sublime-snippet:
--------------------------------------------------------------------------------
1 |
2 |
8 | protocol
9 | source.sproto
10 |
11 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # sublime-sproto-syntax highlight
2 |
3 |
4 | ##preview
5 | ;D
6 |
7 |
--------------------------------------------------------------------------------
/SprotoType.sublime-snippet:
--------------------------------------------------------------------------------
1 |
2 |
7 | type
8 | source.sproto
9 |
10 |
--------------------------------------------------------------------------------
/Symbol List.YAML-tmPreferences:
--------------------------------------------------------------------------------
1 | # [PackageDev] target_format: plist, ext: tmPreferences
2 |
3 | name: Symbol List
4 | scope: "entity.name.type.sproto, variable.parameter.function.sproto"
5 | uuid: c2234a3a-2e4e-4c92-af3e-5640847d91c6
6 |
7 |
8 | settings:
9 | showInSymbolList: "1"
10 | showInIndexedSymbolList: "1"
11 |
--------------------------------------------------------------------------------
/Symbol List.tmPreferences:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | name
6 | Symbol List
7 | scope
8 | entity.name.type.sproto, variable.parameter.function.sproto
9 | settings
10 |
11 | showInIndexedSymbolList
12 | 1
13 | showInSymbolList
14 | 1
15 |
16 | uuid
17 | c2234a3a-2e4e-4c92-af3e-5640847d91c6
18 |
19 |
20 |
--------------------------------------------------------------------------------
/sproto.YAML-tmLanguage:
--------------------------------------------------------------------------------
1 | # [PackageDev] target_format: plist, ext: tmLanguage
2 | name: sproto
3 | scopeName: source.sproto
4 | fileTypes: [sproto]
5 | uuid: 5899f948-bdc0-4cb9-b282-50efe7c5d15d
6 | patterns:
7 | - include: '#comment'
8 | - include: '#sproto_type'
9 | - include: '#sproto_protocol'
10 | - name: constant.numeric.sproto
11 | match: \b((0(x|X)[0-9a-fA-F]*)|(([0-9]+\.?[0-9]*)|(\.[0-9]+))((e|E)(\+|-)?[0-9]+)?)\b
12 | repository:
13 | comment:
14 | patterns:
15 | - name: comment.block.sproto
16 | begin: \#
17 | end: $
18 | internal_type:
19 | name: storage.type.sproto
20 | match: \b(integer|string|boolean)\b
21 | field:
22 | begin: ([A-Za-z][A-Za-z0-9_]*)(\s*)([0-9]+)(\s*)(\:)(\s*)(\*?)
23 | beginCaptures:
24 | '3': {name: constant.numeric.sproto}
25 | end: $
26 | patterns:
27 | - include: '#comment'
28 | - include: '#internal_type'
29 | - match: ([A-Za-z][A-Za-z0-9_]*)(\()(\s*)([A-Za-z][A-Za-z0-9_]*)(\s*)(\))
30 | captures:
31 | '1': {name: entity.name.class.sproto}
32 | '4': {name: string.quoted.double.proto}
33 | - match: ([A-Za-z][A-Za-z0-9_]*)
34 | captures:
35 | '1': {name: entity.name.class.sproto}
36 | sproto_type:
37 | begin: \.([A-Za-z][A-Za-z0-9_.]*)(\s*)(\{)
38 | beginCaptures:
39 | '1': {name: entity.name.class.sproto}
40 | end: \}
41 | patterns:
42 | - include: '#sproto_struct'
43 | sproto_struct:
44 | patterns:
45 | - include: '#comment'
46 | - include: '#field'
47 | - include: '#sproto_type'
48 | protocol_session_struct:
49 | begin: (response|request)(\s*)(\{)
50 | beginCaptures:
51 | '1': {name: constant.language.sproto}
52 | end: \}
53 | patterns:
54 | - include: '#sproto_struct'
55 | protocol_session_typename:
56 | begin: (response|request)(\s*)
57 | beginCaptures:
58 | '1': {name: constant.language.sproto}
59 | end: $
60 | patterns:
61 | - include: '#comment'
62 | - match: ([A-Za-z][A-Za-z0-9_]*)
63 | captures:
64 | '1': {name: entity.name.class.sproto}
65 | sproto_protocol:
66 | begin: ([A-Za-z][A-Za-z0-9_]*)(\s*)([0-9]+)(\s*)(\{)
67 | beginCaptures:
68 | '1': {name: entity.name.function.sproto}
69 | '3': {name: constant.numeric.sproto}
70 | end: \}
71 | patterns:
72 | - include: '#comment'
73 | - include: '#protocol_session_struct'
74 | - include: '#protocol_session_typename'
75 |
--------------------------------------------------------------------------------
/sproto.tmLanguage:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | fileTypes
6 |
7 | sproto
8 |
9 | name
10 | sproto
11 | patterns
12 |
13 |
14 | include
15 | #comment
16 |
17 |
18 | include
19 | #sproto_type
20 |
21 |
22 | include
23 | #sproto_protocol
24 |
25 |
26 | match
27 | \b((0(x|X)[0-9a-fA-F]*)|(([0-9]+\.?[0-9]*)|(\.[0-9]+))((e|E)(\+|-)?[0-9]+)?)\b
28 | name
29 | constant.numeric.sproto
30 |
31 |
32 | repository
33 |
34 | comment
35 |
36 | patterns
37 |
38 |
39 | begin
40 | \#
41 | end
42 | $
43 | name
44 | comment.block.sproto
45 |
46 |
47 |
48 | field
49 |
50 | begin
51 | ([A-Za-z][A-Za-z0-9_]*)(\s*)([0-9]+)(\s*)(\:)(\s*)(\*?)
52 | beginCaptures
53 |
54 | 3
55 |
56 | name
57 | constant.numeric.sproto
58 |
59 |
60 | end
61 | $
62 | patterns
63 |
64 |
65 | include
66 | #comment
67 |
68 |
69 | include
70 | #internal_type
71 |
72 |
73 | captures
74 |
75 | 1
76 |
77 | name
78 | entity.name.class.sproto
79 |
80 | 4
81 |
82 | name
83 | string.quoted.double.proto
84 |
85 |
86 | match
87 | ([A-Za-z][A-Za-z0-9_]*)(\()(\s*)([A-Za-z][A-Za-z0-9_]*)(\s*)(\))
88 |
89 |
90 | captures
91 |
92 | 1
93 |
94 | name
95 | entity.name.class.sproto
96 |
97 |
98 | match
99 | ([A-Za-z][A-Za-z0-9_]*)
100 |
101 |
102 |
103 | internal_type
104 |
105 | match
106 | \b(integer|string|boolean)\b
107 | name
108 | storage.type.sproto
109 |
110 | protocol_session_struct
111 |
112 | begin
113 | (response|request)(\s*)(\{)
114 | beginCaptures
115 |
116 | 1
117 |
118 | name
119 | constant.language.sproto
120 |
121 |
122 | end
123 | \}
124 | patterns
125 |
126 |
127 | include
128 | #sproto_struct
129 |
130 |
131 |
132 | protocol_session_typename
133 |
134 | begin
135 | (response|request)(\s*)
136 | beginCaptures
137 |
138 | 1
139 |
140 | name
141 | constant.language.sproto
142 |
143 |
144 | end
145 | $
146 | patterns
147 |
148 |
149 | include
150 | #comment
151 |
152 |
153 | captures
154 |
155 | 1
156 |
157 | name
158 | entity.name.class.sproto
159 |
160 |
161 | match
162 | ([A-Za-z][A-Za-z0-9_]*)
163 |
164 |
165 |
166 | sproto_protocol
167 |
168 | begin
169 | ([A-Za-z][A-Za-z0-9_]*)(\s*)([0-9]+)(\s*)(\{)
170 | beginCaptures
171 |
172 | 1
173 |
174 | name
175 | entity.name.function.sproto
176 |
177 | 3
178 |
179 | name
180 | constant.numeric.sproto
181 |
182 |
183 | end
184 | \}
185 | patterns
186 |
187 |
188 | include
189 | #comment
190 |
191 |
192 | include
193 | #protocol_session_struct
194 |
195 |
196 | include
197 | #protocol_session_typename
198 |
199 |
200 |
201 | sproto_struct
202 |
203 | patterns
204 |
205 |
206 | include
207 | #comment
208 |
209 |
210 | include
211 | #field
212 |
213 |
214 | include
215 | #sproto_type
216 |
217 |
218 |
219 | sproto_type
220 |
221 | begin
222 | \.([A-Za-z][A-Za-z0-9_.]*)(\s*)(\{)
223 | beginCaptures
224 |
225 | 1
226 |
227 | name
228 | entity.name.class.sproto
229 |
230 |
231 | end
232 | \}
233 | patterns
234 |
235 |
236 | include
237 | #sproto_struct
238 |
239 |
240 |
241 |
242 | scopeName
243 | source.sproto
244 | uuid
245 | 5899f948-bdc0-4cb9-b282-50efe7c5d15d
246 |
247 |
248 |
--------------------------------------------------------------------------------