Skip to content

Commit 020fbe2

Browse files
committed
Include pub and core type match rules for type declarations
1 parent 43b77b8 commit 020fbe2

File tree

2 files changed

+11
-5
lines changed

2 files changed

+11
-5
lines changed

grammars/rust.cson

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,11 @@
8181
'name': 'storage.modifier.const.rust'
8282
'match': '\\bconst\\b'
8383
}
84+
'pub': {
85+
'comment': 'Visibility modifier'
86+
'name': 'storage.modifier.visibility.rust'
87+
'match': '\\bpub\\b'
88+
}
8489
'lifetime': {
8590
'comment': 'Named lifetime'
8691
'name': 'storage.modifier.lifetime.rust'
@@ -219,11 +224,6 @@
219224
'name': 'storage.modifier.static.rust'
220225
'match': '\\bstatic\\b'
221226
}
222-
{
223-
'comment': 'Visibility modifier'
224-
'name': 'storage.modifier.visibility.rust'
225-
'match': '\\bpub\\b'
226-
}
227227
{
228228
'comment': 'Boolean constant'
229229
'name': 'constant.language.boolean.rust'
@@ -251,6 +251,7 @@
251251
{ 'include': '#lifetime' }
252252
{ 'include': '#ref_lifetime' }
253253
{ 'include': '#const' }
254+
{ 'include': '#pub' }
254255
# Operators
255256
{
256257
'comment': 'Operator'
@@ -342,6 +343,8 @@
342343
{ 'include': '#traits' }
343344
{ 'include': '#std_traits' }
344345
{ 'include': '#type_params' }
346+
{ 'include': '#core_types' }
347+
{ 'include': '#pub' }
345348
]
346349
}
347350
# Type alias

test.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -212,3 +212,6 @@ if x == 1 { }
212212
fn foo(bar: *const i32) {
213213
let _ = 1234 as *const u32;
214214
}
215+
216+
// Keywords and known types in wrapper structs (#56)
217+
pub struct Foobar(pub Option<bool>);

0 commit comments

Comments
 (0)