From 91781c7ce8201b28afd56b4e35eba47e076a8498 Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Fri, 31 Jul 2020 18:29:29 +0200 Subject: Rename TypeArgList -> GenericArgList --- crates/ra_syntax/src/ast/edit.rs | 8 ++++---- crates/ra_syntax/src/ast/generated/nodes.rs | 14 +++++++------- 2 files changed, 11 insertions(+), 11 deletions(-) (limited to 'crates/ra_syntax/src/ast') diff --git a/crates/ra_syntax/src/ast/edit.rs b/crates/ra_syntax/src/ast/edit.rs index 8d3e42f25..04746ef8f 100644 --- a/crates/ra_syntax/src/ast/edit.rs +++ b/crates/ra_syntax/src/ast/edit.rs @@ -237,17 +237,17 @@ impl ast::Path { impl ast::PathSegment { #[must_use] - pub fn with_type_args(&self, type_args: ast::TypeArgList) -> ast::PathSegment { + pub fn with_type_args(&self, type_args: ast::GenericArgList) -> ast::PathSegment { self._with_type_args(type_args, false) } #[must_use] - pub fn with_turbo_fish(&self, type_args: ast::TypeArgList) -> ast::PathSegment { + pub fn with_turbo_fish(&self, type_args: ast::GenericArgList) -> ast::PathSegment { self._with_type_args(type_args, true) } - fn _with_type_args(&self, type_args: ast::TypeArgList, turbo: bool) -> ast::PathSegment { - if let Some(old) = self.type_arg_list() { + fn _with_type_args(&self, type_args: ast::GenericArgList, turbo: bool) -> ast::PathSegment { + if let Some(old) = self.generic_arg_list() { return self.replace_children( single_node(old.syntax().clone()), iter::once(type_args.syntax().clone().into()), diff --git a/crates/ra_syntax/src/ast/generated/nodes.rs b/crates/ra_syntax/src/ast/generated/nodes.rs index 1a707ad67..903646149 100644 --- a/crates/ra_syntax/src/ast/generated/nodes.rs +++ b/crates/ra_syntax/src/ast/generated/nodes.rs @@ -24,7 +24,7 @@ impl PathSegment { pub fn self_token(&self) -> Option { support::token(&self.syntax, T![self]) } pub fn super_token(&self) -> Option { support::token(&self.syntax, T![super]) } pub fn name_ref(&self) -> Option { support::child(&self.syntax) } - pub fn type_arg_list(&self) -> Option { support::child(&self.syntax) } + pub fn generic_arg_list(&self) -> Option { support::child(&self.syntax) } pub fn param_list(&self) -> Option { support::child(&self.syntax) } pub fn ret_type(&self) -> Option { support::child(&self.syntax) } pub fn l_angle_token(&self) -> Option { support::token(&self.syntax, T![<]) } @@ -40,10 +40,10 @@ impl NameRef { pub fn ident_token(&self) -> Option { support::token(&self.syntax, T![ident]) } } #[derive(Debug, Clone, PartialEq, Eq, Hash)] -pub struct TypeArgList { +pub struct GenericArgList { pub(crate) syntax: SyntaxNode, } -impl TypeArgList { +impl GenericArgList { pub fn coloncolon_token(&self) -> Option { support::token(&self.syntax, T![::]) } pub fn l_angle_token(&self) -> Option { support::token(&self.syntax, T![<]) } pub fn type_args(&self) -> AstChildren { support::children(&self.syntax) } @@ -803,7 +803,7 @@ impl MethodCallExpr { pub fn expr(&self) -> Option { support::child(&self.syntax) } pub fn dot_token(&self) -> Option { support::token(&self.syntax, T![.]) } pub fn name_ref(&self) -> Option { support::child(&self.syntax) } - pub fn type_arg_list(&self) -> Option { support::child(&self.syntax) } + pub fn generic_arg_list(&self) -> Option { support::child(&self.syntax) } } #[derive(Debug, Clone, PartialEq, Eq, Hash)] pub struct ParenExpr { @@ -1434,8 +1434,8 @@ impl AstNode for NameRef { } fn syntax(&self) -> &SyntaxNode { &self.syntax } } -impl AstNode for TypeArgList { - fn can_cast(kind: SyntaxKind) -> bool { kind == TYPE_ARG_LIST } +impl AstNode for GenericArgList { + fn can_cast(kind: SyntaxKind) -> bool { kind == GENERIC_ARG_LIST } fn cast(syntax: SyntaxNode) -> Option { if Self::can_cast(syntax.kind()) { Some(Self { syntax }) @@ -3445,7 +3445,7 @@ impl std::fmt::Display for NameRef { std::fmt::Display::fmt(self.syntax(), f) } } -impl std::fmt::Display for TypeArgList { +impl std::fmt::Display for GenericArgList { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { std::fmt::Display::fmt(self.syntax(), f) } -- cgit v1.2.3