From 28ef4c375a9f56d69daf885504aea3df7012bb81 Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Thu, 30 Jul 2020 15:36:21 +0200 Subject: Rename TypeParamList -> GenericParamList --- crates/ra_syntax/src/ast.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'crates/ra_syntax/src/ast.rs') 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 let mut bounds = pred.type_bound_list().unwrap().bounds(); assert!(pred.for_token().is_none()); - assert!(pred.type_param_list().is_none()); + assert!(pred.generic_param_list().is_none()); assert_eq!("T", pred.type_ref().unwrap().syntax().text().to_string()); assert_bound("Clone", bounds.next()); assert_bound("Copy", bounds.next()); @@ -325,7 +325,7 @@ where let mut bounds = pred.type_bound_list().unwrap().bounds(); assert!(pred.for_token().is_some()); - assert_eq!("<'a>", pred.type_param_list().unwrap().syntax().text().to_string()); + assert_eq!("<'a>", pred.generic_param_list().unwrap().syntax().text().to_string()); assert_eq!("F", pred.type_ref().unwrap().syntax().text().to_string()); assert_bound("Fn(&'a str)", bounds.next()); } -- cgit v1.2.3 From 216a5344c8ef3c3e430d2761dc8b1a7b60250a15 Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Thu, 30 Jul 2020 17:50:40 +0200 Subject: Rename StructDef -> Struct --- crates/ra_syntax/src/ast.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'crates/ra_syntax/src/ast.rs') diff --git a/crates/ra_syntax/src/ast.rs b/crates/ra_syntax/src/ast.rs index 452e67c70..b69b6e85e 100644 --- a/crates/ra_syntax/src/ast.rs +++ b/crates/ra_syntax/src/ast.rs @@ -235,7 +235,7 @@ fn test_comments_preserve_trailing_whitespace() { ) .ok() .unwrap(); - let def = file.syntax().descendants().find_map(StructDef::cast).unwrap(); + let def = file.syntax().descendants().find_map(Struct::cast).unwrap(); assert_eq!( "Representation of a Realm. \nIn the specification these are called Realm Records.", def.doc_comment_text().unwrap() -- cgit v1.2.3 From 3cd4112bdc924c132cb0eab9d064511a215421ec Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Thu, 30 Jul 2020 18:02:20 +0200 Subject: Finalize const&static grammar --- crates/ra_syntax/src/ast.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'crates/ra_syntax/src/ast.rs') diff --git a/crates/ra_syntax/src/ast.rs b/crates/ra_syntax/src/ast.rs index b69b6e85e..fd426ece9 100644 --- a/crates/ra_syntax/src/ast.rs +++ b/crates/ra_syntax/src/ast.rs @@ -139,7 +139,7 @@ fn test_doc_comment_of_statics() { ) .ok() .unwrap(); - let st = file.syntax().descendants().find_map(StaticDef::cast).unwrap(); + let st = file.syntax().descendants().find_map(Static::cast).unwrap(); assert_eq!("Number of levels", st.doc_comment_text().unwrap()); } -- cgit v1.2.3 From 08ea2271e8050165d0aaf4c994ed3dd746aff3ba Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Fri, 31 Jul 2020 12:06:38 +0200 Subject: Rename TypeRef -> Type The TypeRef name comes from IntelliJ days, where you often have both type *syntax* as well as *semantical* representation of types in scope. And naming both Type is confusing. In rust-analyzer however, we use ast types as `ast::Type`, and have many more semantic counterparts to ast types, so avoiding name clash here is just confusing. --- crates/ra_syntax/src/ast.rs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'crates/ra_syntax/src/ast.rs') diff --git a/crates/ra_syntax/src/ast.rs b/crates/ra_syntax/src/ast.rs index fd426ece9..8a0e3d27b 100644 --- a/crates/ra_syntax/src/ast.rs +++ b/crates/ra_syntax/src/ast.rs @@ -287,7 +287,7 @@ where assert!(pred.for_token().is_none()); assert!(pred.generic_param_list().is_none()); - assert_eq!("T", pred.type_ref().unwrap().syntax().text().to_string()); + assert_eq!("T", pred.ty().unwrap().syntax().text().to_string()); assert_bound("Clone", bounds.next()); assert_bound("Copy", bounds.next()); assert_bound("Debug", bounds.next()); @@ -304,20 +304,20 @@ where let pred = predicates.next().unwrap(); let mut bounds = pred.type_bound_list().unwrap().bounds(); - assert_eq!("Iterator::Item", pred.type_ref().unwrap().syntax().text().to_string()); + assert_eq!("Iterator::Item", pred.ty().unwrap().syntax().text().to_string()); assert_bound("'a", bounds.next()); let pred = predicates.next().unwrap(); let mut bounds = pred.type_bound_list().unwrap().bounds(); - assert_eq!("Iterator::Item", pred.type_ref().unwrap().syntax().text().to_string()); + assert_eq!("Iterator::Item", pred.ty().unwrap().syntax().text().to_string()); assert_bound("Debug", bounds.next()); assert_bound("'a", bounds.next()); let pred = predicates.next().unwrap(); let mut bounds = pred.type_bound_list().unwrap().bounds(); - assert_eq!("::Item", pred.type_ref().unwrap().syntax().text().to_string()); + assert_eq!("::Item", pred.ty().unwrap().syntax().text().to_string()); assert_bound("Debug", bounds.next()); assert_bound("'a", bounds.next()); @@ -326,6 +326,6 @@ where assert!(pred.for_token().is_some()); assert_eq!("<'a>", pred.generic_param_list().unwrap().syntax().text().to_string()); - assert_eq!("F", pred.type_ref().unwrap().syntax().text().to_string()); + assert_eq!("F", pred.ty().unwrap().syntax().text().to_string()); assert_bound("Fn(&'a str)", bounds.next()); } -- cgit v1.2.3 From a7ca6583fbce6f1bddce7b31ad5bb1fc0665b616 Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Fri, 31 Jul 2020 15:40:48 +0200 Subject: Handwrite Stmt --- crates/ra_syntax/src/ast.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'crates/ra_syntax/src/ast.rs') diff --git a/crates/ra_syntax/src/ast.rs b/crates/ra_syntax/src/ast.rs index 8a0e3d27b..d536bb1e7 100644 --- a/crates/ra_syntax/src/ast.rs +++ b/crates/ra_syntax/src/ast.rs @@ -17,7 +17,7 @@ use crate::{ pub use self::{ expr_ext::{ArrayExprKind, BinOp, Effect, ElseBranch, LiteralKind, PrefixOp, RangeOp}, - generated::{nodes::*, tokens::*}, + generated::*, node_ext::{ AttrKind, FieldKind, NameOrNameRef, PathSegmentKind, SelfParamKind, SlicePatComponents, StructKind, TypeBoundKind, VisibilityKind, -- cgit v1.2.3