diff options
Diffstat (limited to 'crates/ra_syntax/src/ast.rs')
-rw-r--r-- | crates/ra_syntax/src/ast.rs | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/crates/ra_syntax/src/ast.rs b/crates/ra_syntax/src/ast.rs index c65c485cb..d536bb1e7 100644 --- a/crates/ra_syntax/src/ast.rs +++ b/crates/ra_syntax/src/ast.rs | |||
@@ -17,7 +17,7 @@ use crate::{ | |||
17 | 17 | ||
18 | pub use self::{ | 18 | pub use self::{ |
19 | expr_ext::{ArrayExprKind, BinOp, Effect, ElseBranch, LiteralKind, PrefixOp, RangeOp}, | 19 | expr_ext::{ArrayExprKind, BinOp, Effect, ElseBranch, LiteralKind, PrefixOp, RangeOp}, |
20 | generated::{nodes::*, tokens::*}, | 20 | generated::*, |
21 | node_ext::{ | 21 | node_ext::{ |
22 | AttrKind, FieldKind, NameOrNameRef, PathSegmentKind, SelfParamKind, SlicePatComponents, | 22 | AttrKind, FieldKind, NameOrNameRef, PathSegmentKind, SelfParamKind, SlicePatComponents, |
23 | StructKind, TypeBoundKind, VisibilityKind, | 23 | StructKind, TypeBoundKind, VisibilityKind, |
@@ -139,7 +139,7 @@ fn test_doc_comment_of_statics() { | |||
139 | ) | 139 | ) |
140 | .ok() | 140 | .ok() |
141 | .unwrap(); | 141 | .unwrap(); |
142 | let st = file.syntax().descendants().find_map(StaticDef::cast).unwrap(); | 142 | let st = file.syntax().descendants().find_map(Static::cast).unwrap(); |
143 | assert_eq!("Number of levels", st.doc_comment_text().unwrap()); | 143 | assert_eq!("Number of levels", st.doc_comment_text().unwrap()); |
144 | } | 144 | } |
145 | 145 | ||
@@ -235,7 +235,7 @@ fn test_comments_preserve_trailing_whitespace() { | |||
235 | ) | 235 | ) |
236 | .ok() | 236 | .ok() |
237 | .unwrap(); | 237 | .unwrap(); |
238 | let def = file.syntax().descendants().find_map(StructDef::cast).unwrap(); | 238 | let def = file.syntax().descendants().find_map(Struct::cast).unwrap(); |
239 | assert_eq!( | 239 | assert_eq!( |
240 | "Representation of a Realm. \nIn the specification these are called Realm Records.", | 240 | "Representation of a Realm. \nIn the specification these are called Realm Records.", |
241 | def.doc_comment_text().unwrap() | 241 | def.doc_comment_text().unwrap() |
@@ -286,8 +286,8 @@ 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.ty().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()); |
293 | assert_bound("Debug", bounds.next()); | 293 | assert_bound("Debug", bounds.next()); |
@@ -304,20 +304,20 @@ where | |||
304 | let pred = predicates.next().unwrap(); | 304 | let pred = predicates.next().unwrap(); |
305 | let mut bounds = pred.type_bound_list().unwrap().bounds(); | 305 | let mut bounds = pred.type_bound_list().unwrap().bounds(); |
306 | 306 | ||
307 | assert_eq!("Iterator::Item", pred.type_ref().unwrap().syntax().text().to_string()); | 307 | assert_eq!("Iterator::Item", pred.ty().unwrap().syntax().text().to_string()); |
308 | assert_bound("'a", bounds.next()); | 308 | assert_bound("'a", bounds.next()); |
309 | 309 | ||
310 | let pred = predicates.next().unwrap(); | 310 | let pred = predicates.next().unwrap(); |
311 | let mut bounds = pred.type_bound_list().unwrap().bounds(); | 311 | let mut bounds = pred.type_bound_list().unwrap().bounds(); |
312 | 312 | ||
313 | assert_eq!("Iterator::Item", pred.type_ref().unwrap().syntax().text().to_string()); | 313 | assert_eq!("Iterator::Item", pred.ty().unwrap().syntax().text().to_string()); |
314 | assert_bound("Debug", bounds.next()); | 314 | assert_bound("Debug", bounds.next()); |
315 | assert_bound("'a", bounds.next()); | 315 | assert_bound("'a", bounds.next()); |
316 | 316 | ||
317 | let pred = predicates.next().unwrap(); | 317 | let pred = predicates.next().unwrap(); |
318 | let mut bounds = pred.type_bound_list().unwrap().bounds(); | 318 | let mut bounds = pred.type_bound_list().unwrap().bounds(); |
319 | 319 | ||
320 | assert_eq!("<T as Iterator>::Item", pred.type_ref().unwrap().syntax().text().to_string()); | 320 | assert_eq!("<T as Iterator>::Item", pred.ty().unwrap().syntax().text().to_string()); |
321 | assert_bound("Debug", bounds.next()); | 321 | assert_bound("Debug", bounds.next()); |
322 | assert_bound("'a", bounds.next()); | 322 | assert_bound("'a", bounds.next()); |
323 | 323 | ||
@@ -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.ty().unwrap().syntax().text().to_string()); |
330 | assert_bound("Fn(&'a str)", bounds.next()); | 330 | assert_bound("Fn(&'a str)", bounds.next()); |
331 | } | 331 | } |