diff options
Diffstat (limited to 'crates/ra_syntax/src')
-rw-r--r-- | crates/ra_syntax/src/ast/generated.rs | 18 | ||||
-rw-r--r-- | crates/ra_syntax/src/grammar.ron | 51 |
2 files changed, 45 insertions, 24 deletions
diff --git a/crates/ra_syntax/src/ast/generated.rs b/crates/ra_syntax/src/ast/generated.rs index ac6c8a835..be16511df 100644 --- a/crates/ra_syntax/src/ast/generated.rs +++ b/crates/ra_syntax/src/ast/generated.rs | |||
@@ -526,7 +526,11 @@ impl ast::NameOwner for ConstDef {} | |||
526 | impl ast::TypeParamsOwner for ConstDef {} | 526 | impl ast::TypeParamsOwner for ConstDef {} |
527 | impl ast::AttrsOwner for ConstDef {} | 527 | impl ast::AttrsOwner for ConstDef {} |
528 | impl ast::DocCommentsOwner for ConstDef {} | 528 | impl ast::DocCommentsOwner for ConstDef {} |
529 | impl ConstDef {} | 529 | impl ConstDef { |
530 | pub fn type_ref(&self) -> Option<&TypeRef> { | ||
531 | super::child_opt(self) | ||
532 | } | ||
533 | } | ||
530 | 534 | ||
531 | // ContinueExpr | 535 | // ContinueExpr |
532 | #[derive(Debug, PartialEq, Eq, Hash)] | 536 | #[derive(Debug, PartialEq, Eq, Hash)] |
@@ -3015,7 +3019,11 @@ impl ast::NameOwner for StaticDef {} | |||
3015 | impl ast::TypeParamsOwner for StaticDef {} | 3019 | impl ast::TypeParamsOwner for StaticDef {} |
3016 | impl ast::AttrsOwner for StaticDef {} | 3020 | impl ast::AttrsOwner for StaticDef {} |
3017 | impl ast::DocCommentsOwner for StaticDef {} | 3021 | impl ast::DocCommentsOwner for StaticDef {} |
3018 | impl StaticDef {} | 3022 | impl StaticDef { |
3023 | pub fn type_ref(&self) -> Option<&TypeRef> { | ||
3024 | super::child_opt(self) | ||
3025 | } | ||
3026 | } | ||
3019 | 3027 | ||
3020 | // Stmt | 3028 | // Stmt |
3021 | #[derive(Debug, PartialEq, Eq, Hash)] | 3029 | #[derive(Debug, PartialEq, Eq, Hash)] |
@@ -3491,7 +3499,11 @@ impl ast::NameOwner for TypeDef {} | |||
3491 | impl ast::TypeParamsOwner for TypeDef {} | 3499 | impl ast::TypeParamsOwner for TypeDef {} |
3492 | impl ast::AttrsOwner for TypeDef {} | 3500 | impl ast::AttrsOwner for TypeDef {} |
3493 | impl ast::DocCommentsOwner for TypeDef {} | 3501 | impl ast::DocCommentsOwner for TypeDef {} |
3494 | impl TypeDef {} | 3502 | impl TypeDef { |
3503 | pub fn type_ref(&self) -> Option<&TypeRef> { | ||
3504 | super::child_opt(self) | ||
3505 | } | ||
3506 | } | ||
3495 | 3507 | ||
3496 | // TypeParam | 3508 | // TypeParam |
3497 | #[derive(Debug, PartialEq, Eq, Hash)] | 3509 | #[derive(Debug, PartialEq, Eq, Hash)] |
diff --git a/crates/ra_syntax/src/grammar.ron b/crates/ra_syntax/src/grammar.ron index c5297e46d..9a6f990b6 100644 --- a/crates/ra_syntax/src/grammar.ron +++ b/crates/ra_syntax/src/grammar.ron | |||
@@ -289,27 +289,36 @@ Grammar( | |||
289 | collections: [["impl_items", "ImplItem"]], | 289 | collections: [["impl_items", "ImplItem"]], |
290 | traits: [ "FnDefOwner", "ModuleItemOwner" ], | 290 | traits: [ "FnDefOwner", "ModuleItemOwner" ], |
291 | ), | 291 | ), |
292 | "ConstDef": ( traits: [ | 292 | "ConstDef": ( |
293 | "VisibilityOwner", | 293 | traits: [ |
294 | "NameOwner", | 294 | "VisibilityOwner", |
295 | "TypeParamsOwner", | 295 | "NameOwner", |
296 | "AttrsOwner", | 296 | "TypeParamsOwner", |
297 | "DocCommentsOwner" | 297 | "AttrsOwner", |
298 | ] ), | 298 | "DocCommentsOwner" |
299 | "StaticDef": ( traits: [ | 299 | ], |
300 | "VisibilityOwner", | 300 | options: ["TypeRef"] |
301 | "NameOwner", | 301 | ), |
302 | "TypeParamsOwner", | 302 | "StaticDef": ( |
303 | "AttrsOwner", | 303 | traits: [ |
304 | "DocCommentsOwner" | 304 | "VisibilityOwner", |
305 | ] ), | 305 | "NameOwner", |
306 | "TypeDef": ( traits: [ | 306 | "TypeParamsOwner", |
307 | "VisibilityOwner", | 307 | "AttrsOwner", |
308 | "NameOwner", | 308 | "DocCommentsOwner" |
309 | "TypeParamsOwner", | 309 | ], |
310 | "AttrsOwner", | 310 | options: ["TypeRef"] |
311 | "DocCommentsOwner" | 311 | ), |
312 | ] ), | 312 | "TypeDef": ( |
313 | traits: [ | ||
314 | "VisibilityOwner", | ||
315 | "NameOwner", | ||
316 | "TypeParamsOwner", | ||
317 | "AttrsOwner", | ||
318 | "DocCommentsOwner" | ||
319 | ], | ||
320 | options: ["TypeRef"] | ||
321 | ), | ||
313 | "ImplBlock": (options: ["ItemList"]), | 322 | "ImplBlock": (options: ["ItemList"]), |
314 | 323 | ||
315 | "ParenType": (options: ["TypeRef"]), | 324 | "ParenType": (options: ["TypeRef"]), |