diff options
Diffstat (limited to 'crates')
-rw-r--r-- | crates/libeditor/src/scope/mod_scope.rs | 4 | ||||
-rw-r--r-- | crates/libsyntax2/src/ast/generated.rs | 3 | ||||
-rw-r--r-- | crates/libsyntax2/src/grammar.ron | 2 |
3 files changed, 7 insertions, 2 deletions
diff --git a/crates/libeditor/src/scope/mod_scope.rs b/crates/libeditor/src/scope/mod_scope.rs index 25faee3b8..052f70569 100644 --- a/crates/libeditor/src/scope/mod_scope.rs +++ b/crates/libeditor/src/scope/mod_scope.rs | |||
@@ -26,6 +26,7 @@ impl ModuleScope { | |||
26 | ast::ModuleItem::ConstDef(item) => Entry::new(item), | 26 | ast::ModuleItem::ConstDef(item) => Entry::new(item), |
27 | ast::ModuleItem::StaticDef(item) => Entry::new(item), | 27 | ast::ModuleItem::StaticDef(item) => Entry::new(item), |
28 | ast::ModuleItem::TraitDef(item) => Entry::new(item), | 28 | ast::ModuleItem::TraitDef(item) => Entry::new(item), |
29 | ast::ModuleItem::TypeDef(item) => Entry::new(item), | ||
29 | ast::ModuleItem::Module(item) => Entry::new(item), | 30 | ast::ModuleItem::Module(item) => Entry::new(item), |
30 | ast::ModuleItem::UseItem(item) => { | 31 | ast::ModuleItem::UseItem(item) => { |
31 | if let Some(tree) = item.use_tree() { | 32 | if let Some(tree) = item.use_tree() { |
@@ -104,6 +105,7 @@ mod tests { | |||
104 | y::z, | 105 | y::z, |
105 | t, | 106 | t, |
106 | }; | 107 | }; |
107 | ", &["Foo", "Bar", "baz", "quux", "z", "t"]) | 108 | type T = (); |
109 | ", &["Foo", "Bar", "baz", "quux", "z", "t", "T"]) | ||
108 | } | 110 | } |
109 | } | 111 | } |
diff --git a/crates/libsyntax2/src/ast/generated.rs b/crates/libsyntax2/src/ast/generated.rs index 50dc41b27..f21e49437 100644 --- a/crates/libsyntax2/src/ast/generated.rs +++ b/crates/libsyntax2/src/ast/generated.rs | |||
@@ -947,6 +947,7 @@ pub enum ModuleItem<'a> { | |||
947 | EnumDef(EnumDef<'a>), | 947 | EnumDef(EnumDef<'a>), |
948 | FnDef(FnDef<'a>), | 948 | FnDef(FnDef<'a>), |
949 | TraitDef(TraitDef<'a>), | 949 | TraitDef(TraitDef<'a>), |
950 | TypeDef(TypeDef<'a>), | ||
950 | ImplItem(ImplItem<'a>), | 951 | ImplItem(ImplItem<'a>), |
951 | UseItem(UseItem<'a>), | 952 | UseItem(UseItem<'a>), |
952 | ExternCrateItem(ExternCrateItem<'a>), | 953 | ExternCrateItem(ExternCrateItem<'a>), |
@@ -962,6 +963,7 @@ impl<'a> AstNode<'a> for ModuleItem<'a> { | |||
962 | ENUM_DEF => Some(ModuleItem::EnumDef(EnumDef { syntax })), | 963 | ENUM_DEF => Some(ModuleItem::EnumDef(EnumDef { syntax })), |
963 | FN_DEF => Some(ModuleItem::FnDef(FnDef { syntax })), | 964 | FN_DEF => Some(ModuleItem::FnDef(FnDef { syntax })), |
964 | TRAIT_DEF => Some(ModuleItem::TraitDef(TraitDef { syntax })), | 965 | TRAIT_DEF => Some(ModuleItem::TraitDef(TraitDef { syntax })), |
966 | TYPE_DEF => Some(ModuleItem::TypeDef(TypeDef { syntax })), | ||
965 | IMPL_ITEM => Some(ModuleItem::ImplItem(ImplItem { syntax })), | 967 | IMPL_ITEM => Some(ModuleItem::ImplItem(ImplItem { syntax })), |
966 | USE_ITEM => Some(ModuleItem::UseItem(UseItem { syntax })), | 968 | USE_ITEM => Some(ModuleItem::UseItem(UseItem { syntax })), |
967 | EXTERN_CRATE_ITEM => Some(ModuleItem::ExternCrateItem(ExternCrateItem { syntax })), | 969 | EXTERN_CRATE_ITEM => Some(ModuleItem::ExternCrateItem(ExternCrateItem { syntax })), |
@@ -977,6 +979,7 @@ impl<'a> AstNode<'a> for ModuleItem<'a> { | |||
977 | ModuleItem::EnumDef(inner) => inner.syntax(), | 979 | ModuleItem::EnumDef(inner) => inner.syntax(), |
978 | ModuleItem::FnDef(inner) => inner.syntax(), | 980 | ModuleItem::FnDef(inner) => inner.syntax(), |
979 | ModuleItem::TraitDef(inner) => inner.syntax(), | 981 | ModuleItem::TraitDef(inner) => inner.syntax(), |
982 | ModuleItem::TypeDef(inner) => inner.syntax(), | ||
980 | ModuleItem::ImplItem(inner) => inner.syntax(), | 983 | ModuleItem::ImplItem(inner) => inner.syntax(), |
981 | ModuleItem::UseItem(inner) => inner.syntax(), | 984 | ModuleItem::UseItem(inner) => inner.syntax(), |
982 | ModuleItem::ExternCrateItem(inner) => inner.syntax(), | 985 | ModuleItem::ExternCrateItem(inner) => inner.syntax(), |
diff --git a/crates/libsyntax2/src/grammar.ron b/crates/libsyntax2/src/grammar.ron index 522521229..fbe8397d8 100644 --- a/crates/libsyntax2/src/grammar.ron +++ b/crates/libsyntax2/src/grammar.ron | |||
@@ -332,7 +332,7 @@ Grammar( | |||
332 | ], | 332 | ], |
333 | ), | 333 | ), |
334 | "ModuleItem": ( | 334 | "ModuleItem": ( |
335 | enum: ["StructDef", "EnumDef", "FnDef", "TraitDef", "ImplItem", | 335 | enum: ["StructDef", "EnumDef", "FnDef", "TraitDef", "TypeDef", "ImplItem", |
336 | "UseItem", "ExternCrateItem", "ConstDef", "StaticDef", "Module" ] | 336 | "UseItem", "ExternCrateItem", "ConstDef", "StaticDef", "Module" ] |
337 | ), | 337 | ), |
338 | 338 | ||