aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_syntax/src
diff options
context:
space:
mode:
authorbors[bot] <26634292+bors[bot]@users.noreply.github.com>2020-07-30 14:39:55 +0100
committerGitHub <[email protected]>2020-07-30 14:39:55 +0100
commit97fb5daf723c520b0361ade3e44f130257b1fe96 (patch)
tree82f372ea7b9560cf8fbf861203460fe2aa2d4c88 /crates/ra_syntax/src
parentee00679331b87dacc5fe608f153be160c1cb144c (diff)
parent28ef4c375a9f56d69daf885504aea3df7012bb81 (diff)
Merge #5592
5592: Rename TypeParamList -> GenericParamList r=matklad a=matklad bors r+ 🤖 Co-authored-by: Aleksey Kladov <[email protected]>
Diffstat (limited to 'crates/ra_syntax/src')
-rw-r--r--crates/ra_syntax/src/ast.rs4
-rw-r--r--crates/ra_syntax/src/ast/generated/nodes.rs30
-rw-r--r--crates/ra_syntax/src/ast/make.rs2
-rw-r--r--crates/ra_syntax/src/ast/traits.rs4
4 files changed, 20 insertions, 20 deletions
diff --git a/crates/ra_syntax/src/ast.rs b/crates/ra_syntax/src/ast.rs
index c65c485cb..452e67c70 100644
--- a/crates/ra_syntax/src/ast.rs
+++ b/crates/ra_syntax/src/ast.rs
@@ -286,7 +286,7 @@ where
286 let mut bounds = pred.type_bound_list().unwrap().bounds(); 286 let mut bounds = pred.type_bound_list().unwrap().bounds();
287 287
288 assert!(pred.for_token().is_none()); 288 assert!(pred.for_token().is_none());
289 assert!(pred.type_param_list().is_none()); 289 assert!(pred.generic_param_list().is_none());
290 assert_eq!("T", pred.type_ref().unwrap().syntax().text().to_string()); 290 assert_eq!("T", pred.type_ref().unwrap().syntax().text().to_string());
291 assert_bound("Clone", bounds.next()); 291 assert_bound("Clone", bounds.next());
292 assert_bound("Copy", bounds.next()); 292 assert_bound("Copy", bounds.next());
@@ -325,7 +325,7 @@ where
325 let mut bounds = pred.type_bound_list().unwrap().bounds(); 325 let mut bounds = pred.type_bound_list().unwrap().bounds();
326 326
327 assert!(pred.for_token().is_some()); 327 assert!(pred.for_token().is_some());
328 assert_eq!("<'a>", pred.type_param_list().unwrap().syntax().text().to_string()); 328 assert_eq!("<'a>", pred.generic_param_list().unwrap().syntax().text().to_string());
329 assert_eq!("F", pred.type_ref().unwrap().syntax().text().to_string()); 329 assert_eq!("F", pred.type_ref().unwrap().syntax().text().to_string());
330 assert_bound("Fn(&'a str)", bounds.next()); 330 assert_bound("Fn(&'a str)", bounds.next());
331} 331}
diff --git a/crates/ra_syntax/src/ast/generated/nodes.rs b/crates/ra_syntax/src/ast/generated/nodes.rs
index ad8ccf1ce..efe0cbe3a 100644
--- a/crates/ra_syntax/src/ast/generated/nodes.rs
+++ b/crates/ra_syntax/src/ast/generated/nodes.rs
@@ -50,7 +50,7 @@ pub struct EnumDef {
50impl ast::AttrsOwner for EnumDef {} 50impl ast::AttrsOwner for EnumDef {}
51impl ast::NameOwner for EnumDef {} 51impl ast::NameOwner for EnumDef {}
52impl ast::VisibilityOwner for EnumDef {} 52impl ast::VisibilityOwner for EnumDef {}
53impl ast::TypeParamsOwner for EnumDef {} 53impl ast::GenericParamsOwner for EnumDef {}
54impl EnumDef { 54impl EnumDef {
55 pub fn enum_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![enum]) } 55 pub fn enum_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![enum]) }
56 pub fn variant_list(&self) -> Option<EnumVariantList> { support::child(&self.syntax) } 56 pub fn variant_list(&self) -> Option<EnumVariantList> { support::child(&self.syntax) }
@@ -85,7 +85,7 @@ pub struct Fn {
85impl ast::AttrsOwner for Fn {} 85impl ast::AttrsOwner for Fn {}
86impl ast::NameOwner for Fn {} 86impl ast::NameOwner for Fn {}
87impl ast::VisibilityOwner for Fn {} 87impl ast::VisibilityOwner for Fn {}
88impl ast::TypeParamsOwner for Fn {} 88impl ast::GenericParamsOwner for Fn {}
89impl Fn { 89impl Fn {
90 pub fn default_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![default]) } 90 pub fn default_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![default]) }
91 pub fn async_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![async]) } 91 pub fn async_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![async]) }
@@ -104,7 +104,7 @@ pub struct ImplDef {
104} 104}
105impl ast::AttrsOwner for ImplDef {} 105impl ast::AttrsOwner for ImplDef {}
106impl ast::VisibilityOwner for ImplDef {} 106impl ast::VisibilityOwner for ImplDef {}
107impl ast::TypeParamsOwner for ImplDef {} 107impl ast::GenericParamsOwner for ImplDef {}
108impl ImplDef { 108impl ImplDef {
109 pub fn const_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![const]) } 109 pub fn const_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![const]) }
110 pub fn default_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![default]) } 110 pub fn default_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![default]) }
@@ -161,7 +161,7 @@ pub struct StructDef {
161impl ast::AttrsOwner for StructDef {} 161impl ast::AttrsOwner for StructDef {}
162impl ast::NameOwner for StructDef {} 162impl ast::NameOwner for StructDef {}
163impl ast::VisibilityOwner for StructDef {} 163impl ast::VisibilityOwner for StructDef {}
164impl ast::TypeParamsOwner for StructDef {} 164impl ast::GenericParamsOwner for StructDef {}
165impl StructDef { 165impl StructDef {
166 pub fn struct_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![struct]) } 166 pub fn struct_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![struct]) }
167 pub fn semicolon_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![;]) } 167 pub fn semicolon_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![;]) }
@@ -174,7 +174,7 @@ pub struct TraitDef {
174impl ast::AttrsOwner for TraitDef {} 174impl ast::AttrsOwner for TraitDef {}
175impl ast::NameOwner for TraitDef {} 175impl ast::NameOwner for TraitDef {}
176impl ast::VisibilityOwner for TraitDef {} 176impl ast::VisibilityOwner for TraitDef {}
177impl ast::TypeParamsOwner for TraitDef {} 177impl ast::GenericParamsOwner for TraitDef {}
178impl ast::TypeBoundsOwner for TraitDef {} 178impl ast::TypeBoundsOwner for TraitDef {}
179impl TraitDef { 179impl TraitDef {
180 pub fn unsafe_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![unsafe]) } 180 pub fn unsafe_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![unsafe]) }
@@ -189,7 +189,7 @@ pub struct TypeAlias {
189impl ast::AttrsOwner for TypeAlias {} 189impl ast::AttrsOwner for TypeAlias {}
190impl ast::NameOwner for TypeAlias {} 190impl ast::NameOwner for TypeAlias {}
191impl ast::VisibilityOwner for TypeAlias {} 191impl ast::VisibilityOwner for TypeAlias {}
192impl ast::TypeParamsOwner for TypeAlias {} 192impl ast::GenericParamsOwner for TypeAlias {}
193impl ast::TypeBoundsOwner for TypeAlias {} 193impl ast::TypeBoundsOwner for TypeAlias {}
194impl TypeAlias { 194impl TypeAlias {
195 pub fn default_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![default]) } 195 pub fn default_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![default]) }
@@ -205,7 +205,7 @@ pub struct UnionDef {
205impl ast::AttrsOwner for UnionDef {} 205impl ast::AttrsOwner for UnionDef {}
206impl ast::NameOwner for UnionDef {} 206impl ast::NameOwner for UnionDef {}
207impl ast::VisibilityOwner for UnionDef {} 207impl ast::VisibilityOwner for UnionDef {}
208impl ast::TypeParamsOwner for UnionDef {} 208impl ast::GenericParamsOwner for UnionDef {}
209impl UnionDef { 209impl UnionDef {
210 pub fn union_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![union]) } 210 pub fn union_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![union]) }
211 pub fn record_field_def_list(&self) -> Option<RecordFieldDefList> { 211 pub fn record_field_def_list(&self) -> Option<RecordFieldDefList> {
@@ -307,10 +307,10 @@ impl Abi {
307 pub fn extern_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![extern]) } 307 pub fn extern_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![extern]) }
308} 308}
309#[derive(Debug, Clone, PartialEq, Eq, Hash)] 309#[derive(Debug, Clone, PartialEq, Eq, Hash)]
310pub struct TypeParamList { 310pub struct GenericParamList {
311 pub(crate) syntax: SyntaxNode, 311 pub(crate) syntax: SyntaxNode,
312} 312}
313impl TypeParamList { 313impl GenericParamList {
314 pub fn l_angle_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![<]) } 314 pub fn l_angle_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![<]) }
315 pub fn type_params(&self) -> AstChildren<TypeParam> { support::children(&self.syntax) } 315 pub fn type_params(&self) -> AstChildren<TypeParam> { support::children(&self.syntax) }
316 pub fn lifetime_params(&self) -> AstChildren<LifetimeParam> { support::children(&self.syntax) } 316 pub fn lifetime_params(&self) -> AstChildren<LifetimeParam> { support::children(&self.syntax) }
@@ -557,7 +557,7 @@ pub struct ForType {
557} 557}
558impl ForType { 558impl ForType {
559 pub fn for_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![for]) } 559 pub fn for_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![for]) }
560 pub fn type_param_list(&self) -> Option<TypeParamList> { support::child(&self.syntax) } 560 pub fn generic_param_list(&self) -> Option<GenericParamList> { support::child(&self.syntax) }
561 pub fn type_ref(&self) -> Option<TypeRef> { support::child(&self.syntax) } 561 pub fn type_ref(&self) -> Option<TypeRef> { support::child(&self.syntax) }
562} 562}
563#[derive(Debug, Clone, PartialEq, Eq, Hash)] 563#[derive(Debug, Clone, PartialEq, Eq, Hash)]
@@ -1172,7 +1172,7 @@ pub struct WherePred {
1172impl ast::TypeBoundsOwner for WherePred {} 1172impl ast::TypeBoundsOwner for WherePred {}
1173impl WherePred { 1173impl WherePred {
1174 pub fn for_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![for]) } 1174 pub fn for_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![for]) }
1175 pub fn type_param_list(&self) -> Option<TypeParamList> { support::child(&self.syntax) } 1175 pub fn generic_param_list(&self) -> Option<GenericParamList> { support::child(&self.syntax) }
1176 pub fn lifetime_token(&self) -> Option<SyntaxToken> { 1176 pub fn lifetime_token(&self) -> Option<SyntaxToken> {
1177 support::token(&self.syntax, T![lifetime]) 1177 support::token(&self.syntax, T![lifetime])
1178 } 1178 }
@@ -1397,8 +1397,8 @@ pub enum AdtDef {
1397 UnionDef(UnionDef), 1397 UnionDef(UnionDef),
1398} 1398}
1399impl ast::AttrsOwner for AdtDef {} 1399impl ast::AttrsOwner for AdtDef {}
1400impl ast::GenericParamsOwner for AdtDef {}
1400impl ast::NameOwner for AdtDef {} 1401impl ast::NameOwner for AdtDef {}
1401impl ast::TypeParamsOwner for AdtDef {}
1402impl ast::VisibilityOwner for AdtDef {} 1402impl ast::VisibilityOwner for AdtDef {}
1403impl AstNode for SourceFile { 1403impl AstNode for SourceFile {
1404 fn can_cast(kind: SyntaxKind) -> bool { kind == SOURCE_FILE } 1404 fn can_cast(kind: SyntaxKind) -> bool { kind == SOURCE_FILE }
@@ -1675,8 +1675,8 @@ impl AstNode for Abi {
1675 } 1675 }
1676 fn syntax(&self) -> &SyntaxNode { &self.syntax } 1676 fn syntax(&self) -> &SyntaxNode { &self.syntax }
1677} 1677}
1678impl AstNode for TypeParamList { 1678impl AstNode for GenericParamList {
1679 fn can_cast(kind: SyntaxKind) -> bool { kind == TYPE_PARAM_LIST } 1679 fn can_cast(kind: SyntaxKind) -> bool { kind == GENERIC_PARAM_LIST }
1680 fn cast(syntax: SyntaxNode) -> Option<Self> { 1680 fn cast(syntax: SyntaxNode) -> Option<Self> {
1681 if Self::can_cast(syntax.kind()) { 1681 if Self::can_cast(syntax.kind()) {
1682 Some(Self { syntax }) 1682 Some(Self { syntax })
@@ -3583,7 +3583,7 @@ impl std::fmt::Display for Abi {
3583 std::fmt::Display::fmt(self.syntax(), f) 3583 std::fmt::Display::fmt(self.syntax(), f)
3584 } 3584 }
3585} 3585}
3586impl std::fmt::Display for TypeParamList { 3586impl std::fmt::Display for GenericParamList {
3587 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { 3587 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
3588 std::fmt::Display::fmt(self.syntax(), f) 3588 std::fmt::Display::fmt(self.syntax(), f)
3589 } 3589 }
diff --git a/crates/ra_syntax/src/ast/make.rs b/crates/ra_syntax/src/ast/make.rs
index ef235680f..4759f23a5 100644
--- a/crates/ra_syntax/src/ast/make.rs
+++ b/crates/ra_syntax/src/ast/make.rs
@@ -291,7 +291,7 @@ pub fn visibility_pub_crate() -> ast::Visibility {
291pub fn fn_def( 291pub fn fn_def(
292 visibility: Option<ast::Visibility>, 292 visibility: Option<ast::Visibility>,
293 fn_name: ast::Name, 293 fn_name: ast::Name,
294 type_params: Option<ast::TypeParamList>, 294 type_params: Option<ast::GenericParamList>,
295 params: ast::ParamList, 295 params: ast::ParamList,
296 body: ast::BlockExpr, 296 body: ast::BlockExpr,
297) -> ast::Fn { 297) -> ast::Fn {
diff --git a/crates/ra_syntax/src/ast/traits.rs b/crates/ra_syntax/src/ast/traits.rs
index 9fe0b93c1..113bd5d82 100644
--- a/crates/ra_syntax/src/ast/traits.rs
+++ b/crates/ra_syntax/src/ast/traits.rs
@@ -49,8 +49,8 @@ pub trait ModuleItemOwner: AstNode {
49 } 49 }
50} 50}
51 51
52pub trait TypeParamsOwner: AstNode { 52pub trait GenericParamsOwner: AstNode {
53 fn type_param_list(&self) -> Option<ast::TypeParamList> { 53 fn generic_param_list(&self) -> Option<ast::GenericParamList> {
54 support::child(self.syntax()) 54 support::child(self.syntax())
55 } 55 }
56 56