aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_syntax/src
diff options
context:
space:
mode:
Diffstat (limited to 'crates/ra_syntax/src')
-rw-r--r--crates/ra_syntax/src/ast/generated.rs18
-rw-r--r--crates/ra_syntax/src/grammar.ron51
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 {}
526impl ast::TypeParamsOwner for ConstDef {} 526impl ast::TypeParamsOwner for ConstDef {}
527impl ast::AttrsOwner for ConstDef {} 527impl ast::AttrsOwner for ConstDef {}
528impl ast::DocCommentsOwner for ConstDef {} 528impl ast::DocCommentsOwner for ConstDef {}
529impl ConstDef {} 529impl 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 {}
3015impl ast::TypeParamsOwner for StaticDef {} 3019impl ast::TypeParamsOwner for StaticDef {}
3016impl ast::AttrsOwner for StaticDef {} 3020impl ast::AttrsOwner for StaticDef {}
3017impl ast::DocCommentsOwner for StaticDef {} 3021impl ast::DocCommentsOwner for StaticDef {}
3018impl StaticDef {} 3022impl 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 {}
3491impl ast::TypeParamsOwner for TypeDef {} 3499impl ast::TypeParamsOwner for TypeDef {}
3492impl ast::AttrsOwner for TypeDef {} 3500impl ast::AttrsOwner for TypeDef {}
3493impl ast::DocCommentsOwner for TypeDef {} 3501impl ast::DocCommentsOwner for TypeDef {}
3494impl TypeDef {} 3502impl 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"]),