|
142 | 142 | 'name': 'support.type.std.rust'
|
143 | 143 | 'match': '\\b(ToOwned|ToString)\\b'
|
144 | 144 | }
|
| 145 | + 'type': { |
| 146 | + 'comment': 'A type' |
| 147 | + 'name': 'entity.name.type.rust' |
| 148 | + 'match': '\\b([A-Za-z][_A-Za-z0-9]*|_[_A-Za-z0-9]+)\\b' |
| 149 | + } |
145 | 150 | 'type_params': {
|
146 | 151 | 'comment': 'Type parameters'
|
147 | 152 | 'name': 'meta.type_params.rust'
|
|
159 | 164 | { 'include': '#std_types' }
|
160 | 165 | { 'include': '#std_traits' }
|
161 | 166 | { 'include': '#type_params' }
|
| 167 | + # { 'include': '#type' } |
162 | 168 | ]
|
163 | 169 | }
|
164 | 170 | }
|
165 | 171 |
|
166 | 172 | 'patterns': [
|
| 173 | + # Implementation |
| 174 | + { |
| 175 | + 'comment': 'Implementation' |
| 176 | + 'begin': '\\b(impl)\\b' |
| 177 | + 'end': '\\{' |
| 178 | + 'beginCaptures': { |
| 179 | + '1': { 'name': 'storage.type.rust' } |
| 180 | + } |
| 181 | + 'patterns': [ |
| 182 | + { 'include': '#block_comment' } |
| 183 | + { 'include': '#line_comment' } |
| 184 | + { 'include': '#sigils' } |
| 185 | + { 'include': '#mut' } |
| 186 | + { 'include': '#ref_lifetime' } |
| 187 | + { 'include': '#core_types' } |
| 188 | + { 'include': '#core_marker' } |
| 189 | + { 'include': '#core_traits' } |
| 190 | + { 'include': '#std_types' } |
| 191 | + { 'include': '#std_traits' } |
| 192 | + { 'include': '#type_params' } |
| 193 | + { 'include': '#where' } |
| 194 | + { |
| 195 | + 'name': 'storage.type.rust' |
| 196 | + 'match': '\\bfor\\b' |
| 197 | + } |
| 198 | + { 'include': '#type' } |
| 199 | + ] |
| 200 | + } |
167 | 201 | # Comments
|
168 | 202 | { 'include': '#block_doc_comment' }
|
169 | 203 | { 'include': '#block_comment' }
|
|
415 | 449 | { 'include': '#type_params' }
|
416 | 450 | ]
|
417 | 451 | }
|
418 |
| - # Implementation |
419 |
| - { |
420 |
| - 'comment': 'Implementation' |
421 |
| - 'begin': '\\b(impl)\\b' |
422 |
| - 'end': '\\{' |
423 |
| - 'beginCaptures': { |
424 |
| - '1': { 'name': 'storage.type.rust' } |
425 |
| - } |
426 |
| - 'patterns': [ |
427 |
| - { 'include': '#block_comment' } |
428 |
| - { 'include': '#line_comment' } |
429 |
| - { 'include': '#sigils' } |
430 |
| - { 'include': '#mut' } |
431 |
| - { 'include': '#ref_lifetime' } |
432 |
| - { 'include': '#core_types' } |
433 |
| - { 'include': '#core_marker' } |
434 |
| - { 'include': '#core_traits' } |
435 |
| - { 'include': '#std_types' } |
436 |
| - { 'include': '#std_traits' } |
437 |
| - { 'include': '#type_params' } |
438 |
| - { 'include': '#where' } |
439 |
| - { |
440 |
| - 'name': 'storage.type.rust' |
441 |
| - 'match': '\\bfor\\b' |
442 |
| - } |
443 |
| - ] |
444 |
| - } |
445 | 452 | ]
|
0 commit comments