aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_syntax/src/ast/generated
diff options
context:
space:
mode:
authorAleksey Kladov <[email protected]>2020-07-30 13:12:04 +0100
committerAleksey Kladov <[email protected]>2020-07-30 13:12:04 +0100
commit9697d23cbe7b0ad897139b15f1b1ffe1cab6ad89 (patch)
tree8bb4cfc1f38b2add3704c64e0443b69e38ab272a /crates/ra_syntax/src/ast/generated
parent35e7966ebeee70ca2c15b5139b5c1918d9ef4086 (diff)
Rename UseItem -> Use
Diffstat (limited to 'crates/ra_syntax/src/ast/generated')
-rw-r--r--crates/ra_syntax/src/ast/generated/nodes.rs29
1 files changed, 15 insertions, 14 deletions
diff --git a/crates/ra_syntax/src/ast/generated/nodes.rs b/crates/ra_syntax/src/ast/generated/nodes.rs
index 9d8127a3d..be657699f 100644
--- a/crates/ra_syntax/src/ast/generated/nodes.rs
+++ b/crates/ra_syntax/src/ast/generated/nodes.rs
@@ -213,12 +213,12 @@ impl UnionDef {
213 } 213 }
214} 214}
215#[derive(Debug, Clone, PartialEq, Eq, Hash)] 215#[derive(Debug, Clone, PartialEq, Eq, Hash)]
216pub struct UseItem { 216pub struct Use {
217 pub(crate) syntax: SyntaxNode, 217 pub(crate) syntax: SyntaxNode,
218} 218}
219impl ast::AttrsOwner for UseItem {} 219impl ast::AttrsOwner for Use {}
220impl ast::VisibilityOwner for UseItem {} 220impl ast::VisibilityOwner for Use {}
221impl UseItem { 221impl Use {
222 pub fn use_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![use]) } 222 pub fn use_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![use]) }
223 pub fn use_tree(&self) -> Option<UseTree> { support::child(&self.syntax) } 223 pub fn use_tree(&self) -> Option<UseTree> { support::child(&self.syntax) }
224 pub fn semicolon_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![;]) } 224 pub fn semicolon_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![;]) }
@@ -1283,7 +1283,7 @@ pub enum Item {
1283 TraitDef(TraitDef), 1283 TraitDef(TraitDef),
1284 TypeAliasDef(TypeAliasDef), 1284 TypeAliasDef(TypeAliasDef),
1285 UnionDef(UnionDef), 1285 UnionDef(UnionDef),
1286 UseItem(UseItem), 1286 Use(Use),
1287} 1287}
1288impl ast::AttrsOwner for Item {} 1288impl ast::AttrsOwner for Item {}
1289#[derive(Debug, Clone, PartialEq, Eq, Hash)] 1289#[derive(Debug, Clone, PartialEq, Eq, Hash)]
@@ -1562,8 +1562,8 @@ impl AstNode for UnionDef {
1562 } 1562 }
1563 fn syntax(&self) -> &SyntaxNode { &self.syntax } 1563 fn syntax(&self) -> &SyntaxNode { &self.syntax }
1564} 1564}
1565impl AstNode for UseItem { 1565impl AstNode for Use {
1566 fn can_cast(kind: SyntaxKind) -> bool { kind == USE_ITEM } 1566 fn can_cast(kind: SyntaxKind) -> bool { kind == USE }
1567 fn cast(syntax: SyntaxNode) -> Option<Self> { 1567 fn cast(syntax: SyntaxNode) -> Option<Self> {
1568 if Self::can_cast(syntax.kind()) { 1568 if Self::can_cast(syntax.kind()) {
1569 Some(Self { syntax }) 1569 Some(Self { syntax })
@@ -2811,15 +2811,16 @@ impl From<TypeAliasDef> for Item {
2811impl From<UnionDef> for Item { 2811impl From<UnionDef> for Item {
2812 fn from(node: UnionDef) -> Item { Item::UnionDef(node) } 2812 fn from(node: UnionDef) -> Item { Item::UnionDef(node) }
2813} 2813}
2814impl From<UseItem> for Item { 2814impl From<Use> for Item {
2815 fn from(node: UseItem) -> Item { Item::UseItem(node) } 2815 fn from(node: Use) -> Item { Item::Use(node) }
2816} 2816}
2817impl AstNode for Item { 2817impl AstNode for Item {
2818 fn can_cast(kind: SyntaxKind) -> bool { 2818 fn can_cast(kind: SyntaxKind) -> bool {
2819 match kind { 2819 match kind {
2820 CONST_DEF | ENUM_DEF | EXTERN_BLOCK | EXTERN_CRATE | FN_DEF | IMPL_DEF | MACRO_CALL 2820 CONST_DEF | ENUM_DEF | EXTERN_BLOCK | EXTERN_CRATE | FN_DEF | IMPL_DEF | MACRO_CALL
2821 | MODULE | STATIC_DEF | STRUCT_DEF | TRAIT_DEF | TYPE_ALIAS_DEF | UNION_DEF 2821 | MODULE | STATIC_DEF | STRUCT_DEF | TRAIT_DEF | TYPE_ALIAS_DEF | UNION_DEF | USE => {
2822 | USE_ITEM => true, 2822 true
2823 }
2823 _ => false, 2824 _ => false,
2824 } 2825 }
2825 } 2826 }
@@ -2838,7 +2839,7 @@ impl AstNode for Item {
2838 TRAIT_DEF => Item::TraitDef(TraitDef { syntax }), 2839 TRAIT_DEF => Item::TraitDef(TraitDef { syntax }),
2839 TYPE_ALIAS_DEF => Item::TypeAliasDef(TypeAliasDef { syntax }), 2840 TYPE_ALIAS_DEF => Item::TypeAliasDef(TypeAliasDef { syntax }),
2840 UNION_DEF => Item::UnionDef(UnionDef { syntax }), 2841 UNION_DEF => Item::UnionDef(UnionDef { syntax }),
2841 USE_ITEM => Item::UseItem(UseItem { syntax }), 2842 USE => Item::Use(Use { syntax }),
2842 _ => return None, 2843 _ => return None,
2843 }; 2844 };
2844 Some(res) 2845 Some(res)
@@ -2858,7 +2859,7 @@ impl AstNode for Item {
2858 Item::TraitDef(it) => &it.syntax, 2859 Item::TraitDef(it) => &it.syntax,
2859 Item::TypeAliasDef(it) => &it.syntax, 2860 Item::TypeAliasDef(it) => &it.syntax,
2860 Item::UnionDef(it) => &it.syntax, 2861 Item::UnionDef(it) => &it.syntax,
2861 Item::UseItem(it) => &it.syntax, 2862 Item::Use(it) => &it.syntax,
2862 } 2863 }
2863 } 2864 }
2864} 2865}
@@ -3531,7 +3532,7 @@ impl std::fmt::Display for UnionDef {
3531 std::fmt::Display::fmt(self.syntax(), f) 3532 std::fmt::Display::fmt(self.syntax(), f)
3532 } 3533 }
3533} 3534}
3534impl std::fmt::Display for UseItem { 3535impl std::fmt::Display for Use {
3535 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { 3536 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
3536 std::fmt::Display::fmt(self.syntax(), f) 3537 std::fmt::Display::fmt(self.syntax(), f)
3537 } 3538 }